mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-24 04:27:59 +01:00
use comment listing with images
This commit is contained in:
parent
a8fef6d03c
commit
850a0d758e
5 changed files with 31 additions and 16 deletions
|
@ -19,7 +19,7 @@ defmodule PhilomenaWeb.CommentController do
|
||||||
sort: %{posted_at: :desc}
|
sort: %{posted_at: :desc}
|
||||||
},
|
},
|
||||||
conn.assigns.pagination,
|
conn.assigns.pagination,
|
||||||
Comment |> preload([:image, user: [awards: :badge]])
|
Comment |> preload([image: [:tags], user: [awards: :badge]])
|
||||||
)
|
)
|
||||||
|
|
||||||
rendered =
|
rendered =
|
||||||
|
|
7
lib/philomena_web/controllers/post_controller.ex
Normal file
7
lib/philomena_web/controllers/post_controller.ex
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
defmodule PhilomenaWeb.PostController do
|
||||||
|
use PhilomenaWeb, :controller
|
||||||
|
|
||||||
|
def index(conn, _params) do
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
|
@ -5,20 +5,11 @@ article.block.communication id="comment_#{@comment.id}"
|
||||||
.flex__grow.communication__body
|
.flex__grow.communication__body
|
||||||
span.communication__body__sender-name = render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @comment, awards: true, conn: @conn
|
span.communication__body__sender-name = render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @comment, awards: true, conn: @conn
|
||||||
.communication__body__text
|
.communication__body__text
|
||||||
/- if comment.hidden_from_users
|
= if @comment.hidden_from_users do
|
||||||
/ strong.comment_deleted
|
strong.comment_deleted
|
||||||
/ | Deletion reason:
|
' Deletion reason:
|
||||||
/ =<> comment.deletion_reason
|
=> @comment.deletion_reason
|
||||||
/ - if can?(:read, comment)
|
- else
|
||||||
/ | (
|
|
||||||
/ = comment.deleted_by.try(:name) || 'Orbital Friendship Cannon'
|
|
||||||
/ | )
|
|
||||||
/ br
|
|
||||||
/ - if comment.destroyed_content
|
|
||||||
/ | This comment's contents have been destroyed.
|
|
||||||
/ br
|
|
||||||
/= if can?(:read, @comment)
|
|
||||||
= if !@comment.hidden_from_users do
|
|
||||||
==<> @body
|
==<> @body
|
||||||
|
|
||||||
.block__content.communication__options
|
.block__content.communication__options
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
article.block.communication id="comment_#{@comment.id}"
|
||||||
|
.block__content.flex.flex--no-wrap
|
||||||
|
.flex__fixed.spacing-right
|
||||||
|
= render PhilomenaWeb.ImageView, "_image_container.html", image: @comment.image, size: :thumb, conn: @conn
|
||||||
|
.flex__grow.communication__body
|
||||||
|
span.communication__body__sender-name = render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @comment, awards: true, conn: @conn
|
||||||
|
.communication__body__text
|
||||||
|
= if @comment.hidden_from_users do
|
||||||
|
strong.comment_deleted
|
||||||
|
' Deletion reason:
|
||||||
|
=> @comment.deletion_reason
|
||||||
|
- else
|
||||||
|
==<> @body
|
||||||
|
|
||||||
|
.block__content.communication__options
|
||||||
|
.flex.flex--wrap.flex--spaced-out
|
||||||
|
= render PhilomenaWeb.CommentView, "_comment_options.html", comment: @comment, conn: @conn
|
|
@ -7,7 +7,7 @@ elixir:
|
||||||
= pagination
|
= pagination
|
||||||
|
|
||||||
= for {comment, body} <- @comments do
|
= for {comment, body} <- @comments do
|
||||||
= render PhilomenaWeb.CommentView, "_comment.html", comment: comment, body: body, conn: @conn
|
= render PhilomenaWeb.CommentView, "_comment_with_image.html", image: comment.image, comment: comment, body: body, conn: @conn
|
||||||
|
|
||||||
.block
|
.block
|
||||||
.block__header.block__header--light
|
.block__header.block__header--light
|
||||||
|
|
Loading…
Reference in a new issue