philomena/lib/philomena_web/templates/profile/_admin_block.html.slime

179 lines
5.9 KiB
Text
Raw Permalink Normal View History

2019-12-17 06:44:24 +01:00
.block--fixed
i.fa.fa-fw.fa-calendar>
' Account created
= @user.created_at
br
i.fa.fa-fw.fa-filter>
' Current Filter:
= if @filter do
= link @filter.name, to: ~p"/filters/#{@filter}"
2019-12-17 06:44:24 +01:00
- else
em
' (none)
br
i.far.fa-fw.fa-clock>
' Last seen
= if @last_ip do
=> pretty_time(@last_ip.updated_at)
' from
=> link_to_ip(@conn, @last_ip.ip)
= if @last_fp do
=> link_to_fingerprint(@conn, @last_fp.fingerprint)
- else
em
' (never)
br
2020-08-18 00:05:13 +02:00
i.fas.fa-fw.fa-key>
2019-12-17 06:44:24 +01:00
' Two factor auth:
strong = enabled_text(@user.otp_required_for_login)
br
= if @user.locked_at do
i.fas.fa-fw.fa-lock>
strong.comment_deleted>
' Account locked,
=> @user.failed_attempts
' failed login attempts
- else
i.fas.fa-fw.fa-unlock>
' Not currently locked
2019-12-17 06:44:24 +01:00
br
a.label.label--primary.label--block href="#" data-click-toggle=".js-admin__options__toggle" title="Toggle Controls"
i.fa.fa-fw.fa-bars
span Toggle Controls
.profile-top__options.js-admin__options__toggle.hidden
ul.profile-admin__options__column
li
= link to: ~p"/profiles/#{@user}/details" do
2019-12-17 06:44:24 +01:00
i.fa.fa-fw.fa-eye
span.admin__button View Details
li
= link to: ~p"/search?#{[q: "upvoted_by_id:#{@user.id}"]}" do
2019-12-17 06:44:24 +01:00
i.fa.fa-fw.fa-arrow-up
span.admin__button Upvotes
li
= link to: ~p"/search?#{[q: "downvoted_by_id:#{@user.id}"]}" do
2019-12-17 06:44:24 +01:00
i.fa.fa-fw.fa-arrow-down
span.admin__button Downvotes
li
= link to: ~p"/search?#{[q: "hidden_by_id:#{@user.id}"]}" do
2019-12-17 06:44:24 +01:00
i.fa.fa-fw.fa-eye-slash
span.admin__button Hidden Images
li
= link to: ~p"/admin/reports?#{[rq: "user_id:#{@user.id}"]}" do
2019-12-17 06:44:24 +01:00
i.fa.fa-fw.fa-exclamation
span.admin__button Reports
li
= link to: ~p"/profiles/#{@user}/ip_history" do
2019-12-17 06:44:24 +01:00
i.fab.fa-fw.fa-internet-explorer
span.admin__button IP History
li
= link to: ~p"/profiles/#{@user}/fp_history" do
2019-12-17 06:44:24 +01:00
i.fa.fa-fw.fa-desktop
span.admin__button FP History
li
= link to: ~p"/profiles/#{@user}/aliases" do
2019-12-17 06:44:24 +01:00
i.fa.fa-fw.fa-users
span.admin__button Potential Aliases
= if can?(@conn, :index, %Philomena.Donations.Donation{}) do
li
= link to: ~p"/admin/donations/user/#{@user}" do
i.fas.fa-fw.fa-dollar-sign
span.admin__button Donations
2019-12-17 06:44:24 +01:00
ul.profile-admin__options__column
2019-12-20 01:00:09 +01:00
= if can?(@conn, :edit, @user) do
li
= link to: ~p"/admin/users/#{@user}/edit" do
2019-12-20 01:00:09 +01:00
i.fas.fa-fw.fa-edit
span.admin__button Edit User
2020-06-07 03:03:17 +02:00
li
= link to: ~p"/admin/users/#{@user}/force_filter/new" do
2020-06-07 03:03:17 +02:00
i.fas.faw-fw.fa-filter
span.admin__button Force Filter
= if @forced do
li
= link to: ~p"/admin/users/#{@user}/force_filter", data: [confirm: "Are you really, really sure?", method: "delete"] do
i.fas.fa-fw.fa-filter
2020-06-07 03:03:17 +02:00
span.admin__button Remove Force Filter
2019-12-20 01:00:09 +01:00
= if @user.deleted_at do
li
= link to: ~p"/admin/users/#{@user}/activation", data: [confirm: "Are you really, really sure?", method: "post"] do
2019-12-20 01:00:09 +01:00
i.fa.fa-fw.fa-check
span.admin__button Reactivate Account
- else
li
= link to: ~p"/admin/users/#{@user}/activation", data: [confirm: "Are you really, really sure?", method: "delete"] do
2019-12-20 01:00:09 +01:00
i.fa.fa-fw.fa-times
span.admin__button Deactivate Account
= if @user.locked_at do
li
= link to: ~p"/admin/users/#{@user}/unlock", data: [method: "post"] do
i.fas.fa-fw.fa-unlock
span.admin__button Unlock Account
li
= link to: ~p"/admin/users/#{@user}/wipe", data: [confirm: "This is irreversible, destroying all identifying information including email. Are you sure?", method: "post"] do
2019-12-20 01:00:09 +01:00
i.fas.fa-fw.fa-eraser
span.admin__button Wipe PII
= if can?(@conn, :edit, %Philomena.ArtistLinks.ArtistLink{}) do
li
= link to: ~p"/profiles/#{@user}/artist_links/new" do
2019-12-20 01:00:09 +01:00
i.fa.fa-fw.fa-link
span.admin__button Add Artist Link
2019-12-20 01:00:09 +01:00
= if can?(@conn, :create, Philomena.Bans.User) do
li
= link to: ~p"/admin/user_bans/new?#{[username: @user.name]}" do
2019-12-20 01:00:09 +01:00
i.fa.fa-fw.fa-ban
span.admin__button Ban this sucker
2022-03-21 19:08:06 +01:00
ul.profile-admin__options__column
2019-12-20 01:00:09 +01:00
= if can?(@conn, :index, Philomena.Users.User) do
2019-12-17 06:44:24 +01:00
li
= link to: ~p"/admin/users/#{@user}/api_key", data: [confirm: "Are you really, really sure?", method: "delete"] do
2019-12-20 01:00:09 +01:00
i.fas.fa-fw.fa-key
span.admin__button Reset API key
2022-03-21 19:08:06 +01:00
li
= if @user.verified do
= link to: ~p"/admin/users/#{@user}/verification", data: [confirm: "Are you really, really sure?", method: "delete"] do
2022-03-21 19:08:06 +01:00
i.fas.fa-fw.fa-user-times
span.admin__button Revoke Verification
- else
= link to: ~p"/admin/users/#{@user}/verification", data: [confirm: "Are you really, really sure?", method: "create"] do
2022-03-21 19:08:06 +01:00
i.fas.fa-fw.fa-user-check
span.admin__button Grant Verification
ul.profile-admin__options__column
= if can?(@conn, :index, Philomena.Users.User) do
li
= link to: ~p"/admin/users/#{@user}/votes", data: [confirm: "Are you really, really sure?", method: "delete"] do
i.far.fa-fw.fa-file-excel
span.admin__button Remove All Votes/Faves
li
= link to: ~p"/admin/users/#{@user}/downvotes", data: [confirm: "Are you really, really sure?", method: "delete"] do
i.fa.fa-fw.fa-arrow-down
span.admin__button Remove All Downvotes
2022-05-11 22:41:53 +02:00
= if @user.role == "user" and can?(@conn, :revert, Philomena.TagChanges.TagChange) do
li
= link to: ~p"/tag_changes/full_revert?#{[user_id: @user.id]}", data: [confirm: "Are you really, really sure?", method: "create"] do
i.fa.fa-fw.fa-tag
span.admin__button Revert All Tag Changes