_role.html.haml 1.2 KB

123456789101112131415161718192021222324252627282930
  1. .announcements-list__item
  2. - if can?(:update, role)
  3. = link_to edit_admin_role_path(role), class: 'announcements-list__item__title' do
  4. %span.user-role{ class: "user-role-#{role.id}" }
  5. = fa_icon 'users fw'
  6. - if role.everyone?
  7. = t('admin.roles.everyone')
  8. - else
  9. = role.name
  10. - else
  11. %span.announcements-list__item__title
  12. %span.user-role{ class: "user-role-#{role.id}" }
  13. = fa_icon 'users fw'
  14. - if role.everyone?
  15. = t('admin.roles.everyone')
  16. - else
  17. = role.name
  18. .announcements-list__item__action-bar
  19. .announcements-list__item__meta
  20. - if role.everyone?
  21. = t('admin.roles.everyone_full_description_html')
  22. - else
  23. = link_to t('admin.roles.assigned_users', count: role.users.count), admin_accounts_path(role_ids: role.id)
  24. ·
  25. %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)
  26. %div
  27. = table_link_to 'pencil', t('admin.accounts.edit'), edit_admin_role_path(role) if can?(:update, role)