Skip to content

Commit efbdbba

Browse files
committed
update code
1 parent 0651a7e commit efbdbba

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

src/clojurians_log/routes.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
(let [db (db-from-endpoint endpoint)]
137137
(-> request
138138
make-context
139-
(assoc :data/username
139+
(assoc :data/user-profile
140140
(queries/user-profile db (get-in request [:path-params :user-id])))
141141
views/user-profile-route
142142
response/render)))
@@ -181,6 +181,6 @@
181181
["/_/stats/{from-date}/{to-date}" {:name :clojurians-log.routes/message-stats
182182
:get message-stats-route}]
183183

184-
{:conflicts nil}
184+
;; {:conflicts nil}
185185
]
186186
)

src/clojurians_log/views.clj

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -178,17 +178,18 @@
178178
{:message/keys [user inst user text thread-ts ts] :as message}]
179179

180180
(let [{:user/keys [name slack-id]
181-
:user-profile/keys [display-name real-name image-48]} user]
182-
(def slack-instance (:clojurians-log.application/slack-instance request))
181+
:user-profile/keys [display-name real-name image-48]} user]
182+
(def slack-instance (:clojurians-log.application/slack-instance request))
183+
183184

184185
;; things in the profile
185186
;; :image_512 :email :real_name_normalized :image_48 :image_192 :real_name :image_72 :image_24
186187
;; :avatar_hash :title :team :image_32 :display_name :display_name_normalized
187188
(list [:div.message
188189
{:id (cl.tu/format-inst-id inst) :class (when (thread-child? message) "thread-msg")}
189-
[:a.message_profile-pic {:href (str slack-instance "/users/x/x/" slack-id) :style (str "background-image: url(" image-48 ");")}]
190+
[:a.message_profile-pic {:href (str slack-instance "/users/x/x/" slack-id) :style (str "background-image: url(" image-48 ");")}]
190191
;;[:a.message_username {:href (str slack-instance "/team/" slack-id)}
191-
[:a.message_username {:href (str "/_/_/users/" slack-id)}
192+
[:a.message_username {:href (str "/_/_/users/" slack-id)}
192193
(some #(when-not (str/blank? %) %) [display-name real-name name])]
193194
[:span.message_timestamp [:a {:rel "nofollow"
194195
:href (path-for context
@@ -288,13 +289,13 @@
288289
[:div {:style " box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2); max-width: 350px;
289290
margin: auto; text-align: center; font-family: sans-serif;"}
290291

291-
(for [[k v] (select-keys (get-in context [:data/username 0])
292+
(for [[k v] (select-keys (get-in context [:data/user-profile 0])
292293
[:user-profile/display-name :user-profile/real-name :user-profile/image-192 :user/slack-id])
293294
:when (-> k)]
294295
(case k
295-
:user-profile/image-192 [:img {:src [v], :alt "John", :style "width:95%; border-radius:80%; padding: 8px 0px;"}]
296-
:user-profile/display-name [:h1 [k v]]
297-
:user-profile/real-name [:p {:style "color: grey; font-size: 18px;"} [k v]]
296+
:user-profile/image-192 [:img {:src v, :style "width:95%; border-radius:80%; padding: 8px 0px;"}]
297+
:user-profile/display-name [:h1 v]
298+
:user-profile/real-name [:p {:style "color: grey; font-size: 18px;"} v]
298299
:user/slack-id [:a {:style "border: none; outline: 0; display: inline-block; padding: 8px 0px;
299300
color: white; background-color: #000; text-align: center; cursor: pointer;
300301
width: 100%; font-size: 18px;"

0 commit comments

Comments
 (0)