|
1 | | -<div class="min-h-screen py-8"> |
2 | | - <div class="max-w-full mx-auto px-4 sm:px-6 lg:px-8"> |
3 | | - <div class="max-w-7xl mx-auto <%= DomainTheme.bg_class_for(:facilitators) %> border border-gray-200 rounded-xl shadow-lg hover:shadow-xl transition-shadow duration-200 p-6"> |
4 | | - <div class="space-y-6"> |
5 | | - <!-- Header --> |
6 | | - <div class="flex items-center justify-between mb-6"> |
7 | | - <h1 class="text-2xl font-semibold text-gray-900"> |
8 | | - <%= Facilitator.model_name.human.pluralize %> (<%= @facilitators_count %>) |
9 | | - </h1> |
10 | | - <div class="flex gap-2"> |
11 | | - <% if current_user.super_user? %> |
12 | | - <%= link_to "New #{Facilitator.model_name.human.downcase}", |
13 | | - new_facilitator_path, |
14 | | - class: "admin-only bg-blue-100 btn btn-primary-outline" %> |
15 | | - <% end %> |
16 | | - </div> |
17 | | - </div> |
| 1 | +<div class="community-news-index max-w-7xl mx-auto <%= DomainTheme.bg_class_for(:facilitators) %> border border-gray-200 rounded-xl shadow p-6"> |
| 2 | + <div class="w-full"> |
| 3 | + <div class="flex items-start justify-between mb-6"> |
| 4 | + <div class="pr-6"> |
| 5 | + <h2 class="text-2xl font-semibold mb-2">Facilitators (<%= @count_display %>)</h2> |
| 6 | + </div> |
| 7 | + <div class="text-right text-end"> |
| 8 | + <% if current_user.super_user? %> |
| 9 | + <%= link_to "New Facilitator", |
| 10 | + new_facilitator_path, |
| 11 | + class: "admin-only bg-blue-100 btn btn-primary-outline" %> |
| 12 | + <% end %> |
| 13 | + </div> |
| 14 | + </div> |
18 | 15 |
|
19 | | - <!-- Filter form --> |
20 | | - <%= render "search_boxes" %> |
| 16 | + <%= render "search_boxes" %> |
21 | 17 |
|
22 | | - <div class="rounded-xl bg-white p-6"> |
23 | | - <div class="overflow-x-auto"> |
24 | | - <table class="w-full border-collapse border border-gray-200"> |
25 | | - <thead class="bg-gray-100"> |
26 | | - <tr> |
27 | | - <th class="px-4 py-2 text-left text-sm font-semibold text-gray-700 w-1/6">Name</th> |
28 | | - <th class="px-4 py-2 text-center text-sm font-semibold text-gray-700 w-1/6">Facilitator since</th> |
29 | | - <th class="px-4 py-2 text-left text-sm font-semibold text-gray-700 w-1/6">Sector(s)</th> |
30 | | - <th class="px-4 py-2 text-left text-sm font-semibold text-gray-700 w-1/3">Affiliation(s)</th> |
31 | | - <th class="px-4 py-2 text-left text-sm font-semibold text-gray-700 w-1/6">Socials</th> |
32 | | - <% if current_user.super_user? %> |
33 | | - <th class="px-4 py-2 text-center text-sm font-semibold text-gray-700 w-[80px]">Actions</th> |
34 | | - <% end %> |
35 | | - </tr> |
36 | | - </thead> |
| 18 | + <div class="rounded-xl bg-white p-6"> |
| 19 | + <div class="overflow-x-auto"> |
| 20 | + <table class="w-full border-collapse border border-gray-200"> |
| 21 | + <thead class="bg-gray-100"> |
| 22 | + <tr> |
| 23 | + <th class="px-4 py-2 text-left text-sm font-semibold text-gray-700 w-1/6">Name</th> |
| 24 | + <th class="px-4 py-2 text-center text-sm font-semibold text-gray-700 w-1/6">Facilitator since</th> |
| 25 | + <th class="px-4 py-2 text-left text-sm font-semibold text-gray-700 w-1/6">Sector(s)</th> |
| 26 | + <th class="px-4 py-2 text-left text-sm font-semibold text-gray-700 w-1/3">Affiliation(s)</th> |
| 27 | + <th class="px-4 py-2 text-left text-sm font-semibold text-gray-700 w-1/6">Socials</th> |
| 28 | + <% if current_user.super_user? %> |
| 29 | + <th class="px-4 py-2 text-center text-sm font-semibold text-gray-700 w-[80px]">Actions</th> |
| 30 | + <% end %> |
| 31 | + </tr> |
| 32 | + </thead> |
37 | 33 |
|
38 | | - <tbody class="divide-y divide-gray-200"> |
39 | | - <% @facilitators.each do |facilitator| %> |
40 | | - <% facilitator = facilitator.decorate %> |
41 | | - <tr class="hover:bg-gray-50 transition-colors duration-150"> |
42 | | - <td class="px-4 py-2"> |
43 | | - <%= facilitator_profile_button(facilitator) %> |
44 | | - </td> |
| 34 | + <tbody class="divide-y divide-gray-200"> |
| 35 | + <% @facilitators.each do |facilitator| %> |
| 36 | + <% facilitator = facilitator.decorate %> |
| 37 | + <tr class="hover:bg-gray-50 transition-colors duration-150"> |
| 38 | + <td class="px-4 py-2"> |
| 39 | + <%= facilitator_profile_button(facilitator) %> |
| 40 | + </td> |
45 | 41 |
|
46 | | - <td class="px-4 py-2 text-center text-sm text-gray-800"> |
47 | | - <%= facilitator.member_since_year %> |
48 | | - </td> |
| 42 | + <td class="px-4 py-2 text-center text-sm text-gray-800"> |
| 43 | + <%= facilitator.member_since_year %> |
| 44 | + </td> |
49 | 45 |
|
50 | | - <!-- Sectors --> |
51 | | - <td class="px-4 py-2 text-sm text-gray-800"> |
52 | | - <div class="flex flex-wrap gap-2"> |
53 | | - <% facilitator.sectorable_items.each do |si| %> |
54 | | - <% si_name = "#{ si.sector.name }#{ " (#{"leader"})" if si.is_leader? }" %> |
55 | | - <span class="inline-flex items-center px-2 py-1 rounded-full text-xs |
56 | | - font-medium bg-gray-400 text-white whitespace-nowrap"> |
57 | | - <%= link_to si_name, taggings_path(sector_names: si.sector.name) %> |
58 | | - </span> |
59 | | - <% end %> |
60 | | - </div> |
61 | | - </td> |
| 46 | + <!-- Sectors --> |
| 47 | + <td class="px-4 py-2 text-sm text-gray-800"> |
| 48 | + <div class="flex flex-wrap gap-2"> |
| 49 | + <% facilitator.sectorable_items.each do |si| %> |
| 50 | + <% si_name = "#{ si.sector.name }#{ " (#{"leader"})" if si.is_leader? }" %> |
| 51 | + <span class="inline-flex items-center px-2 py-1 rounded-full text-xs |
| 52 | + font-medium bg-gray-400 text-white whitespace-nowrap"> |
| 53 | + <%= link_to si_name, taggings_path(sector_names: si.sector.name) %> |
| 54 | + </span> |
| 55 | + <% end %> |
| 56 | + </div> |
| 57 | + </td> |
62 | 58 |
|
63 | | - <!-- Organizations --> |
64 | | - <td class="px-4 py-2 text-sm text-gray-800"> |
65 | | - <% if facilitator.user&.projects&.any? %> |
66 | | - <% user_project_names = facilitator.user.projects.map(&:name).join(", ") %> |
67 | | - <span title="<%= user_project_names %>"> |
68 | | - <%= truncate(user_project_names, length: 120) %> |
69 | | - </span> |
70 | | - <% else %> |
71 | | - <span>--</span> |
72 | | - <% end %> |
73 | | - </td> |
| 59 | + <!-- Organizations --> |
| 60 | + <td class="px-4 py-2 text-sm text-gray-800"> |
| 61 | + <% if facilitator.user&.projects&.any? %> |
| 62 | + <% user_project_names = facilitator.user.projects.map(&:name).join(", ") %> |
| 63 | + <span title="<%= user_project_names %>"> |
| 64 | + <%= truncate(user_project_names, length: 120) %> |
| 65 | + </span> |
| 66 | + <% else %> |
| 67 | + <span>--</span> |
| 68 | + <% end %> |
| 69 | + </td> |
74 | 70 |
|
75 | | - <!-- Phone --> |
76 | | - <td class="px-4 py-2 text-sm text-gray-800 whitespace-nowrap"> |
77 | | - <%= render "social_media_buttons", facilitator: facilitator %> |
78 | | - </td> |
| 71 | + <!-- Phone --> |
| 72 | + <td class="px-4 py-2 text-sm text-gray-800 whitespace-nowrap"> |
| 73 | + <%= render "social_media_buttons", facilitator: facilitator %> |
| 74 | + </td> |
79 | 75 |
|
80 | | - <!-- Actions --> |
81 | | - <% if current_user.super_user? %> |
82 | | - <td class="px-4 py-2 justify-center gap-2"> |
83 | | - <%= link_to "User", user_path(facilitator.user), |
84 | | - class: "admin-only bg-blue-100 btn btn-secondary-outline" if facilitator.user %> |
85 | | - <%= link_to "Edit", edit_facilitator_path(facilitator), |
86 | | - class: "admin-only bg-blue-100 btn btn-secondary-outline" %> |
87 | | - </td> |
88 | | - <% end %> |
89 | | - </tr> |
| 76 | + <!-- Actions --> |
| 77 | + <% if current_user.super_user? %> |
| 78 | + <td class="px-4 py-2 justify-center gap-2"> |
| 79 | + <%= link_to "User", user_path(facilitator.user), |
| 80 | + class: "admin-only bg-blue-100 btn btn-secondary-outline" if facilitator.user %> |
| 81 | + <%= link_to "Edit", edit_facilitator_path(facilitator), |
| 82 | + class: "admin-only bg-blue-100 btn btn-secondary-outline" %> |
| 83 | + </td> |
90 | 84 | <% end %> |
91 | | - </tbody> |
92 | | - </table> |
93 | | - </div> |
94 | | - </div> |
95 | | - |
96 | | - <!-- Empty state --> |
97 | | - <% unless @facilitators.any? %> |
98 | | - <p class="text-gray-500 text-center py-6"> |
99 | | - No <%= Facilitator.model_name.human.pluralize %> found. |
100 | | - </p> |
| 85 | + </tr> |
101 | 86 | <% end %> |
| 87 | + </tbody> |
| 88 | + </table> |
| 89 | + </div> |
| 90 | + </div> |
| 91 | + |
| 92 | + <!-- Empty state --> |
| 93 | + <% unless @facilitators.any? %> |
| 94 | + <p class="text-gray-500 text-center py-6"> |
| 95 | + No <%= Facilitator.model_name.human.pluralize %> found. |
| 96 | + </p> |
| 97 | + <% end %> |
102 | 98 |
|
103 | | - <!-- Pagination --> |
104 | | - <div class="mt-6 flex justify-center"> |
105 | | - <div class="pagination"> |
106 | | - <%= tailwind_paginate @facilitators %> |
107 | | - </div> |
108 | | - </div> |
| 99 | + <!-- Pagination --> |
| 100 | + <div class="mt-6 flex justify-center"> |
| 101 | + <div class="pagination"> |
| 102 | + <%= tailwind_paginate @facilitators %> |
109 | 103 | </div> |
110 | 104 | </div> |
111 | 105 | </div> |
|
0 commit comments