mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 21:47:59 +01:00
images in report queue
This commit is contained in:
parent
ddc3ee61a1
commit
179d8a27d9
3 changed files with 13 additions and 1 deletions
|
@ -18,7 +18,7 @@ defmodule Philomena.Polymorphic do
|
|||
}
|
||||
|
||||
@preloads %{
|
||||
"Comment" => [:user, :image],
|
||||
"Comment" => [:user, image: :tags],
|
||||
"Commission" => [:user],
|
||||
"Conversation" => [:from, :to],
|
||||
"Gallery" => [:creator],
|
||||
|
|
|
@ -11,6 +11,7 @@ table.table
|
|||
= for report <- @reports do
|
||||
tr
|
||||
td
|
||||
=> reported_image @conn, report.reportable
|
||||
= link_to_reported_thing @conn, report.reportable
|
||||
td
|
||||
span title=report.reason
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
defmodule PhilomenaWeb.Admin.ReportView do
|
||||
use PhilomenaWeb, :view
|
||||
|
||||
alias Philomena.Images.Image
|
||||
alias Philomena.Comments.Comment
|
||||
|
||||
import PhilomenaWeb.ReportView, only: [link_to_reported_thing: 2, report_row_class: 1, pretty_state: 1]
|
||||
import PhilomenaWeb.ProfileView, only: [user_abbrv: 2, current?: 2]
|
||||
|
||||
|
@ -20,4 +23,12 @@ defmodule PhilomenaWeb.Admin.ReportView do
|
|||
def ordered_tags(tags) do
|
||||
Enum.sort_by(tags, & &1.name)
|
||||
end
|
||||
|
||||
def reported_image(conn, %Image{} = image) do
|
||||
render PhilomenaWeb.ImageView, "_image_container.html", image: image, size: :thumb_tiny, conn: conn
|
||||
end
|
||||
def reported_image(conn, %Comment{image: image}) do
|
||||
render PhilomenaWeb.ImageView, "_image_container.html", image: image, size: :thumb_tiny, conn: conn
|
||||
end
|
||||
def reported_image(_conn, _reportable), do: nil
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue