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

51 lines
2.7 KiB
Text
Raw Normal View History

2019-10-06 23:31:48 +02:00
article.block.communication id="post_#{@post.id}"
.block__content.flex.flex--no-wrap
.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
- else
2019-11-11 00:35:52 +01:00
==<> @body
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-05 21:06:18 +01:00
= if can?(@conn, :hide, @post) do
/ todo: make post deletion work
a.communication__interaction.togglable-delete-form-link href="#"
i.fa.fa-times
=<> "Delete"
= if can?(@conn, :manage, @post) do
.communication__info
=<> link_to_ip(@post.ip)
.communication__info
=<> link_to_fingerprint(@post.fingerprint)
2019-10-06 23:31:48 +02:00
/- if can?(:hide, Post)
/ .js-staff-action
/ - if !post.hidden_from_users && !post.destroyed_content
/ =<> link_to '#', class: 'communication__interaction togglable-delete-form-link', 'data-click-toggle': "#inline-del-form-post-#{post.id}" do
/ i.fa.fa-times
/ =<> 'Delete'
/ - elsif post.hidden_from_users && !post.destroyed_content
/ =<> link_to forum_topic_post_hide_path(post.topic.forum, post.topic, post), data: { confirm: t('are_you_sure') }, method: :delete, class: 'communication__interaction' do
/ i.fa.fa-check
/ =<> 'Restore'
/ - if can?(:manage, Post)
/ =<> link_to forum_topic_post_path(post.topic.forum, post.topic, post, deletion_reason: post.deletion_reason), method: :delete, data: { confirm: t('are_you_sure') }, class: 'communication__interaction' do
/ i.fa.fa-times
/ =<> 'Delete Contents'
/ - if can?(:manage, Post)
/ .communication__info
/ =<> link_to_ip(post.ip)
/ .communication__info
/ =<> link_to_fingerprint(post.fingerprint, post.user_agent)
/ = form_tag forum_topic_post_hide_path(post.topic.forum, post.topic, post), class: 'togglable-delete-form hidden flex', id: "inline-del-form-post-#{post.id}"
/ = text_field_tag :deletion_reason, nil, class: 'input input--wide', placeholder: 'Deletion Reason', id: "inline-del-reason-post-#{post.id}", required: true
/ = submit_tag 'Delete', class: 'button'