2019-10-04 20:51:56 -04:00
|
|
|
article.block.communication id="comment_#{@comment.id}"
|
2019-12-11 18:58:00 -05:00
|
|
|
.block__content.flex.flex--no-wrap class=communication_body_class(@comment)
|
2019-10-04 20:51:56 -04:00
|
|
|
.flex__fixed.spacing-right
|
2019-11-11 20:27:09 -05:00
|
|
|
= render PhilomenaWeb.UserAttributionView, "_anon_user_avatar.html", object: @comment, conn: @conn
|
2019-10-04 20:51:56 -04:00
|
|
|
.flex__grow.communication__body
|
2019-11-11 21:53:19 -05:00
|
|
|
span.communication__body__sender-name = render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @comment, awards: true, conn: @conn
|
2019-11-27 21:31:53 -05:00
|
|
|
br
|
|
|
|
= render PhilomenaWeb.UserAttributionView, "_anon_user_title.html", object: @comment, conn: @conn
|
2019-10-04 20:51:56 -04:00
|
|
|
.communication__body__text
|
2019-11-17 15:37:01 -05:00
|
|
|
= if @comment.hidden_from_users do
|
|
|
|
strong.comment_deleted
|
|
|
|
' Deletion reason:
|
2019-12-10 15:29:48 -05:00
|
|
|
=<> @comment.deletion_reason
|
2019-12-17 01:58:27 -05:00
|
|
|
= if can?(@conn, :hide, @comment) and not is_nil(@comment.deleted_by) do
|
2019-12-10 15:29:48 -05:00
|
|
|
| (
|
|
|
|
= @comment.deleted_by.name
|
|
|
|
| )
|
2019-12-11 23:41:33 -05:00
|
|
|
|
2019-12-11 18:58:00 -05:00
|
|
|
= if can?(@conn, :hide, @comment) do
|
2019-12-11 17:21:14 -05:00
|
|
|
= if @comment.destroyed_content do
|
|
|
|
br
|
|
|
|
strong.comment_deleted>
|
|
|
|
| This comment's contents have been destroyed.
|
|
|
|
- else
|
|
|
|
br
|
|
|
|
==<> @body
|
2019-12-11 23:41:33 -05:00
|
|
|
|
2019-11-17 15:37:01 -05:00
|
|
|
- else
|
2019-11-10 18:35:52 -05:00
|
|
|
==<> @body
|
2019-12-11 23:41:33 -05:00
|
|
|
|
2019-10-04 20:51:56 -04:00
|
|
|
.block__content.communication__options
|
|
|
|
.flex.flex--wrap.flex--spaced-out
|
2019-11-11 20:27:09 -05:00
|
|
|
= render PhilomenaWeb.CommentView, "_comment_options.html", comment: @comment, conn: @conn
|
2019-12-11 23:41:33 -05:00
|
|
|
|
2019-12-05 14:48:06 -05:00
|
|
|
= if can?(@conn, :hide, @comment) do
|
|
|
|
.js-staff-action
|
2019-12-10 15:42:52 -05:00
|
|
|
= cond do
|
|
|
|
- @comment.hidden_from_users and not @comment.destroyed_content ->
|
2019-12-11 23:41:33 -05:00
|
|
|
= link(to: Routes.image_comment_hide_path(@conn, :delete, @comment.image_id, @comment), data: [confirm: "Are you sure?"], method: "delete", class: "communication__interaction") do
|
2019-12-10 15:42:52 -05:00
|
|
|
i.fas.fa-check>
|
|
|
|
' Restore
|
2019-12-11 23:41:33 -05:00
|
|
|
|
2019-12-10 15:42:52 -05:00
|
|
|
= if can?(@conn, :delete, @comment) do
|
2019-12-11 23:41:33 -05:00
|
|
|
= link(to: Routes.image_comment_delete_path(@conn, :create, @comment.image_id, @comment), data: [confirm: "Are you sure?"], method: "post", class: "communication__interaction") do
|
2019-12-10 15:42:52 -05:00
|
|
|
i.fas.fa-times>
|
|
|
|
' Delete Contents
|
2019-12-11 23:41:33 -05:00
|
|
|
|
2019-12-10 15:44:10 -05:00
|
|
|
- not @comment.hidden_from_users and not @comment.destroyed_content ->
|
2019-12-10 15:42:52 -05:00
|
|
|
a.communication__interaction.togglable-delete-form-link href="#" data-click-toggle="#inline-del-form-comment-#{@comment.id}"
|
|
|
|
i.fas.fa-times>
|
|
|
|
' Delete
|
2019-12-11 23:41:33 -05:00
|
|
|
|
2019-12-10 15:29:48 -05:00
|
|
|
- true ->
|
2019-12-11 23:41:33 -05:00
|
|
|
|
2019-12-10 15:31:39 -05:00
|
|
|
= if can?(@conn, :show, :ip_address) do
|
2019-12-20 17:35:46 -05:00
|
|
|
.communication__info.js-staff-action
|
2019-12-07 20:49:28 -05:00
|
|
|
=<> link_to_ip(@conn, @comment.ip)
|
2019-12-20 17:35:46 -05:00
|
|
|
.communication__info.js-staff-action
|
2019-12-07 20:49:28 -05:00
|
|
|
=<> link_to_fingerprint(@conn, @comment.fingerprint)
|
2019-12-11 23:41:33 -05:00
|
|
|
|
2019-12-10 15:29:48 -05:00
|
|
|
= 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"
|