From 93e69792020976152417a9c6d38da84926824f7e Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Sat, 5 Sep 2020 23:26:44 -0400 Subject: [PATCH] add controls to show pages for dnp and user link (derpibooru/philomena#181) --- .../templates/dnp_entry/show.html.slime | 22 +++++++++++++++++++ .../profile/user_link/show.html.slime | 14 ++++++++++++ 2 files changed, 36 insertions(+) diff --git a/lib/philomena_web/templates/dnp_entry/show.html.slime b/lib/philomena_web/templates/dnp_entry/show.html.slime index b59d06e1..572fa09e 100644 --- a/lib/philomena_web/templates/dnp_entry/show.html.slime +++ b/lib/philomena_web/templates/dnp_entry/show.html.slime @@ -50,6 +50,28 @@ h2 td = String.capitalize(@dnp_entry.aasm_state) += if can?(@conn, :index, Philomena.DnpEntries.DnpEntry) do + = case @dnp_entry.aasm_state do + - s when s in ["requested", "claimed"] -> + => link "Claim", to: Routes.admin_dnp_entry_transition_path(@conn, :create, @dnp_entry, state: "claimed"), data: [method: "post", confirm: "Are you really, really sure?"] + ' • + => link "Approve", to: Routes.admin_dnp_entry_transition_path(@conn, :create, @dnp_entry, state: "listed"), data: [method: "post", confirm: "Are you really, really sure?"] + ' • + => link "Close", to: Routes.admin_dnp_entry_transition_path(@conn, :create, @dnp_entry, state: "closed"), data: [method: "post", confirm: "Are you really, really sure?"] + + - "listed" -> + => link "Rescind", to: Routes.admin_dnp_entry_transition_path(@conn, :create, @dnp_entry, state: "rescinded"), data: [method: "post", confirm: "Are you really, really sure?"] + ' • + = link "Close", to: Routes.admin_dnp_entry_transition_path(@conn, :create, @dnp_entry, state: "closed"), data: [method: "post", confirm: "Are you really, really sure?"] + + - s when s in ["rescinded", "acknowledged"] -> + => link "Claim", to: Routes.admin_dnp_entry_transition_path(@conn, :create, @dnp_entry, state: "acknowledged"), data: [method: "post", confirm: "Are you really, really sure?"] + ' • + = link "Close", to: Routes.admin_dnp_entry_transition_path(@conn, :create, @dnp_entry, state: "closed"), data: [method: "post", confirm: "Are you really, really sure?"] + + - _state -> + => link "Claim", to: Routes.admin_dnp_entry_transition_path(@conn, :create, @dnp_entry, state: "claimed"), data: [method: "post", confirm: "Are you really, really sure?"] + = if assigns[:mod_notes] do h4 Mod Notes = render PhilomenaWeb.Admin.ModNoteView, "_table.html", mod_notes: @mod_notes, conn: @conn diff --git a/lib/philomena_web/templates/profile/user_link/show.html.slime b/lib/philomena_web/templates/profile/user_link/show.html.slime index 621dd685..c5cdcaf7 100644 --- a/lib/philomena_web/templates/profile/user_link/show.html.slime +++ b/lib/philomena_web/templates/profile/user_link/show.html.slime @@ -56,4 +56,18 @@ h3 Associated tag - else p There is no tag associated with this link. += if can?(@conn, :index, Philomena.UserLinks.UserLink) do + p + => link "Edit", to: Routes.profile_user_link_path(@conn, :edit, @user, @user_link) + ' • + => link "Verify", to: Routes.admin_user_link_verification_path(@conn, :create, @user_link), method: :post + ' • + => link "Reject", to: Routes.admin_user_link_reject_path(@conn, :create, @user_link), method: :post + = if not verified?(@user_link) do + ' • + = if contacted?(@user_link) do + ' Artist contacted + - else + = link "Artist contacted", to: Routes.admin_user_link_contact_path(@conn, :create, @user_link), method: :post + = link "Back", to: Routes.profile_user_link_path(@conn, :index, @user)