Skip to content

Commit aa41110

Browse files
committed
add status icons and update default display for team status
1 parent 47cb54b commit aa41110

File tree

3 files changed

+32
-6
lines changed

3 files changed

+32
-6
lines changed

packages/hacker_dashboard_portal/app/definitions/hacker_dashboard_portal/hackathon/team_definition.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class HackerDashboardPortal::Hackathon::TeamDefinition < ::Hackathon::TeamDefini
1515

1616
display :name, wrapper: {class: "col-span-2 row-start-1"}
1717
display :hacker, wrapper: {class: "col-span-2"}
18-
display :status, wrapper: {class: "col-span-full"}
18+
display :status, wrapper: {class: "col-span-full"}, formatter: ->(value) { value.titleize }
1919

2020
action :invite_member,
2121
interaction: Hackathon::Teams::InviteMember

packages/hacker_dashboard_portal/app/policies/hacker_dashboard_portal/hackathon/team_membership_policy.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def permitted_attributes_for_read
3131
if invitation && user.team.nil?
3232
relation.or(Hackathon::Team.where(id: invitation.team.id))
3333
else
34-
relation
34+
relation.where(team: user.team)
3535
end
3636
end
3737
end

packages/hacker_dashboard_portal/app/views/hacker_dashboard_portal/dashboard/_team_dashboard.html.erb

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,39 @@
5757
<div class="flex items-center gap-4">
5858
<div class="flex-shrink-0">
5959
<div class="w-12 h-12 bg-purple-100 dark:bg-purple-900/50 rounded-lg flex items-center justify-center">
60-
<svg class="w-6 h-6 text-purple-600 dark:text-purple-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
61-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
62-
</svg>
60+
<%# Map the Hackathon::Team enum statuses to icons %>
61+
<% case (team.status || '').to_s %>
62+
<% when 'unqualified' %>
63+
<!-- Unqualified: x-circle (needs work) -->
64+
<svg class="w-6 h-6 text-purple-600 dark:text-purple-400" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
65+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18.364 5.636L5.636 18.364" />
66+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5.636 5.636L18.364 18.364" />
67+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
68+
</svg>
69+
<% when 'qualified' %>
70+
<!-- Qualified: check -->
71+
<svg class="w-6 h-6 text-purple-600 dark:text-purple-400" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
72+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4" />
73+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
74+
</svg>
75+
<% when 'late_qualified' %>
76+
<!-- Late qualified: clock-check (clock with a check) -->
77+
<svg class="w-6 h-6 text-purple-600 dark:text-purple-400" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
78+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l2 2" />
79+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
80+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4" />
81+
</svg>
82+
<% else %>
83+
<!-- Fallback: generic circle-check -->
84+
<svg class="w-6 h-6 text-purple-600 dark:text-purple-400" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
85+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4" />
86+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
87+
</svg>
88+
<% end %>
6389
</div>
6490
</div>
6591
<div>
66-
<p class="text-lg font-bold text-gray-900 dark:text-white"><%= team.status&.titleize || 'Active' %></p>
92+
<p class="text-lg font-bold text-gray-900 dark:text-white"><%= team.status&.titleize || 'Unqualified' %></p>
6793
<p class="text-sm text-gray-600 dark:text-gray-300">Team Status</p>
6894
</div>
6995
</div>

0 commit comments

Comments
 (0)