about summary refs log tree commit diff
path: root/app/views/admin/roles/_role.html.haml
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-07-17 22:07:20 +0200
committerClaire <claire.github-309c@sitedethib.com>2022-07-17 22:07:20 +0200
commitcd87d7dcef814ad86fb15334680cb0e3232437a9 (patch)
tree63db8838568ea440bb3cb9797cdbaf5c4952e9e7 /app/views/admin/roles/_role.html.haml
parent9094c2f52c24e1c00b594e7c11cd00e4a07eb431 (diff)
parentc3f0621a59a74d0e20e6db6170894871c48e8f0f (diff)
Merge branch 'main' into glitch-soc/merge-upstream
- `.env.production.sample`:
  Our sample config file is very different from upstream since it is much more
  complete. Upstream added documentation for a few env variables.
  Copied the new variables/documentation from upstream.
- `app/lib/feed_manager.rb`:
  Upstream added a timeline type (hashtags), while glitch-soc already had an
  extra one (direct messages). Not really a conflict but textually close
  changes.
  Ported upstream's changes.
- `app/models/custom_emoji.rb`:
  Upstream upped the custom emoji size limit, while glitch-soc had configurable
  limits.
  Upped the default limits accordingly.
- `streaming/index.js`:
  Upstream reworked how hastags were normalized. Minor conflict due to
  glitch-soc's handling of instance-local posts.
  Ported upstream's changes.
Diffstat (limited to 'app/views/admin/roles/_role.html.haml')
-rw-r--r--app/views/admin/roles/_role.html.haml28
1 files changed, 20 insertions, 8 deletions
diff --git a/app/views/admin/roles/_role.html.haml b/app/views/admin/roles/_role.html.haml
index 6804f4f15..798d8d8b4 100644
--- a/app/views/admin/roles/_role.html.haml
+++ b/app/views/admin/roles/_role.html.haml
@@ -1,18 +1,30 @@
 .announcements-list__item
-  = 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 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
+        - 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_id: role.id)
+        = 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)