Skip to content

Commit 37382f5

Browse files
committed
show this year's poll (by reversing last commit)
1 parent 24976f9 commit 37382f5

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

lib/haj_web/live/applications_live/index.ex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ defmodule HajWeb.ApplicationsLive.Index do
2424

2525
{_, max_count} = Enum.max_by(groups, &elem(&1, 1))
2626

27-
Enum.filter(groups, fn {_, count} -> count == max_count end)
28-
|> Enum.map(fn {group, _} -> group end)
27+
Enum.filter_map(groups, fn {_, count} -> count == max_count end, fn {group, _} ->
28+
group
29+
end)
2930
end
3031

3132
stats = %{

lib/haj_web/live/dashboard_live/index.html.heex

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,23 @@
77
<a href="mailto:[email protected]" class="text-burgandy-600 font-bold">mail</a>
88
eller Mattermost!
99
</p>
10+
<!-- TODO: Temp hardcoded stuff - Remove this when the polls are done -->
11+
<div :if={Policy.authorize?(:polls_vote, @current_user)} class="flex flex-col gap-4 pt-4">
12+
<h3 class="text-xl font-bold group-hover:text-burgandy-600">Aktuellt</h3>
13+
<div class="grid gap-4 sm:grid-cols-3 sm:gap-6 xl:grid-cols-4">
14+
<.card navigate={~p"/polls/2"}>
15+
<div class="text-burgandy-500 inline-flex items-center gap-2 text-lg font-bold">
16+
<.icon name={:musical_note} solid />
17+
<span class="">
18+
Låtar
19+
</span>
20+
</div>
21+
<div class="text-gray-500">
22+
Du kan nu rösta på låtar till årets spex!
23+
</div>
24+
</.card>
25+
</div>
26+
</div>
1027
<div class="flex flex-col gap-4 pt-2">
1128
<div>
1229
<h3 class="pt-2 pb-4 text-xl font-bold">Dina grupper</h3>

0 commit comments

Comments
 (0)