2019-10-05 02:51:56 +02:00
|
|
|
article.block.communication id="comment_#{@comment.id}"
|
|
|
|
.block__content.flex.flex--no-wrap
|
|
|
|
.flex__fixed.spacing-right
|
2019-11-12 02:27:09 +01:00
|
|
|
= render PhilomenaWeb.UserAttributionView, "_anon_user_avatar.html", object: @comment, conn: @conn
|
2019-10-05 02:51:56 +02:00
|
|
|
.flex__grow.communication__body
|
2019-11-12 03:53:19 +01:00
|
|
|
span.communication__body__sender-name = render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @comment, awards: true, conn: @conn
|
2019-11-28 03:31:53 +01:00
|
|
|
br
|
|
|
|
= render PhilomenaWeb.UserAttributionView, "_anon_user_title.html", object: @comment, conn: @conn
|
2019-10-05 02:51:56 +02:00
|
|
|
.communication__body__text
|
2019-11-17 21:37:01 +01:00
|
|
|
= if @comment.hidden_from_users do
|
|
|
|
strong.comment_deleted
|
|
|
|
' Deletion reason:
|
2019-12-10 21:29:48 +01:00
|
|
|
=<> @comment.deletion_reason
|
|
|
|
= if can?(@conn, :delete, @comment) do
|
|
|
|
| (
|
|
|
|
= @comment.deleted_by.name
|
|
|
|
| )
|
|
|
|
= if can?(@conn, :delete, @comment) do
|
|
|
|
br
|
|
|
|
==<> @body
|
2019-11-17 21:37:01 +01:00
|
|
|
- else
|
2019-11-11 00:35:52 +01:00
|
|
|
==<> @body
|
2019-10-05 02:51:56 +02:00
|
|
|
.block__content.communication__options
|
|
|
|
.flex.flex--wrap.flex--spaced-out
|
2019-11-12 02:27:09 +01:00
|
|
|
= render PhilomenaWeb.CommentView, "_comment_options.html", comment: @comment, conn: @conn
|
2019-12-05 20:48:06 +01:00
|
|
|
= if can?(@conn, :hide, @comment) do
|
|
|
|
.js-staff-action
|
|
|
|
/ todo: make delete button work
|
2019-12-10 21:29:48 +01:00
|
|
|
= case @comment.destroyed_content do
|
|
|
|
- true ->
|
|
|
|
- _false ->
|
|
|
|
= case @comment.hidden_from_users do
|
|
|
|
- true ->
|
|
|
|
= 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), method: :delete, data: [confirm: "Are you sure?"], class: "communication__interaction") do
|
|
|
|
i.fas.fa-times>
|
|
|
|
' Delete Contents
|
|
|
|
- _false ->
|
|
|
|
a.communication__interaction.togglable-delete-form-link href="#" data-click-toggle="#inline-del-form-comment-#{@comment.id}"
|
|
|
|
i.fas.fa-times>
|
|
|
|
' Delete
|
2019-12-05 20:48:06 +01:00
|
|
|
= if can?(@conn, :manage, @comment) do
|
|
|
|
.communication__info
|
2019-12-08 02:49:28 +01:00
|
|
|
=<> link_to_ip(@conn, @comment.ip)
|
2019-12-05 20:48:06 +01:00
|
|
|
.communication__info
|
2019-12-08 02:49:28 +01:00
|
|
|
=<> link_to_fingerprint(@conn, @comment.fingerprint)
|
2019-12-10 21:29:48 +01: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"
|
2019-10-05 02:51:56 +02:00
|
|
|
/- if can?(:hide, Comment)
|
|
|
|
/ .js-staff-action
|
|
|
|
/ - if !comment.hidden_from_users && !comment.destroyed_content
|
|
|
|
/ =<> link_to '#', class: 'communication__interaction togglable-delete-form-link', 'data-click-toggle': "#inline-del-form-comment-#{comment.id}" do
|
|
|
|
/ i.fa.fa-times
|
|
|
|
/ =<> 'Delete'
|
|
|
|
/ - elsif comment.hidden_from_users && !comment.destroyed_content
|
|
|
|
/ =<> link_to image_comment_hide_path(comment.image, comment), data: { confirm: t('are_you_sure') }, method: :delete, class: 'communication__interaction' do
|
|
|
|
/ i.fa.fa-check
|
|
|
|
/ =<> 'Restore'
|
|
|
|
/ - if can?(:manage, Comment)
|
|
|
|
/ =<> link_to image_comment_path(comment.image, comment), method: :delete, data: { confirm: t('are_you_sure') }, class: 'communication__interaction' do
|
|
|
|
/ i.fa.fa-times
|
|
|
|
/ =<> 'Delete Contents'
|
|
|
|
/ - if can?(:manage, Comment)
|
|
|
|
/ .communication__info
|
|
|
|
/ =<> link_to_ip(comment.ip)
|
|
|
|
/ .communication__info
|
|
|
|
/ =<> link_to_fingerprint(comment.fingerprint, comment.user_agent)
|
|
|
|
/ = form_tag image_comment_hide_path(comment.image, comment), class: 'togglable-delete-form hidden flex', id: "inline-del-form-comment-#{comment.id}"
|
|
|
|
/ = text_field_tag :deletion_reason, nil, class: 'input input--wide', placeholder: 'Deletion Reason', id: "inline-del-reason-comment-#{comment.id}", required: true
|
|
|
|
/ = submit_tag 'Delete', class: 'button'
|