about summary refs log tree commit diff
path: root/app/views/admin/roles/_role.html.haml
blob: 798d8d8b4fcde2183c1ea62e5cef181b265b48e1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
.announcements-list__item
  - if can?(:update, role)
    = link_to edit_admin_role_path(role), class: 'announcements-list__item__title' do
      %span.user-role{ class: "user-role-#{role.id}" }
        = fa_icon 'users fw'

        - if role.everyone?
          = t('admin.roles.everyone')
        - else
          = role.name
  - else
    %span.announcements-list__item__title
      %span.user-role{ class: "user-role-#{role.id}" }
        = fa_icon 'users fw'

        - if role.everyone?
          = t('admin.roles.everyone')
        - else
          = role.name

  .announcements-list__item__action-bar
    .announcements-list__item__meta
      - if role.everyone?
        = t('admin.roles.everyone_full_description_html')
      - else
        = link_to t('admin.roles.assigned_users', count: role.users.count), admin_accounts_path(role_ids: role.id)
        •
        %abbr{ title: role.permissions_as_keys.map { |privilege| I18n.t("admin.roles.privileges.#{privilege}") }.join(', ') }= t('admin.roles.permissions_count', count: role.permissions_as_keys.size)
    %div
      = table_link_to 'pencil', t('admin.accounts.edit'), edit_admin_role_path(role) if can?(:update, role)