Minor cleanup related to staff perms (#48)

This commit is contained in:
parasprite 2020-10-22 21:44:07 -07:00 committed by GitHub
parent a7b1ecf204
commit 13ce241396
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 68 additions and 63 deletions

View file

@ -70,10 +70,11 @@ h1 Users
= pretty_time user.created_at
td
= if can?(@conn, :edit, Philomena.Users.User) do
= if can?(@conn, :edit, user) do
=> link to: Routes.admin_user_path(@conn, :edit, user) do
i.fa.fa-fw.fa-user-edit
' Edit
' •
/= if user.deleted_at do
/ => link_to 'Reactivate', admin_user_activation_path(user), data: { confirm: t('are_you_sure') }, method: :create

View file

@ -1,4 +1,5 @@
.flex.flex--centered.header--secondary__admin-links.stretched-mobile-links.js-staff-action
= if manages_users?(@conn) do
.dropdown.hide-mobile
a.header__link title="Admin"
' A
@ -64,13 +65,14 @@
span.header__counter__admin
= @dnp_entry_count
= if manages_bans?(@conn) do
.dropdown.hide-mobile
a.header__link title="Bans"
' B
i.fa.fa-caret-down
.dropdown__content.dropdown__content-right.js-burger-links
= if manages_bans?(@conn) do
= link to: Routes.admin_user_ban_path(@conn, :index), class: "header__link" do
i.fa.fa-fw.fa-user>
' User Bans

View file

@ -1,7 +1,8 @@
h1 Editing Tag
p = link "Edit image", to: Routes.tag_image_path(@conn, :edit, @tag)
p = link "Edit aliases", to: Routes.tag_alias_path(@conn, :edit, @tag)
= if can?(@conn, :alias, @tag) do
p = link "Edit aliases", to: Routes.tag_alias_path(@conn, :edit, @tag)
= form_for @changeset, Routes.tag_path(@conn, :update, @tag), [class: "form"], fn f ->
= if @changeset.action do
@ -38,9 +39,10 @@ p = link "Edit aliases", to: Routes.tag_alias_path(@conn, :edit, @tag)
br
br
input.toggle-box#tag-management checked="false" type="checkbox"
label for="tag-management" Tag Processing
.toggle-box-container
= if can?(@conn, :alias, @tag) do
input.toggle-box#tag-management checked="false" type="checkbox"
label for="tag-management" Tag Processing
.toggle-box-container
.toggle-box-container__content
= button_to "Rebuild index", Routes.tag_reindex_path(@conn, :create, @tag), method: "post", class: "button", data: [confirm: "Are you really, really sure?", disable_with: raw("Reindexing…")]
p Use this if the tag displays the wrong number of images or returns the wrong search results.