philomena/lib/philomena_web/templates/admin/dnp_entry/index.html.slime

91 lines
4 KiB
Text
Raw Normal View History

2019-12-12 22:44:50 +01:00
h2 Do-Not-Post Requests
2024-06-06 22:28:35 +02:00
= form_for :dnp_entry, ~p"/admin/dnp_entries", [method: "get", class: "hform"], fn f ->
2019-12-12 22:44:50 +01:00
.field
= text_input f, :q, name: :q, value: @conn.params["q"], class: "input hform__text", placeholder: "Search query", autocapitalize: "none"
= submit "Search", class: "hform__button button"
2024-06-06 22:28:35 +02:00
- route = fn p -> ~p"/admin/dnp_entries?#{p}" end
2019-12-12 22:44:50 +01:00
- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @dnp_entries, route: route, params: [states: state_param(@conn.params["states"])]
.block
.block__header
= pagination
2023-11-23 17:07:49 +01:00
span Display Only:
2024-06-06 22:28:35 +02:00
=> link "All Open", to: ~p"/admin/dnp_entries?#{[states: ~W(requested claimed rescinded acknowledged)]}"
=> link "Listed", to: ~p"/admin/dnp_entries?#{[states: ~W(listed)]}"
=> link "Rescinded", to: ~p"/admin/dnp_entries?#{[states: ~W(rescinded acknowledged)]}"
=> link "Closed", to: ~p"/admin/dnp_entries?#{[states: ~W(closed)]}"
2019-12-12 22:44:50 +01:00
.block__content
table.table
thead
tr
td Tag
td Requesting User
td Type
td Conditions
td Status
td Created
td Modified
td Options
tbody
= for {body, request} <- @dnp_entries do
tr
td
= render PhilomenaWeb.TagView, "_tag.html", tag: request.tag, conn: @conn
td
2024-06-06 22:28:35 +02:00
= link request.requesting_user.name, to: ~p"/profiles/#{request.requesting_user}"
2019-12-12 22:44:50 +01:00
td
= request.dnp_type
td
= body
2019-12-12 22:44:50 +01:00
td class=dnp_entry_row_class(request)
=> pretty_state(request)
= if request.modifying_user do
' by
2024-06-06 22:28:35 +02:00
= link request.modifying_user.name, to: ~p"/profiles/#{request.modifying_user}"
2019-12-12 22:44:50 +01:00
td
= pretty_time(request.created_at)
td
= pretty_time(request.updated_at)
td
2024-06-06 22:28:35 +02:00
=> link "Show", to: ~p"/dnp/#{request}"
2019-12-12 22:44:50 +01:00
' &bull;
2024-06-06 22:28:35 +02:00
=> link "Send PM", to: ~p"/conversations/new?#{[recipient: request.requesting_user.name]}"
2019-12-12 22:44:50 +01:00
= case request.aasm_state do
- s when s in ["requested", "claimed"] ->
' &bull;
2024-06-06 22:28:35 +02:00
=> link "Claim", to: ~p"/admin/dnp_entries/#{request}/transition?#{[state: "claimed"]}", data: [method: "post", confirm: "Are you really, really sure?"]
2019-12-12 22:44:50 +01:00
' &bull;
2024-06-06 22:28:35 +02:00
=> link "Approve", to: ~p"/admin/dnp_entries/#{request}/transition?#{[state: "listed"]}", data: [method: "post", confirm: "Are you really, really sure?"]
2019-12-12 22:44:50 +01:00
' &bull;
2024-06-06 22:28:35 +02:00
=> link "Close", to: ~p"/admin/dnp_entries/#{request}/transition?#{[state: "closed"]}", data: [method: "post", confirm: "Are you really, really sure?"]
2019-12-12 22:44:50 +01:00
- "listed" ->
' &bull;
2024-06-06 22:28:35 +02:00
=> link "Rescind", to: ~p"/admin/dnp_entries/#{request}/transition?#{[state: "rescinded"]}", data: [method: "post", confirm: "Are you really, really sure?"]
2019-12-12 22:44:50 +01:00
' &bull;
2024-06-06 22:28:35 +02:00
= link "Close", to: ~p"/admin/dnp_entries/#{request}/transition?#{[state: "closed"]}", data: [method: "post", confirm: "Are you really, really sure?"]
2019-12-12 22:44:50 +01:00
- s when s in ["rescinded", "acknowledged"] ->
' &bull;
2024-06-06 22:28:35 +02:00
=> link "Claim", to: ~p"/admin/dnp_entries/#{request}/transition?#{[state: "acknowledged"]}", data: [method: "post", confirm: "Are you really, really sure?"]
2019-12-12 22:44:50 +01:00
' &bull;
2024-06-06 22:28:35 +02:00
= link "Close", to: ~p"/admin/dnp_entries/#{request}/transition?#{[state: "closed"]}", data: [method: "post", confirm: "Are you really, really sure?"]
2019-12-12 22:44:50 +01:00
- _state ->
' &bull;
2024-06-06 22:28:35 +02:00
=> link "Claim", to: ~p"/admin/dnp_entries/#{request}/transition?#{[state: "claimed"]}", data: [method: "post", confirm: "Are you really, really sure?"]