render descriptions

This commit is contained in:
byte[] 2019-11-11 17:57:29 -05:00
parent c08ceb5134
commit cdd932c35f
3 changed files with 8 additions and 4 deletions

View file

@ -43,9 +43,9 @@ function fetchAndPersistTags(tagIds) {
for (let i = 0; i < tagIds.length; i += chunk) {
const ids = tagIds.slice(i, i + chunk);
fetch(`${window.booru.apiEndpoint}tags/fetch_many.json?ids[]=${ids.join('&ids[]=')}`)
/*fetch(`${window.booru.apiEndpoint}tags/fetch_many.json?ids[]=${ids.join('&ids[]=')}`)
.then(response => response.json())
.then(data => data.tags.forEach(tag => persistTag(tag)));
.then(data => data.tags.forEach(tag => persistTag(tag)));*/
}
}

View file

@ -39,6 +39,10 @@ defmodule PhilomenaWeb.ImageController do
comments =
Enum.zip(comments, rendered)
render(conn, "show.html", image: conn.assigns.image, comments: comments)
description =
%{body: conn.assigns.image.description}
|> Renderer.render_one()
render(conn, "show.html", image: conn.assigns.image, comments: comments, description: description)
end
end

View file

@ -7,7 +7,7 @@
p
| Description:
.image-description__text
= @image.description
== @description
.js-tagsauce id="image_tags_and_source_#{@image.id}"
.tagsauce
.block