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