mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-23 20:18:00 +01:00
Module.concat workaround in post renderer is no longer needed
This commit is contained in:
parent
59d5211926
commit
8c9315acf2
1 changed files with 7 additions and 8 deletions
|
@ -2,12 +2,11 @@ defmodule PhilomenaWeb.MarkdownRenderer do
|
|||
alias Philomena.Markdown
|
||||
alias Philomena.Images.Image
|
||||
alias Philomena.Repo
|
||||
alias PhilomenaWeb.ImageView
|
||||
import Phoenix.HTML
|
||||
import Phoenix.HTML.Link
|
||||
import Ecto.Query
|
||||
|
||||
@image_view Module.concat(["PhilomenaWeb.ImageView"])
|
||||
|
||||
def render_one(item, conn) do
|
||||
hd(render_collection([item], conn))
|
||||
end
|
||||
|
@ -79,28 +78,28 @@ defmodule PhilomenaWeb.MarkdownRenderer do
|
|||
img != nil ->
|
||||
case group do
|
||||
[_id, "p"] when not img.hidden_from_users and img.approved ->
|
||||
Phoenix.View.render(@image_view, "_image_target.html",
|
||||
Phoenix.View.render(ImageView, "_image_target.html",
|
||||
embed_display: true,
|
||||
image: img,
|
||||
size: @image_view.select_version(img, :medium),
|
||||
size: ImageView.select_version(img, :medium),
|
||||
conn: conn
|
||||
)
|
||||
|> safe_to_string()
|
||||
|
||||
[_id, "t"] when not img.hidden_from_users and img.approved ->
|
||||
Phoenix.View.render(@image_view, "_image_target.html",
|
||||
Phoenix.View.render(ImageView, "_image_target.html",
|
||||
embed_display: true,
|
||||
image: img,
|
||||
size: @image_view.select_version(img, :small),
|
||||
size: ImageView.select_version(img, :small),
|
||||
conn: conn
|
||||
)
|
||||
|> safe_to_string()
|
||||
|
||||
[_id, "s"] when not img.hidden_from_users and img.approved ->
|
||||
Phoenix.View.render(@image_view, "_image_target.html",
|
||||
Phoenix.View.render(ImageView, "_image_target.html",
|
||||
embed_display: true,
|
||||
image: img,
|
||||
size: @image_view.select_version(img, :thumb_small),
|
||||
size: ImageView.select_version(img, :thumb_small),
|
||||
conn: conn
|
||||
)
|
||||
|> safe_to_string()
|
||||
|
|
Loading…
Reference in a new issue