mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-02-17 11:04:22 +01:00
render descriptions
This commit is contained in:
parent
c08ceb5134
commit
cdd932c35f
3 changed files with 8 additions and 4 deletions
|
@ -43,9 +43,9 @@ function fetchAndPersistTags(tagIds) {
|
||||||
for (let i = 0; i < tagIds.length; i += chunk) {
|
for (let i = 0; i < tagIds.length; i += chunk) {
|
||||||
const ids = tagIds.slice(i, 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(response => response.json())
|
||||||
.then(data => data.tags.forEach(tag => persistTag(tag)));
|
.then(data => data.tags.forEach(tag => persistTag(tag)));*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,10 @@ defmodule PhilomenaWeb.ImageController do
|
||||||
comments =
|
comments =
|
||||||
Enum.zip(comments, rendered)
|
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
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
p
|
p
|
||||||
| Description:
|
| Description:
|
||||||
.image-description__text
|
.image-description__text
|
||||||
= @image.description
|
== @description
|
||||||
.js-tagsauce id="image_tags_and_source_#{@image.id}"
|
.js-tagsauce id="image_tags_and_source_#{@image.id}"
|
||||||
.tagsauce
|
.tagsauce
|
||||||
.block
|
.block
|
||||||
|
|
Loading…
Reference in a new issue