Almost done with User edit view. Still need to update styling and change the access start and end date fields.
This commit is contained in:
parent
26a7821e11
commit
bdc5c406c7
|
@ -1,2 +1,6 @@
|
||||||
module UsersHelper
|
module UsersHelper
|
||||||
end
|
def display_user_role(user)
|
||||||
|
user.roles.first&.name&.capitalize || "None"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
|
@ -7,16 +7,20 @@
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead class="table-light">
|
<thead class="table-light">
|
||||||
<tr>
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
<th>Email</th>
|
<th>Email</th>
|
||||||
<th>Admin</th>
|
<th>Company</th>
|
||||||
|
<th>Permissions</th>
|
||||||
<th>Actions</th>
|
<th>Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% @users.each do |user| %>
|
<% @users.each do |user| %>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td><%= user.first_name %> <%= user.last_name %></td>
|
||||||
<td><%= user.email %></td>
|
<td><%= user.email %></td>
|
||||||
<td><%= user.has_role?(:admin) ? 'Yes' : 'No' %></td> <!-- Assuming you're using Rolify for role management -->
|
<td><%= user.company %></td>
|
||||||
|
<td><%= display_user_role(user) %></td>
|
||||||
<td>
|
<td>
|
||||||
<%= link_to edit_user_path(user), class: 'btn btn-info btn-sm' do %>
|
<%= link_to edit_user_path(user), class: 'btn btn-info btn-sm' do %>
|
||||||
<i class="bi bi-pencil-fill" style="color: white;"></i>
|
<i class="bi bi-pencil-fill" style="color: white;"></i>
|
||||||
|
|
Loading…
Reference in New Issue