Updated disabled buttons in admin/users role
This commit is contained in:
@@ -26,11 +26,18 @@
|
|||||||
<td class="p-2 py-3 text-nowrap">
|
<td class="p-2 py-3 text-nowrap">
|
||||||
<span class="inline-flex -space-x-px overflow-hidden rounded-md bg-white shadow divide-x divide-gray-300">
|
<span class="inline-flex -space-x-px overflow-hidden rounded-md bg-white shadow divide-x divide-gray-300">
|
||||||
<% User::AVAILABLE_ROLES.each do |role| %>
|
<% User::AVAILABLE_ROLES.each do |role| %>
|
||||||
<% bg_color = "bg-role-#{role}-light" if user.role == role.to_s %>
|
|
||||||
<% if allowed_to? :change_role?, user %>
|
<% if allowed_to? :change_role?, user %>
|
||||||
<%= button_to role, admin_user_path(user), method: :patch, params: { user: { role: role }}, form_class: "inline", class: "inline-block px-2 py-2 text-sm uppercase font-medium text-gray-700 focus:relative hover:bg-role-#{role}-light #{bg_color} text-#{role}" %>
|
<% if user.role == role.to_s %>
|
||||||
|
<%= button_to role, admin_user_path(user), method: :patch, params: { user: { role: role }}, form_class: "inline", class: "inline-block px-4 py-2 text-sm uppercase font-medium focus:relative bg-role-#{role}-light text-#{role}" %>
|
||||||
|
<% else %>
|
||||||
|
<%= button_to role, admin_user_path(user), method: :patch, params: { user: { role: role }}, form_class: "inline", class: "inline-block px-4 py-2 text-sm uppercase font-medium focus:relative hover:bg-role-#{role}-light text-#{role}" %>
|
||||||
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<span class="inline-block px-2 py-2 text-sm uppercase font-medium text-gray-700 <%= bg_color %> focus:relative"><%= role %></span>
|
<% if user.role == role.to_s %>
|
||||||
|
<span class="inline-block px-4 py-2 text-sm uppercase font-medium text-<%= role %> bg-role-<%= role %>-light focus:relative"><%= role %></span>
|
||||||
|
<% else %>
|
||||||
|
<span class="inline-block px-4 py-2 text-sm uppercase font-medium text-gray-400 focus:relative"><%= role %></span>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user