client/home: fix missing info on featured post
This commit is contained in:
parent
7e62751e4e
commit
99011b02d7
|
@ -16,16 +16,7 @@
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<% } %>
|
<% } %>
|
||||||
<% if (ctx.featuredPost) { %>
|
<div class='post-info-container'></div>
|
||||||
<aside>
|
|
||||||
Featured post: <%= ctx.makePostLink(ctx.featuredPost.id) %>,
|
|
||||||
posted
|
|
||||||
<%= ctx.makeRelativeTime(ctx.featuredPost.creationTime) %>
|
|
||||||
by
|
|
||||||
<%= ctx.makeUserLink(ctx.featuredPost.user) %>
|
|
||||||
</aside>
|
|
||||||
<% } %>
|
|
||||||
<div class='post-container'></div>
|
|
||||||
<footer>
|
<footer>
|
||||||
Build <a class='version' href='https://github.com/rr-/szurubooru/commits/master'><%- ctx.version %></a>
|
Build <a class='version' href='https://github.com/rr-/szurubooru/commits/master'><%- ctx.version %></a>
|
||||||
from <%= ctx.makeRelativeTime(ctx.buildDate) %>
|
from <%= ctx.makeRelativeTime(ctx.buildDate) %>
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
<% if (ctx.featuredPost) { %>
|
||||||
|
<aside>
|
||||||
|
Featured post: <%= ctx.makePostLink(ctx.featuredPost.id) %>,
|
||||||
|
posted
|
||||||
|
<%= ctx.makeRelativeTime(ctx.featuredPost.creationTime) %>
|
||||||
|
by
|
||||||
|
<%= ctx.makeUserLink(ctx.featuredPost.user) %>
|
||||||
|
</aside>
|
||||||
|
<% } %>
|
||||||
|
<div class='post-container'></div>
|
|
@ -11,6 +11,7 @@ const TagAutoCompleteControl =
|
||||||
|
|
||||||
const template = views.getTemplate('home');
|
const template = views.getTemplate('home');
|
||||||
const statsTemplate = views.getTemplate('home-stats');
|
const statsTemplate = views.getTemplate('home-stats');
|
||||||
|
const featuredPostTemplate = views.getTemplate('home-featured-post');
|
||||||
|
|
||||||
class HomeView {
|
class HomeView {
|
||||||
constructor(ctx) {
|
constructor(ctx) {
|
||||||
|
@ -44,6 +45,8 @@ class HomeView {
|
||||||
}
|
}
|
||||||
|
|
||||||
setFeaturedPost(postInfo) {
|
setFeaturedPost(postInfo) {
|
||||||
|
views.replaceContent(
|
||||||
|
this._postInfoContainerNode, featuredPostTemplate(postInfo));
|
||||||
if (this._postContainerNode && postInfo.featuredPost) {
|
if (this._postContainerNode && postInfo.featuredPost) {
|
||||||
this._postContentControl = new PostContentControl(
|
this._postContentControl = new PostContentControl(
|
||||||
this._postContainerNode,
|
this._postContainerNode,
|
||||||
|
@ -65,6 +68,10 @@ class HomeView {
|
||||||
return this._hostNode.querySelector('.stats-container');
|
return this._hostNode.querySelector('.stats-container');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get _postInfoContainerNode() {
|
||||||
|
return this._hostNode.querySelector('.post-info-container');
|
||||||
|
}
|
||||||
|
|
||||||
get _postContainerNode() {
|
get _postContainerNode() {
|
||||||
return this._hostNode.querySelector('.post-container');
|
return this._hostNode.querySelector('.post-container');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue