philomena/lib/philomena_web/templates/image/_uploader.html.slime

27 lines
1.4 KiB
Text
Raw Normal View History

2024-05-20 21:25:43 +02:00
span.image-uploader
2019-12-17 19:53:41 +01:00
' by
=> render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @image, awards: true, conn: @conn
2019-12-20 23:35:46 +01:00
= if can?(@conn, :show, :ip_address) and not hide_staff_tools?(@conn) do
2019-12-17 19:53:41 +01:00
=> link_to_ip(@conn, @image.ip)
=> link_to_fingerprint(@conn, @image.fingerprint)
2024-05-20 21:25:43 +02:00
a#edit-uploader href="#" data-click-hide=".image-uploader" data-click-show="#uploader-form"
2019-12-17 19:53:41 +01:00
i.fas.fa-edit
a#edit-anonymous href="#" data-click-toggle=".image-anonymous"
i.fas.fa-eye
2019-12-17 19:53:41 +01:00
= if can?(@conn, :show, :ip_address) do
2024-06-06 22:28:35 +02:00
= form_for @changeset, ~p"/images/#{@image}/uploader", [class: "block__content hidden", id: "uploader-form", data: [remote: "true", method: "put"]], fn f ->
2019-12-17 19:53:41 +01:00
=> label f, :username, "Uploader"
=> text_input f, :username, value: username(@image.user), class: "input input--short input--small"
= submit "Save Changes", class: "button button--small", data: [disable_with: raw("Saving…")]
div Changes IP to '127.0.0.1' and FP to 'ffff'. Empty for anonymous.
.image-anonymous.hidden
= if @image.anonymous do
2024-06-06 22:28:35 +02:00
= button_to "Reveal author", ~p"/images/#{@image}/anonymous", class: "button button--small", method: "delete", data: [confirm: "Are you really, really sure?"]
- else
2024-06-06 22:28:35 +02:00
= button_to "Hide author", ~p"/images/#{@image}/anonymous", class: "button button--small", method: "create", data: [confirm: "Are you really, really sure?"]