philomena/lib/philomena_web/templates/image/_uploader.html.heex
2024-06-01 23:50:36 -04:00

31 lines
1.6 KiB
Text

<span class="image_uploader">
by
<%= render(PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @image, awards: true, conn: @conn) %>
<%= if can?(@conn, :show, :ip_address) and not hide_staff_tools?(@conn) do %>
<%= link_to_ip(@conn, @image.ip) %>
<%= link_to_fingerprint(@conn, @image.fingerprint) %>
<a data-click-hide=".image_uploader" data-click-show="#uploader-form" href="#" id="edit-uploader">
<i class="fas fa-edit"></i>
</a>
<a data-click-toggle=".image-anonymous" href="#" id="edit-anonymous">
<i class="fas fa-eye"></i>
</a>
<% end %>
</span>
<%= if can?(@conn, :show, :ip_address) do %>
<%= form_for @changeset, ~p"/images/#{@image}/uploader", [class: "block__content hidden", id: "uploader-form", data: [remote: "true", method: "put"]], fn f -> %>
<%= 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&hellip;")]) %>
<div>
Changes IP to '127.0.0.1' and FP to 'ffff'. Empty for anonymous.
</div>
<% end %>
<div class="image-anonymous hidden">
<%= if @image.anonymous do %>
<%= button_to("Reveal author", ~p"/images/#{@image}/anonymous", class: "button button--small", method: "delete", data: [confirm: "Are you really, really sure?"]) %>
<% else %>
<%= button_to("Hide author", ~p"/images/#{@image}/anonymous", class: "button button--small", method: "create", data: [confirm: "Are you really, really sure?"]) %>
<% end %>
</div>
<% end %>