Skip to content

Commit

Permalink
Hooking up the capacity gauge
Browse files Browse the repository at this point in the history
  • Loading branch information
MTrost committed Jul 26, 2024
1 parent 0aaea78 commit 1b0925a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/co/gaiwan/compass/html/sessions.clj
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@
[session-actions :text-right]
[:.expansion {:display "none"}]
[:&.expanded [:.expansion {:display "block"}]]
([{:session/keys [type title subtitle organized time location image participants] :as session}
([{:session/keys [type title subtitle organized time
location image participants
capacity signup-count] :as session}
{user-id :db/id}]
[:<>
{:style {--session-type-color (:session.type/color type)}
Expand All @@ -100,7 +102,7 @@

[:div.details
[:div.guage
[capacity-gauge {:capacity (rand)
[capacity-gauge {:capacity (/ (or signup-count 0) capacity)
:image (if image
(str "url(" image ")")
(str "var(--gradient-" (inc (rand-int 7)) ")"))
Expand Down Expand Up @@ -153,7 +155,7 @@

[:div.details
[:div.guage
[capacity-gauge {:capacity (rand)
[capacity-gauge {:capacity (/ (or signup-count 0) capacity)
:image (if image
(str "url(" image ")")
(str "var(--gradient-" (inc (rand-int 7)) ")"))
Expand Down

0 comments on commit 1b0925a

Please sign in to comment.