Skip to content

Commit

Permalink
link to user profile at session
Browse files Browse the repository at this point in the history
  • Loading branch information
humorless committed Sep 15, 2024
1 parent ef23472 commit 9b3e32f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions repl-sessions/participants.clj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
(mapv
(fn [x]
{:db/id (str "temp-" x)
:user/uuid (random-uuid)
:discord/email (str "temp-email-" x "@gaiwan.co")
:public-profile/hidden? (if (even? x) true false)
:public-profile/name (str "temp-user-" x)
Expand Down
3 changes: 2 additions & 1 deletion src/co/gaiwan/compass/html/sessions.clj
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@
[:<>
[c/image-frame {:profile/image (user/avatar-css-value p)}]
[:div.details
[:div.profile-name (:public-profile/name p)]]]))
[:a {:href (url-for :profile/show {:profile-id (:user/uuid p)})}
[:div.profile-name (:public-profile/name p)]]]]))

(o/defstyled session-detail :div
[capacity-gauge :w-100px]
Expand Down
6 changes: 3 additions & 3 deletions src/co/gaiwan/compass/routes/profiles.clj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
[ring.util.response :as ring-response]))

(defn GET-profile [{:keys [params] :as req}]
(tap> {:params params})
{:html/body
[h/profile-detail
(if-let [profile-id (:profile-id params)]
Expand Down Expand Up @@ -90,7 +91,7 @@
(defn parse-link-data [params variant]
(map vector
(get params (keyword (str variant "-link-type")))
(get params (keyword (str variant "-link-ref")))) )
(get params (keyword (str variant "-link-ref")))))

(defn reconcile-links [user-id variant old-links new-links]
(let [existing-pairs (map (juxt :profile-link/type :profile-link/href) old-links)
Expand Down Expand Up @@ -149,8 +150,7 @@
(conj [:db/retract user-id :private-profile/name (:private-profile/name user)])

(not (str/blank? name_private))
(conj [:db/add user-id :private-profile/name name_private])
)))
(conj [:db/add user-id :private-profile/name name_private]))))

(defn POST-save-profile
"Save profile to DB
Expand Down

0 comments on commit 9b3e32f

Please sign in to comment.