|
1 | | -<div class="container mx-auto p-4"> |
2 | | - <div class="flex items-center justify-between mb-6"> |
3 | | - <h5 |
4 | | - class=" |
5 | | - mb-2 text-3xl font-extrabold leading-none tracking-tight text-gray-900 |
6 | | - md:text-4xl dark:text-white |
7 | | - " |
8 | | - > |
| 1 | +<div class="container mx-auto p-4 max-w-7xl"> |
| 2 | + <header class="mb-8"> |
| 3 | + <h1 class="text-3xl md:text-4xl font-bold text-gray-900 dark:text-white mb-2"> |
9 | 4 | Hackathon Dashboard |
10 | | - </h5> |
| 5 | + </h1> |
| 6 | + <p class="text-gray-600 dark:text-gray-400"> |
| 7 | + Overview of all hackathon activities and resources |
| 8 | + </p> |
| 9 | + </header> |
| 10 | + |
| 11 | + <!-- Summary Statistics --> |
| 12 | + <div class="grid grid-cols-2 sm:grid-cols-4 gap-4 mb-8"> |
| 13 | + <div class="bg-gradient-to-r from-blue-500 to-blue-600 rounded-lg p-4 text-white"> |
| 14 | + <div class="text-2xl font-bold"><%= Hackathon::Team.count %></div> |
| 15 | + <div class="text-blue-100 text-sm">Total Teams</div> |
| 16 | + </div> |
| 17 | + <div class="bg-gradient-to-r from-green-500 to-green-600 rounded-lg p-4 text-white"> |
| 18 | + <div class="text-2xl font-bold"><%= Hackathon::Team.qualified.count %></div> |
| 19 | + <div class="text-green-100 text-sm">Qualified Teams</div> |
| 20 | + </div> |
| 21 | + <div class="bg-gradient-to-r from-purple-500 to-purple-600 rounded-lg p-4 text-white"> |
| 22 | + <div class="text-2xl font-bold"><%= authorized_resource_scope(registered_resources.find { |r| r.model_name.human == 'Hacker' }).count rescue 0 %></div> |
| 23 | + <div class="text-purple-100 text-sm">Total Hackers</div> |
| 24 | + </div> |
| 25 | + <div class="bg-gradient-to-r from-orange-500 to-orange-600 rounded-lg p-4 text-white"> |
| 26 | + <div class="text-2xl font-bold"><%= authorized_resource_scope(registered_resources.find { |r| r.model_name.human == 'Invitation' }).count rescue 0 %></div> |
| 27 | + <div class="text-orange-100 text-sm">Invitations</div> |
| 28 | + </div> |
11 | 29 | </div> |
12 | | - <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"> |
13 | | - <% icon_style = "dark:stroke-white w-12 h-12" %> |
| 30 | + |
| 31 | + <!-- Resource Cards --> |
| 32 | + <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6"> |
| 33 | + <% icon_style = "w-8 h-8 text-current" %> |
14 | 34 | <% registered_resources.each do |resource| %> |
15 | 35 | <% next unless allowed_to?(:index?, resource) && ['Team', 'Invitation', 'Hacker', "Check in"].include?(resource.model_name.human) %> |
16 | | - <div |
17 | | - class="bg-white dark:bg-gray-800 shadow-md rounded-lg overflow-hidden" |
18 | | - > |
19 | | - <div class="p-4"> |
20 | | - <div class="flex items-center space-x-2 mb-2 hover:animate-pulse"> |
21 | | - <%= render icon_for(resource.model_name.human) %> |
22 | | - <div class="flex flex-col"> |
23 | | - <a |
24 | | - href="<%= resource_url_for(resource, parent: nil) %>" |
25 | | - class=" |
26 | | - text-2xl font-medium text-gray-900 dark:text-white truncate hover:underline |
27 | | - " |
28 | | - > |
29 | | - <%= resource.model_name.human.pluralize.titleize %> |
30 | | - </a> |
31 | | - <p class="text-sm font-medium text-gray dark:text-white"> |
32 | | - <%= description_for(resource.model_name.human) %> |
33 | | - </p> |
| 36 | + <a href="<%= resource_url_for(resource, parent: nil) %>" class="group block h-full"> |
| 37 | + <div class="bg-white dark:bg-gray-800 shadow-lg rounded-xl overflow-hidden border border-gray-200 dark:border-gray-700 hover:shadow-xl transition-all duration-300 hover:-translate-y-1 cursor-pointer h-full flex flex-col"> |
| 38 | + <div class="p-6 flex-1 flex flex-col"> |
| 39 | + <div class="flex items-start space-x-4 mb-4"> |
| 40 | + <div class="flex-shrink-0 p-3 bg-gray-100 dark:bg-gray-700 rounded-lg group-hover:bg-blue-100 dark:group-hover:bg-blue-900 transition-colors duration-300"> |
| 41 | + <div class="text-gray-600 dark:text-gray-300 group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors duration-300"> |
| 42 | + <%= render icon_for(resource.model_name.human, style: icon_style) %> |
| 43 | + </div> |
| 44 | + </div> |
| 45 | + <div class="flex-1 min-w-0"> |
| 46 | + <h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-1 group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors duration-200"> |
| 47 | + <%= resource.model_name.human.pluralize.titleize %> |
| 48 | + </h3> |
| 49 | + <p class="text-sm text-gray-600 dark:text-gray-400 leading-relaxed"> |
| 50 | + <%= description_for(resource.model_name.human) %> |
| 51 | + </p> |
| 52 | + </div> |
| 53 | + </div> |
| 54 | + <div class="flex items-center justify-between mt-auto"> |
| 55 | + <div class="text-2xl font-bold text-gray-900 dark:text-white"> |
| 56 | + <%= authorized_resource_scope(resource).count %> |
| 57 | + </div> |
| 58 | + <div class="text-xs text-gray-500 dark:text-gray-400 uppercase tracking-wide font-medium"> |
| 59 | + <%= resource.model_name.human.pluralize %> |
| 60 | + </div> |
34 | 61 | </div> |
35 | | - </div> |
36 | | - <div class="mt-2 text-xl font-semibold text-gray-900 dark:text-white"> |
37 | | - <%= authorized_resource_scope(resource).count %> |
38 | 62 | </div> |
39 | 63 | </div> |
40 | | - </div> |
| 64 | + </a> |
41 | 65 | <% end %> |
42 | | - <div class="bg-white dark:bg-gray-800 shadow-md rounded-lg overflow-hidden"> |
43 | | - <div class="p-4"> |
44 | | - <div class="flex items-center space-x-2 mb-2 hover:animate-pulse"> |
45 | | - <%= render Phlex::TablerIcons::Bulb.new(class: icon_style) %> |
46 | | - <div class="flex flex-col"> |
47 | | - <a |
48 | | - href="<%= hackathon_teams_path(q: { scope: 'qualified' }) %>" |
49 | | - class=" |
50 | | - text-2xl font-medium text-gray-900 dark:text-white truncate hover:underline |
51 | | - " |
52 | | - > |
53 | | - Qualified Teams |
54 | | - </a> |
55 | | - <p class="text-sm font-medium text-gray dark:text-white"> |
56 | | - Qualified teams are teams with a minimum of 3 registered members. |
57 | | - </p> |
| 66 | + <!-- Qualified Teams Special Card --> |
| 67 | + <a href="<%= hackathon_teams_path(q: { scope: 'qualified' }) %>" class="group block h-full"> |
| 68 | + <div class="bg-gradient-to-br from-yellow-50 to-yellow-100 dark:from-yellow-900/20 dark:to-yellow-800/20 shadow-lg rounded-xl overflow-hidden border border-yellow-200 dark:border-yellow-700 hover:shadow-xl transition-all duration-300 hover:-translate-y-1 cursor-pointer h-full flex flex-col"> |
| 69 | + <div class="p-6 flex-1 flex flex-col"> |
| 70 | + <div class="flex items-start space-x-4 mb-4"> |
| 71 | + <div class="flex-shrink-0 p-3 bg-yellow-200 dark:bg-yellow-800 rounded-lg group-hover:bg-yellow-300 dark:group-hover:bg-yellow-700 transition-colors duration-300"> |
| 72 | + <div class="text-yellow-700 dark:text-yellow-300"> |
| 73 | + <%= render Phlex::TablerIcons::Bulb.new(class: icon_style) %> |
| 74 | + </div> |
| 75 | + </div> |
| 76 | + <div class="flex-1 min-w-0"> |
| 77 | + <h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-1 group-hover:text-yellow-600 dark:group-hover:text-yellow-400 transition-colors duration-200"> |
| 78 | + Qualified Teams |
| 79 | + </h3> |
| 80 | + <p class="text-sm text-gray-600 dark:text-gray-400 leading-relaxed"> |
| 81 | + Qualified teams are teams with a minimum of <%= Hackathon::Team::MINIMUM_TEAM_MEMBERSHIPS %> registered members. |
| 82 | + </p> |
| 83 | + </div> |
| 84 | + </div> |
| 85 | + <div class="flex items-center justify-between mt-auto"> |
| 86 | + <div class="text-2xl font-bold text-gray-900 dark:text-white"> |
| 87 | + <%= Hackathon::Team.qualified.size %> |
| 88 | + </div> |
| 89 | + <div class="text-xs text-gray-500 dark:text-gray-400 uppercase tracking-wide font-medium"> |
| 90 | + Teams |
| 91 | + </div> |
58 | 92 | </div> |
59 | | - </div> |
60 | | - <div class="mt-2 text-xl font-semibold text-gray-900 dark:text-white"> |
61 | | - <%= Hackathon::Team.qualified.size %> |
62 | 93 | </div> |
63 | 94 | </div> |
64 | | - </div> |
| 95 | + </a> |
65 | 96 | </div> |
66 | 97 | </div> |
0 commit comments