From 02808f6168de262a0288e37545531557c71dbed8 Mon Sep 17 00:00:00 2001 From: Luna D Date: Wed, 11 Dec 2019 19:01:00 -0500 Subject: [PATCH] i would assume this also belongs here? --- .../comment/_comment_with_image.html.slime | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lib/philomena_web/templates/comment/_comment_with_image.html.slime b/lib/philomena_web/templates/comment/_comment_with_image.html.slime index 2339977e..315ac8fd 100644 --- a/lib/philomena_web/templates/comment/_comment_with_image.html.slime +++ b/lib/philomena_web/templates/comment/_comment_with_image.html.slime @@ -31,3 +31,27 @@ article.block.communication id="comment_#{@comment.id}" .block__content.communication__options .flex.flex--wrap.flex--spaced-out = render PhilomenaWeb.CommentView, "_comment_options.html", comment: @comment, conn: @conn + = if can?(@conn, :hide, @comment) do + .js-staff-action + = cond do + - @comment.hidden_from_users and not @comment.destroyed_content -> + = link(to: Routes.image_comment_hide_path(@conn, :delete, @comment.image_id, @comment), data: [confirm: "Are you sure?"], method: :delete, class: "communication__interaction") do + i.fas.fa-check> + ' Restore + = if can?(@conn, :delete, @comment) do + = link(to: Routes.image_comment_delete_path(@conn, :delete, @comment.image_id, @comment), data: [confirm: "Are you sure?"], method: :delete, class: "communication__interaction") do + i.fas.fa-times> + ' Delete Contents + - not @comment.hidden_from_users and not @comment.destroyed_content -> + a.communication__interaction.togglable-delete-form-link href="#" data-click-toggle="#inline-del-form-comment-#{@comment.id}" + i.fas.fa-times> + ' Delete + - true -> + = if can?(@conn, :show, :ip_address) do + .communication__info + =<> link_to_ip(@conn, @comment.ip) + .communication__info + =<> link_to_fingerprint(@conn, @comment.fingerprint) + = form_for :comment, Routes.image_comment_hide_path(@conn, :create, @comment.image_id, @comment), [class: "togglable-delete-form hidden flex", id: "inline-del-form-comment-#{@comment.id}"], fn f -> + = text_input f, :deletion_reason, class: "input input--wide", placeholder: "Deletion Reason", id: "inline-del-reason-comment-#{@comment.id}", required: true + = submit "Delete", class: "button"