philomena/lib/philomena_web/templates/comment/_comment.html.slime

61 lines
3.4 KiB
Text
Raw Normal View History

2019-10-05 02:51:56 +02:00
article.block.communication id="comment_#{@comment.id}"
2022-03-22 22:23:30 +01:00
= if not @comment.approved and not @comment.hidden_from_users and (can?(@conn, :hide, @comment) or @comment.user_id == @conn.assigns.current_user.id) do
.block__content
.block.block--fixed.block--danger
p
i.fas.fa-exclamation-triangle>
' This comment is pending approval from a staff member.
= if can?(@conn, :approve, @comment) do
p
ul.horizontal-list
li
= link(to: Routes.image_comment_approve_path(@conn, :create, @comment.image_id, @comment), 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-comment-#{@comment.id}"
i.fa.fa-times>
' Reject
= form_for :comment, Routes.image_comment_hide_path(@conn, :create, @comment.image_id, @comment), [class: "togglable-delete-form hidden flex", id: "inline-reject-form-comment-#{@comment.id}"], fn f ->
= text_input f, :deletion_reason, class: "input input--wide", placeholder: "Deletion Reason", id: "inline-reject-reason-comment-#{@comment.id}", required: true
= submit "Delete", class: "button"
.block__content.flex.flex--no-wrap class=communication_body_class(@comment)
2024-05-07 19:33:56 +02:00
= render PhilomenaWeb.CommunicationView, "_body.html", object: @comment, body: @body, conn: @conn, name: "comment"
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
2024-05-07 22:52:17 +02:00
.communication__options__staff
= 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, :create, @comment.image_id, @comment), data: [confirm: "Are you sure?"], method: "post", class: "communication__interaction") do
i.fas.fa-times>
' Delete Contents
- not @comment.hidden_from_users and not @comment.destroyed_content ->
a.button.button--danger.togglable-delete-form-link href="#" data-click-toggle="#inline-del-form-comment-#{@comment.id}"
2019-12-10 21:42:52 +01:00
i.fas.fa-times>
2024-05-07 22:52:17 +02:00
' Delete
2024-05-07 22:52:17 +02:00
- true ->
2024-05-07 22:52:17 +02:00
= if can?(@conn, :show, :ip_address) do
.button.button--information.js-staff-action
=<> link_to_ip(@conn, @comment.ip)
.button.button--information.js-staff-action
=<> 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"