Updated Member Index View Layout foundation behind a feature flag. (#16958)
This commit is contained in:
parent
6869917904
commit
28b1c09b83
3 changed files with 105 additions and 30 deletions
|
|
@ -1,33 +1,73 @@
|
|||
<header>
|
||||
<h1 class="crayons-title">People</h1>
|
||||
<%= render "menu" %>
|
||||
</header>
|
||||
<% if FeatureFlag.enabled?(:member_index_view) %>
|
||||
<div class="crayons-card p-3 s:p-4 m:p-7">
|
||||
<header class="flex justify-content-between">
|
||||
<h1 class="crayons-title">Members</h1>
|
||||
<%= render "admin/users/index/tabs" %>
|
||||
</header>
|
||||
|
||||
<%= paginate @users, theme: "internal" %>
|
||||
<%= render "admin/users/index/controls" %>
|
||||
|
||||
<table class="crayons-table" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Username</th>
|
||||
<th scope="col">ID</th>
|
||||
<th scope="col">Name</th>
|
||||
<th scope="col">Twitter</th>
|
||||
<th scope="col">GitHub</th>
|
||||
<th scope="col">Email</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="crayons-card">
|
||||
<% @users.each do |user| %>
|
||||
<tr>
|
||||
<td><%= link_to user.username, admin_user_path(user) %></td>
|
||||
<td class="whitespace-nowrap"><%= user.id %></td>
|
||||
<td><%= user.name %></td>
|
||||
<td><%= user_twitter_link(user) %></td>
|
||||
<td><%= user_github_link(user) %></td>
|
||||
<td><%= user.email %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<%= paginate @users, theme: "internal" %>
|
||||
|
||||
<%= paginate @users, theme: "internal" %>
|
||||
<table class="crayons-table" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Username</th>
|
||||
<th scope="col">ID</th>
|
||||
<th scope="col">Name</th>
|
||||
<th scope="col">Twitter</th>
|
||||
<th scope="col">GitHub</th>
|
||||
<th scope="col">Email</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="crayons-card">
|
||||
<% @users.each do |user| %>
|
||||
<tr>
|
||||
<td><%= link_to user.username, admin_user_path(user) %></td>
|
||||
<td class="whitespace-nowrap"><%= user.id %></td>
|
||||
<td><%= user.name %></td>
|
||||
<td><%= user_twitter_link(user) %></td>
|
||||
<td><%= user_github_link(user) %></td>
|
||||
<td><%= user.email %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= paginate @users, theme: "internal" %>
|
||||
</div>
|
||||
<% else %>
|
||||
<header>
|
||||
<h1 class="crayons-title">People</h1>
|
||||
<%= render "menu" %>
|
||||
</header>
|
||||
|
||||
<%= paginate @users, theme: "internal" %>
|
||||
|
||||
<table class="crayons-table" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Username</th>
|
||||
<th scope="col">ID</th>
|
||||
<th scope="col">Name</th>
|
||||
<th scope="col">Twitter</th>
|
||||
<th scope="col">GitHub</th>
|
||||
<th scope="col">Email</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="crayons-card">
|
||||
<% @users.each do |user| %>
|
||||
<tr>
|
||||
<td><%= link_to user.username, admin_user_path(user) %></td>
|
||||
<td class="whitespace-nowrap"><%= user.id %></td>
|
||||
<td><%= user.name %></td>
|
||||
<td><%= user_twitter_link(user) %></td>
|
||||
<td><%= user_github_link(user) %></td>
|
||||
<td><%= user.email %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= paginate @users, theme: "internal" %>
|
||||
<% end %>
|
||||
|
|
|
|||
13
app/views/admin/users/index/_controls.html.erb
Normal file
13
app/views/admin/users/index/_controls.html.erb
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<% if params[:controller] == "admin/users" %>
|
||||
<%= form_with url: admin_users_path, method: :get, local: true, class: "flex flex-col m:flex-row gap-3 m:items-center p-3" do |f| %>
|
||||
<div class="crayons-field flex-1 flex-row items-center gap-2">
|
||||
<%= f.label :search, class: "crayons-field__label whitespace-nowrap" %>
|
||||
<%= f.text_field :search, value: params[:search], class: "crayons-textfield mt-0", placeholder: "Name, username, email, or Twitter/GitHub usernames", aria: { label: "Filter by name, username, email, or Twitter/GitHub usernames" } %>
|
||||
</div>
|
||||
<div class="crayons-field flex-row items-center gap-2">
|
||||
<%= f.label :role, "Filter by Role", class: "crayons-field__label whitespace-nowrap" %>
|
||||
<%= f.select :role, options_for_select(Role::ROLES, params[:role]), { include_blank: true }, class: "crayons-select mt-0" %>
|
||||
</div>
|
||||
<%= f.submit "Filter", class: "c-btn c-btn--secondary" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
22
app/views/admin/users/index/_tabs.html.erb
Normal file
22
app/views/admin/users/index/_tabs.html.erb
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<nav aria-label="Members" class="mb-2 flex justify-between gap-4">
|
||||
<ul class="crayons-navigation crayons-navigation--horizontal">
|
||||
<li>
|
||||
<%= link_to "Members", admin_users_path, class: "crayons-navigation__item #{'crayons-navigation__item--current' if params[:controller] == 'admin/users'}", "aria-current": ("page" if params[:controller] == "admin/users") %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "Invited Members", admin_invitations_path, class: "crayons-navigation__item #{'crayons-navigation__item--current' if params[:controller] == 'admin/invitations'}", "aria-current": ("page" if params[:controller] == "admin/invitations") %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to admin_users_gdpr_delete_requests_path, class: "crayons-navigation__item #{'crayons-navigation__item--current' if params[:controller] == 'admin/users/gdpr_delete_requests'}", "aria-current": ("page" if params[:controller] == "admin/users/gdpr_delete_requests") do %>
|
||||
GDPR Delete Requests
|
||||
<% if Users::GdprDeleteRequest.any? %>
|
||||
<span class="c-indicator c-indicator--danger"><%= Users::GdprDeleteRequest.count %></span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<% if params[:controller] == "admin/invitations" %>
|
||||
<%= link_to "New", new_admin_invitation_path, class: "c-cta" %>
|
||||
<% end %>
|
||||
</nav>
|
||||
Loading…
Add table
Reference in a new issue