Add admin style

This commit is contained in:
julien committed 2026-11-02 17:38:41 +01:00
1 parent 9358dd39a1
commit f386499d2f
4 files changed
+86 -3

No files matched your search

+24 -1
View File
@@ -487,6 +487,29 @@ summary:focus-visible {
color: var(--color-text); color: var(--color-text);
} }
/* Admin
------------------------------------------------------------------------ */
.admin-table {
width: 100%;
border-collapse: collapse;
text-align: left;
}
.admin-table th,
.admin-table td {
padding: 10px 16px;
border-bottom: 1px solid var(--color-shadow-light);
}
.admin-table th {
color: var(--color-highlight);
}
.admin-table td {
vertical-align: top;
}
/* Pied de page /* Pied de page
------------------------------------------------------------------------ */ ------------------------------------------------------------------------ */
@@ -572,4 +595,4 @@ footer {
.box__link:hover { .box__link:hover {
transform: none; transform: none;
} }
} }
+17
View File
@@ -11,6 +11,23 @@ class Netig
view "admin" view "admin"
end end
end end
r.on "members" do
r.is do
r.get do
@page_title = "Adhérents — Admin — NETig"
@members = DB[:members]
.join(:accounts, id: :account_id)
.select_all(:members)
.select_append(Sequel[:accounts][:email].as(:email))
.order(Sequel[:members][:id])
.all
view "admin/members"
end
end
end
end end
private private
+7 -2
View File
@@ -1,6 +1,11 @@
<section class="page-section"> <section class="page-section">
<div class="content"> <div class="content">
<h1>Interface d'administration de NETig</h1> <h1>Administration de NETig</h1>
<p>Test</p>
<p>
<a class="button" href="/admin/members">
Gérer les adhérents
</a>
</p>
</div> </div>
</section> </section>
+38
View File
@@ -0,0 +1,38 @@
<section class="page-section">
<div class="content">
<h1>Adhérents</h1>
<% if @members.empty? %>
<p>Aucun adhérent enregistré.</p>
<% else %>
<table class="admin-table">
<thead>
<tr>
<th>Identité</th>
<th>Type</th>
<th>Adresse électronique</th>
<th>Administration</th>
</tr>
</thead>
<tbody>
<% @members.each do |member| %>
<tr>
<td>
<%= member[:kind] == "individual" ?
"#{member[:first_name]} #{member[:last_name]}" :
member[:organization_name] %>
</td>
<td>
<%= member[:kind] == "individual" ?
"Personne physique" : "Personne morale" %>
</td>
<td><%= member[:email] %></td>
<td><%= member[:admin] ? "Oui" : "Non" %></td>
</tr>
<% end %>
</tbody>
</table>
<% end %>
</div>
</section>