mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-26 10:45:04 -04:00
* Paginate, 100 at a time * Limited i18n * Paginate roles * Pagination * Pagination * i18n and pagination * Paginate alternate names * Silence code climate * Rewrite coverage as a feature * Remove coverage in favour of crops/scientific_name_spec * Add missing admin link * Rewrite coverage as feature * Rewrite coverage --------- Co-authored-by: Brenda Wallace <brenda@wallace.net.nz>
33 lines
920 B
Plaintext
33 lines
920 B
Plaintext
- content_for :title, "Listing roles"
|
|
|
|
- content_for :breadcrumbs do
|
|
%li.breadcrumb-item= link_to 'Admin', admin_path
|
|
%li.breadcrumb-item.active= link_to 'Roles', admin_roles_path
|
|
|
|
- if can? :create, Role
|
|
%p= link_to 'New role', new_admin_role_path, class: 'btn btn-primary'
|
|
|
|
%table.table.table-striped
|
|
%thead
|
|
%tr
|
|
%th Name
|
|
%th Description
|
|
%th
|
|
%th
|
|
|
|
- @roles.each do |role|
|
|
%tr
|
|
%td= role.name
|
|
%td= role.description
|
|
%td
|
|
- if can? :edit, role
|
|
= link_to edit_admin_role_path(role), class: 'btn btn-default btn-xs' do
|
|
= edit_icon
|
|
= t('.edit')
|
|
- if can?(:destroy, role) && ! role.members.any?
|
|
= link_to admin_role_path(role), method: :delete, data: { confirm: t(:are_you_sure?) }, class: 'btn btn-default btn-xs text-danger' do
|
|
= delete_icon
|
|
= t('.delete')
|
|
|
|
= will_paginate(@roles)
|