Files
netig.net/views/noyau/memberships.erb
T
2026-11-03 21:38:38 +01:00

97 lines
3.2 KiB
ERB

<section class="page-section">
<div class="content page-panel">
<h1>Demandes d'adhésion</h1>
<% if flash["notice"] || flash["error"] %>
<div class="flash-container">
<% if notice = flash["notice"] %>
<p class="flash flash--notice" role="status"><%= notice %></p>
<% end %>
<% if error = flash["error"] %>
<p class="flash flash--error" role="alert"><%= error %></p>
<% end %>
</div>
<% end %>
<p>
Consultez les demandes d'adhésion en attente d'examen
par le Noyau.
</p>
<% if @memberships.empty? %>
<p>Aucune demande d'adhésion en attente.</p>
<% else %>
<div class="table-wrapper">
<table class="members-table memberships-table">
<colgroup>
<col class="membership-col-identity">
<col class="membership-col-email">
<col class="membership-col-date">
<col class="membership-col-actions">
</colgroup>
<thead>
<tr>
<th scope="col">Identité</th>
<th scope="col">Email</th>
<th scope="col">Demande</th>
<th scope="col">Décision</th>
</tr>
</thead>
<tbody>
<% @memberships.each do |membership| %>
<tr>
<td data-label="Identité">
<% if membership[:member_kind] == "individual" %>
<strong><%= "#{membership[:member_first_name]} #{membership[:member_last_name]}" %></strong>
<small class="membership-kind">· Personne physique</small>
<% else %>
<strong><%= membership[:member_organization_name] %></strong>
<small class="membership-kind">· Personne morale</small>
<% end %>
</td>
<td data-label="Email">
<%= membership[:account_email] %>
</td>
<td data-label="Demande">
<time class="membership-date">
<%= membership[:requested_at].strftime("%d/%m/%Y à %H:%M") %>
</time>
</td>
<td data-label="Décision">
<div class="membership-actions">
<form
method="post"
action="/noyau/memberships/<%= membership[:id] %>/accept"
>
<%== rodauth.csrf_tag("/noyau/memberships/#{membership[:id]}/accept") %>
<button class="button" type="submit">
Accepter
</button>
</form>
<form
method="post"
action="/noyau/memberships/<%= membership[:id] %>/reject"
>
<%== rodauth.csrf_tag("/noyau/memberships/#{membership[:id]}/reject") %>
<button class="button button--secondary" type="submit">
Refuser
</button>
</form>
</div>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<% end %>
</div>
</section>