philomena/lib/philomena_web/templates/post/_post.html.slime

72 lines
3.8 KiB
Text
Raw Normal View History

2024-06-06 22:28:35 +02:00
- post_link = ~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}?#{[post_id: @post.id]}" <> "#post_#{@post.id}"
2024-05-31 20:07:00 +02:00
- options = if true do
.flex__spacer.hidden--desktop
a.communication__interaction.hidden--desktop title="Link to post" href=post_link
i.fa.fa-link
= if not is_nil(@post.edited_at) and can?(@conn, :show, @post) do
2024-06-06 22:28:35 +02:00
a href=~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}/posts/#{@post}/history"
2024-05-31 20:07:00 +02:00
' Edited
=> pretty_time(@post.edited_at)
= if @post.edit_reason not in [nil, ""] do
' because:
=> @post.edit_reason
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
2024-06-06 22:28:35 +02:00
= link(to: ~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}/posts/#{@post}/approve", data: [confirm: "Are you sure?"], method: "post", class: "button") do
2022-03-22 22:23:30 +01:00
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
2024-06-06 22:28:35 +02:00
= form_for :post, ~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}/posts/#{@post}/hide", [class: "togglable-delete-form hidden flex", id: "inline-reject-form-post-#{@post.id}"], fn f ->
2022-03-22 22:23:30 +01:00
= 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"
.block__content.flex.flex--no-wrap class=communication_body_class(@post)
2024-05-31 20:07:00 +02:00
= render PhilomenaWeb.CommunicationView, "_body.html", object: @post, body: @body, conn: @conn, name: "post", options: options
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-20 23:35:46 +01:00
= if can?(@conn, :hide, @post) and not hide_staff_tools?(@conn) do
= cond do
- @post.hidden_from_users and not @post.destroyed_content ->
2024-06-06 22:28:35 +02:00
= link(to: ~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}/posts/#{@post}/hide", data: [confirm: "Are you sure?"], method: "delete", class: "communication__interaction") do
i.fas.fa-check>
' Restore
= if can?(@conn, :delete, @post) do
2024-06-06 22:28:35 +02:00
= link(to: ~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}/posts/#{@post}/delete", data: [confirm: "Are you sure?"], method: "post", class: "communication__interaction") do
i.fas.fa-times>
' Delete Contents
- 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
- true ->
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)
2024-06-06 22:28:35 +02:00
= form_for :post, ~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}/posts/#{@post}/hide", [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"