Skip to content

Commit 810f6e3

Browse files
committed
Include count again in channel-days
1 parent f5ca6a0 commit 810f6e3

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/clojurians_log/db/queries.clj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@
102102
(some->> chan-name
103103
chan-name->id
104104
chan-day-cnt
105-
keys
106-
(sort reverse-compare))))
105+
(sort-by first reverse-compare))))
107106

108107
(defn channel [db name]
109108
(d/q '[:find (pull ?chan [*]) .

src/clojurians_log/routes.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
(-> request
9898
context
9999
(assoc :data/title (str "Clojurians Slack Log | " channel)
100-
:data/days (queries/channel-days db channel)
100+
:data/channel-days (queries/channel-days db channel)
101101
:data/channel-name channel)
102102
views/channel-page
103103
response/render)))

src/clojurians_log/views.clj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@
9999
(map vector (range) $)
100100
(some (fn [[index a-date]] index) $)
101101
(+ $ offset)
102-
(nth channel-days $ nil)))
102+
(nth channel-days $ nil)
103+
(first $)))
103104

104105
(defn- log-page-header [{:data/keys [channel date channel-days]}]
105106
[:div.header
@@ -188,14 +189,14 @@
188189
[:div.listings_direct-messages]]
189190
(message-history context)]]])
190191

191-
(defn- channel-page-html [{:data/keys [days channel-name] :as context}]
192+
(defn- channel-page-html [{:data/keys [channel-days channel-name] :as context}]
192193
[:html
193194
(page-head context)
194195
[:body
195196
[:div.main
196197
[:h1 "Channel: #" channel-name]
197198
[:ul
198-
(for [[day cnt] days]
199+
(for [[day cnt] channel-days]
199200
[:li [:a {:href (bidi/path-for routes
200201
:log
201202
:channel channel-name

0 commit comments

Comments
 (0)