diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-07-17 22:07:20 +0200 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2022-07-17 22:07:20 +0200 |
commit | cd87d7dcef814ad86fb15334680cb0e3232437a9 (patch) | |
tree | 63db8838568ea440bb3cb9797cdbaf5c4952e9e7 /app/views/admin | |
parent | 9094c2f52c24e1c00b594e7c11cd00e4a07eb431 (diff) | |
parent | c3f0621a59a74d0e20e6db6170894871c48e8f0f (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')
-rw-r--r-- | app/views/admin/roles/_form.html.haml | 23 | ||||
-rw-r--r-- | app/views/admin/roles/_role.html.haml | 28 | ||||
-rw-r--r-- | app/views/admin/tags/show.html.haml | 4 | ||||
-rw-r--r-- | app/views/admin/trends/tags/_tag.html.haml | 2 |
4 files changed, 36 insertions, 21 deletions
diff --git a/app/views/admin/roles/_form.html.haml b/app/views/admin/roles/_form.html.haml index 68607ce68..9beaf619f 100644 --- a/app/views/admin/roles/_form.html.haml +++ b/app/views/admin/roles/_form.html.haml @@ -8,8 +8,9 @@ .fields-group = f.input :name, wrapper: :with_label - .fields-group - = f.input :position, wrapper: :with_label + - unless current_user.role.id == @role.id + .fields-group + = f.input :position, wrapper: :with_label, input_html: { max: current_user.role.position - 1 } .fields-group = f.input :color, wrapper: :with_label, input_html: { placeholder: '#000000' } @@ -21,17 +22,19 @@ %hr.spacer/ - .field-group - .input.with_block_label - %label= t('simple_form.labels.user_role.permissions_as_keys') - %span.hint= t('simple_form.hints.user_role.permissions_as_keys') + - unless current_user.role.id == @role.id + + .field-group + .input.with_block_label + %label= t('simple_form.labels.user_role.permissions_as_keys') + %span.hint= t('simple_form.hints.user_role.permissions_as_keys') - - (@role.everyone? ? UserRole::Flags::CATEGORIES.slice(:invites) : UserRole::Flags::CATEGORIES).each do |category, permissions| - %h4= t(category, scope: 'admin.roles.categories') + - (@role.everyone? ? UserRole::Flags::CATEGORIES.slice(:invites) : UserRole::Flags::CATEGORIES).each do |category, permissions| + %h4= t(category, scope: 'admin.roles.categories') - = f.input :permissions_as_keys, collection: permissions, wrapper: :with_block_label, include_blank: false, label_method: lambda { |privilege| safe_join([t("admin.roles.privileges.#{privilege}"), content_tag(:span, t("admin.roles.privileges.#{privilege}_description"), class: 'hint')]) }, required: false, as: :check_boxes, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li', label: false, hint: false + = f.input :permissions_as_keys, collection: permissions, wrapper: :with_block_label, include_blank: false, label_method: lambda { |privilege| safe_join([t("admin.roles.privileges.#{privilege}"), content_tag(:span, t("admin.roles.privileges.#{privilege}_description"), class: 'hint')]) }, required: false, as: :check_boxes, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li', label: false, hint: false, disabled: permissions.filter { |privilege| UserRole::FLAGS[privilege] & current_user.role.computed_permissions == 0 } - %hr.spacer/ + %hr.spacer/ .actions = f.button :button, @role.new_record? ? t('admin.roles.add_new') : t('generic.save_changes'), type: :submit 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) diff --git a/app/views/admin/tags/show.html.haml b/app/views/admin/tags/show.html.haml index 89e8f2b9a..71bce0c0c 100644 --- a/app/views/admin/tags/show.html.haml +++ b/app/views/admin/tags/show.html.haml @@ -1,5 +1,5 @@ - content_for :page_title do - = "##{@tag.name}" + = "##{@tag.display_name}" - if current_user.can?(:view_dashboard) - content_for :heading_actions do @@ -50,7 +50,7 @@ = render 'shared/error_messages', object: @tag .fields-group - = f.input :name, wrapper: :with_block_label + = f.input :display_name, wrapper: :with_block_label .fields-group = f.input :usable, as: :boolean, wrapper: :with_label diff --git a/app/views/admin/trends/tags/_tag.html.haml b/app/views/admin/trends/tags/_tag.html.haml index 7bb99b158..a30666a08 100644 --- a/app/views/admin/trends/tags/_tag.html.haml +++ b/app/views/admin/trends/tags/_tag.html.haml @@ -6,7 +6,7 @@ .pending-account__header = link_to admin_tag_path(tag.id) do = fa_icon 'hashtag' - = tag.name + = tag.display_name %br/ |