philomena/lib/philomena_web/templates/communication/_body.html.slime

70 lines
2.3 KiB
Text
Raw Normal View History

2024-05-07 19:33:56 +02:00
- anon = is_nil(assigns[:noanon]) or @noanon == false
2024-05-31 20:07:00 +02:00
- options = if is_nil(assigns[:options]), do: "", else: @options
2024-05-07 19:33:56 +02:00
- avatar = cond do
- not is_nil(assigns[:image]) ->
2024-05-20 19:04:12 +02:00
.post-image-container.media__standalone
2024-05-07 19:33:56 +02:00
= render PhilomenaWeb.ImageView, "_image_container.html", image: @image, size: :thumb_tiny, conn: @conn
- anon ->
= render PhilomenaWeb.UserAttributionView, "_anon_user_avatar.html", object: @object, conn: @conn
- true ->
= render PhilomenaWeb.UserAttributionView, "_user_avatar.html", object: @object, conn: @conn, class: "avatar--small"
- username = if anon do
= render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @object, awards: true, conn: @conn
- else
= render PhilomenaWeb.UserAttributionView, "_user.html", object: @object, badges: true, conn: @conn
- title = if anon do
= render PhilomenaWeb.UserAttributionView, "_anon_user_title.html", object: @object, conn: @conn
- else
= render PhilomenaWeb.UserAttributionView, "_user_title.html", object: @object, conn: @conn
- contents = if Map.has_key?(@object, :hidden_from_users) and @object.hidden_from_users == true do
strong.comment_deleted
' Deletion reason:
=<> @object.deletion_reason
= if can?(@conn, :hide, @object) and not is_nil(@object.deleted_by) do
| (
= @object.deleted_by.name
| )
= if can?(@conn, :hide, @object) do
= if @object.destroyed_content do
br
strong.comment_deleted>
| This #{@name}'s contents have been destroyed.
- else
br
=<> @body
- else
=<> @body
.flex.flex__grow.hidden--mobile
.flex.flex__fixed.spacing--right
= avatar
.flex__grow.communication__body
.communication__sender-block
span.communication__sender-name
= username
2024-05-31 20:07:00 +02:00
.flex__spacer
span.communication__post-time
' Posted
=< pretty_time(@object.created_at)
= options
2024-05-07 19:33:56 +02:00
= title
.communication__body__text
= contents
.flex.flex__column.flex__grow.hidden--desktop
.communication__sender-block
= avatar
.flex__column.flex--small-gap
span.communication__sender-name
= username
= title
2024-05-31 20:07:00 +02:00
span.communication__post-time
' Posted
= pretty_time(@object.created_at)
= options
2024-05-07 19:33:56 +02:00
.communication__body.communication__body__text
= contents