client/home: change apparance
This commit is contained in:
parent
6140872cd9
commit
cd1f4709f0
|
@ -2,42 +2,42 @@
|
||||||
text-align: center !important
|
text-align: center !important
|
||||||
|
|
||||||
header
|
header
|
||||||
|
margin-bottom: 1em
|
||||||
h1
|
h1
|
||||||
margin-top: 0
|
line-height: initial
|
||||||
margin-bottom: 0.2em
|
font-size: 30pt
|
||||||
aside
|
margin: 0
|
||||||
opacity: .5
|
|
||||||
font-size: 80%
|
|
||||||
margin-bottom: 2em
|
|
||||||
|
|
||||||
.message
|
.message
|
||||||
margin-bottom: 2em
|
margin-bottom: 2em
|
||||||
|
|
||||||
form
|
form
|
||||||
margin-bottom: 2em
|
|
||||||
width: auto
|
width: auto
|
||||||
|
vertical-align: middle
|
||||||
|
margin: 0 0 2em 0
|
||||||
|
text-align: left
|
||||||
white-space: nowrap
|
white-space: nowrap
|
||||||
input
|
input
|
||||||
width: auto
|
width: auto
|
||||||
.separator
|
.sep
|
||||||
display: inline-block
|
margin: 0 0.75em
|
||||||
margin: 0 1.5em
|
|
||||||
|
|
||||||
.post-container
|
.post-container
|
||||||
|
margin-bottom: 2em
|
||||||
display: flex
|
display: flex
|
||||||
align-items: center
|
align-items: center
|
||||||
justify-content: center
|
justify-content: center
|
||||||
|
|
||||||
nav
|
nav
|
||||||
margin-bottom: 0.5em
|
|
||||||
a
|
a
|
||||||
padding: 0.5em
|
padding: 0.5em
|
||||||
|
|
||||||
aside
|
aside
|
||||||
margin-bottom: 1em
|
margin-bottom: 0.3em
|
||||||
font-size: 90%
|
font-size: 90%
|
||||||
|
|
||||||
footer
|
footer
|
||||||
margin-top: 1em
|
|
||||||
line-height: 100%
|
line-height: 100%
|
||||||
font-size: 80%
|
font-size: 80%
|
||||||
|
.sep
|
||||||
|
margin: 0 0.25em
|
||||||
|
|
|
@ -2,23 +2,15 @@
|
||||||
<div class='messages'></div>
|
<div class='messages'></div>
|
||||||
<header>
|
<header>
|
||||||
<h1><%- ctx.name %></h1>
|
<h1><%- ctx.name %></h1>
|
||||||
<aside class='stats-container'></aside>
|
|
||||||
</header>
|
</header>
|
||||||
<% if (ctx.canListPosts) { %>
|
<% if (ctx.canListPosts) { %>
|
||||||
<form class='horizontal'>
|
<form class='horizontal'>
|
||||||
<div class='input'>
|
|
||||||
<%= ctx.makeButton({name: 'all-posts', value: 'Browse all posts'}) %>
|
|
||||||
<span class='separator'>or</span>
|
|
||||||
<%= ctx.makeTextInput({name: 'search-text', placeholder: 'enter some tags'}) %>
|
<%= ctx.makeTextInput({name: 'search-text', placeholder: 'enter some tags'}) %>
|
||||||
</div>
|
|
||||||
<div class='buttons'>
|
|
||||||
<input type='submit' value='Search'/>
|
<input type='submit' value='Search'/>
|
||||||
</div>
|
<span class=sep>or</span>
|
||||||
|
<a href='/posts'>browse all posts</a>
|
||||||
</form>
|
</form>
|
||||||
<% } %>
|
<% } %>
|
||||||
<div class='post-info-container'></div>
|
<div class='post-info-container'></div>
|
||||||
<footer>
|
<footer class='footer-container'></footer>
|
||||||
Build <a class='version' href='https://github.com/rr-/szurubooru/commits/master'><%- ctx.version %></a>
|
|
||||||
from <%= ctx.makeRelativeTime(ctx.buildDate) %>
|
|
||||||
</footer>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
<div class='post-container'></div>
|
||||||
<% if (ctx.featuredPost) { %>
|
<% if (ctx.featuredPost) { %>
|
||||||
<aside>
|
<aside>
|
||||||
Featured post: <%= ctx.makePostLink(ctx.featuredPost.id) %>,
|
Featured post: <%= ctx.makePostLink(ctx.featuredPost.id) %>,
|
||||||
|
@ -7,4 +8,3 @@
|
||||||
<%= ctx.makeUserLink(ctx.featuredPost.user) %>
|
<%= ctx.makeUserLink(ctx.featuredPost.user) %>
|
||||||
</aside>
|
</aside>
|
||||||
<% } %>
|
<% } %>
|
||||||
<div class='post-container'></div>
|
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
<%- ctx.postCount %> posts
|
||||||
|
<span class=sep>•</span>
|
||||||
|
<%= ctx.makeFileSize(ctx.diskUsage) %>
|
||||||
|
<span class=sep>•</span>
|
||||||
|
Build <a class='version' href='https://github.com/rr-/szurubooru/commits/master'><%- ctx.version %></a>
|
||||||
|
from <%= ctx.makeRelativeTime(ctx.buildDate) %>
|
|
@ -1 +0,0 @@
|
||||||
Serving <%- ctx.postCount %> posts (<%= ctx.makeFileSize(ctx.diskUsage) %>)
|
|
|
@ -10,20 +10,18 @@ const TagAutoCompleteControl =
|
||||||
require('../controls/tag_auto_complete_control.js');
|
require('../controls/tag_auto_complete_control.js');
|
||||||
|
|
||||||
const template = views.getTemplate('home');
|
const template = views.getTemplate('home');
|
||||||
const statsTemplate = views.getTemplate('home-stats');
|
const footerTemplate = views.getTemplate('home-footer');
|
||||||
const featuredPostTemplate = views.getTemplate('home-featured-post');
|
const featuredPostTemplate = views.getTemplate('home-featured-post');
|
||||||
|
|
||||||
class HomeView {
|
class HomeView {
|
||||||
constructor(ctx) {
|
constructor(ctx) {
|
||||||
this._hostNode = document.getElementById('content-holder');
|
this._hostNode = document.getElementById('content-holder');
|
||||||
|
this._ctx = ctx;
|
||||||
|
|
||||||
const sourceNode = template(ctx);
|
const sourceNode = template(ctx);
|
||||||
views.replaceContent(this._hostNode, sourceNode);
|
views.replaceContent(this._hostNode, sourceNode);
|
||||||
|
|
||||||
if (this._formNode) {
|
if (this._formNode) {
|
||||||
this._formNode.querySelector('input[name=all-posts')
|
|
||||||
.addEventListener('click', e => this._evtAllPostsClick(e));
|
|
||||||
|
|
||||||
this._tagAutoCompleteControl = new TagAutoCompleteControl(
|
this._tagAutoCompleteControl = new TagAutoCompleteControl(
|
||||||
this._searchInputNode);
|
this._searchInputNode);
|
||||||
this._formNode.addEventListener(
|
this._formNode.addEventListener(
|
||||||
|
@ -41,7 +39,9 @@ class HomeView {
|
||||||
}
|
}
|
||||||
|
|
||||||
setStats(stats) {
|
setStats(stats) {
|
||||||
views.replaceContent(this._statsContainerNode, statsTemplate(stats));
|
views.replaceContent(
|
||||||
|
this._footerContainerNode,
|
||||||
|
footerTemplate(Object.assign({}, stats, this._ctx)));
|
||||||
}
|
}
|
||||||
|
|
||||||
setFeaturedPost(postInfo) {
|
setFeaturedPost(postInfo) {
|
||||||
|
@ -64,8 +64,8 @@ class HomeView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get _statsContainerNode() {
|
get _footerContainerNode() {
|
||||||
return this._hostNode.querySelector('.stats-container');
|
return this._hostNode.querySelector('.footer-container');
|
||||||
}
|
}
|
||||||
|
|
||||||
get _postInfoContainerNode() {
|
get _postInfoContainerNode() {
|
||||||
|
@ -84,11 +84,6 @@ class HomeView {
|
||||||
return this._formNode.querySelector('input[name=search-text]');
|
return this._formNode.querySelector('input[name=search-text]');
|
||||||
}
|
}
|
||||||
|
|
||||||
_evtAllPostsClick(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
router.show('/posts/');
|
|
||||||
}
|
|
||||||
|
|
||||||
_evtFormSubmit(e) {
|
_evtFormSubmit(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this._searchInputNode.blur();
|
this._searchInputNode.blur();
|
||||||
|
|
Loading…
Reference in New Issue