2019-10-06 23:31:48 +02:00
|
|
|
article.block.communication id="post_#{@post.id}"
|
2022-03-22 22:23:30 +01:00
|
|
|
= if not @post.approved and not @post.hidden_from_users and (can?(@conn, :hide, @post) or @post.user_id == @conn.assigns.current_user.id) do
|
|
|
|
.block__content
|
|
|
|
.block.block--fixed.block--danger
|
|
|
|
p
|
|
|
|
i.fas.fa-exclamation-triangle>
|
|
|
|
' This post is pending approval from a staff member.
|
|
|
|
= if can?(@conn, :approve, @post) do
|
|
|
|
p
|
|
|
|
ul.horizontal-list
|
|
|
|
li
|
|
|
|
= link(to: Routes.forum_topic_post_approve_path(@conn, :create, @post.topic.forum, @post.topic, @post), data: [confirm: "Are you sure?"], method: "post", class: "button") do
|
|
|
|
i.fas.fa-check>
|
|
|
|
' Approve
|
|
|
|
li
|
|
|
|
a.button.togglable-delete-form-link href="#" data-click-toggle="#inline-reject-form-post-#{@post.id}"
|
|
|
|
i.fa.fa-times>
|
|
|
|
' Reject
|
|
|
|
|
|
|
|
= form_for :post, Routes.forum_topic_post_hide_path(@conn, :create, @post.topic.forum, @post.topic, @post), [class: "togglable-delete-form hidden flex", id: "inline-reject-form-post-#{@post.id}"], fn f ->
|
|
|
|
= text_input f, :deletion_reason, class: "input input--wide", placeholder: "Deletion Reason", id: "inline-reject-reason-post-#{@post.id}", required: true
|
|
|
|
= submit "Delete", class: "button"
|
|
|
|
|
2019-12-12 00:58:00 +01:00
|
|
|
.block__content.flex.flex--no-wrap class=communication_body_class(@post)
|
2019-10-06 23:31:48 +02:00
|
|
|
.flex__fixed.spacing-right
|
2019-11-30 05:53:37 +01:00
|
|
|
= render PhilomenaWeb.UserAttributionView, "_anon_user_avatar.html", object: @post, conn: @conn
|
2019-10-06 23:31:48 +02:00
|
|
|
.flex__grow.communication__body
|
2019-11-30 05:53:37 +01:00
|
|
|
span.communication__body__sender-name = render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @post, awards: true, conn: @conn
|
2019-11-28 03:31:53 +01:00
|
|
|
br
|
|
|
|
= render PhilomenaWeb.UserAttributionView, "_anon_user_title.html", object: @post, conn: @conn
|
2019-10-06 23:31:48 +02:00
|
|
|
.communication__body__text
|
2019-11-30 05:53:37 +01:00
|
|
|
= if @post.hidden_from_users do
|
|
|
|
strong.comment_deleted
|
|
|
|
' Deletion reason:
|
|
|
|
=> @post.deletion_reason
|
2019-12-17 07:58:27 +01:00
|
|
|
= if can?(@conn, :hide, @post) and not is_nil(@post.deleted_by) do
|
2019-12-12 00:58:00 +01:00
|
|
|
| (
|
|
|
|
= @post.deleted_by.name
|
|
|
|
| )
|
2019-12-12 05:41:33 +01:00
|
|
|
|
2019-12-12 00:58:00 +01:00
|
|
|
= if can?(@conn, :hide, @post) do
|
|
|
|
= if @post.destroyed_content do
|
|
|
|
br
|
|
|
|
strong.comment_deleted>
|
|
|
|
| This post's contents have been destroyed.
|
|
|
|
- else
|
|
|
|
br
|
2024-05-04 05:15:14 +02:00
|
|
|
=<> @body
|
2019-12-12 05:41:33 +01:00
|
|
|
|
2019-11-30 05:53:37 +01:00
|
|
|
- else
|
2024-05-04 05:15:14 +02:00
|
|
|
=<> @body
|
2019-12-12 05:41:33 +01:00
|
|
|
|
2019-10-06 23:31:48 +02:00
|
|
|
.block__content.communication__options
|
|
|
|
.flex.flex--wrap.flex--spaced-out
|
|
|
|
= render PhilomenaWeb.PostView, "_post_options.html", conn: @conn, post: @post
|
2019-12-12 05:41:33 +01:00
|
|
|
|
2019-12-20 23:35:46 +01:00
|
|
|
= if can?(@conn, :hide, @post) and not hide_staff_tools?(@conn) do
|
2019-12-12 00:58:00 +01:00
|
|
|
= cond do
|
|
|
|
- @post.hidden_from_users and not @post.destroyed_content ->
|
2019-12-12 05:41:33 +01:00
|
|
|
= link(to: Routes.forum_topic_post_hide_path(@conn, :delete, @post.topic.forum, @post.topic, @post), data: [confirm: "Are you sure?"], method: "delete", class: "communication__interaction") do
|
2019-12-12 00:58:00 +01:00
|
|
|
i.fas.fa-check>
|
|
|
|
' Restore
|
|
|
|
= if can?(@conn, :delete, @post) do
|
2019-12-12 05:41:33 +01:00
|
|
|
= link(to: Routes.forum_topic_post_delete_path(@conn, :create, @post.topic.forum, @post.topic, @post), data: [confirm: "Are you sure?"], method: "post", class: "communication__interaction") do
|
2019-12-12 00:58:00 +01:00
|
|
|
i.fas.fa-times>
|
|
|
|
' Delete Contents
|
2019-12-12 05:41:33 +01:00
|
|
|
|
2019-12-12 00:58:00 +01:00
|
|
|
- not @post.hidden_from_users and not @post.destroyed_content ->
|
|
|
|
a.communication__interaction.togglable-delete-form-link href="#" data-click-toggle="#inline-del-form-post-#{@post.id}"
|
|
|
|
i.fa.fa-times>
|
|
|
|
' Delete
|
2019-12-12 05:41:33 +01:00
|
|
|
|
2019-12-12 00:58:00 +01:00
|
|
|
- true ->
|
2019-12-12 05:41:33 +01:00
|
|
|
|
2019-12-10 21:31:39 +01:00
|
|
|
= if can?(@conn, :show, :ip_address) do
|
2019-12-05 21:06:18 +01:00
|
|
|
.communication__info
|
2019-12-08 02:49:28 +01:00
|
|
|
=<> link_to_ip(@conn, @post.ip)
|
2019-12-05 21:06:18 +01:00
|
|
|
.communication__info
|
2019-12-08 02:49:28 +01:00
|
|
|
=<> link_to_fingerprint(@conn, @post.fingerprint)
|
2019-12-12 05:41:33 +01:00
|
|
|
|
2019-12-12 00:58:00 +01:00
|
|
|
= form_for :post, Routes.forum_topic_post_hide_path(@conn, :create, @post.topic.forum, @post.topic, @post), [class: "togglable-delete-form hidden flex", id: "inline-del-form-post-#{@post.id}"], fn f ->
|
|
|
|
= text_input f, :deletion_reason, class: "input input--wide", placeholder: "Deletion Reason", id: "inline-del-reason-post-#{@post.id}", required: true
|
|
|
|
= submit "Delete", class: "button"
|