szurubooru/public_html/templates/home.tpl

70 lines
1.9 KiB
Smarty
Raw Normal View History

<% function showUser(name) { %>
2015-06-28 12:25:35 +02:00
<% var showLink = typeof(canViewUsers) !== 'undefined' && canViewUsers && name %>
2015-06-28 12:25:35 +02:00
<% if (showLink) { %>
<a href="#/user/<%= name %>">
<% } %>
2015-06-28 12:25:35 +02:00
<img width="25" height="25" class="author-avatar"
src="/data/thumbnails/25x25/avatars/<%= name || '!' %>"
alt="<%= name || 'Anonymous user' %>"/>
2015-06-28 12:25:35 +02:00
<%= name || 'Anonymous user' %>
2015-06-28 12:25:35 +02:00
<% if (showLink) { %>
</a>
<% } %>
<% } %>
2014-09-24 23:24:51 +02:00
<div id="home">
2015-06-28 12:25:35 +02:00
<h1><%= title %></h1>
<p class="subheader">
Serving <%= globals.postCount || 0 %> posts (<%= util.formatFileSize(globals.postSize || 0) %>)
</p>
2014-09-24 23:24:51 +02:00
2015-06-28 12:25:35 +02:00
<% if (post && post.id) { %>
<div class="post" style="width: <%= post.imageWidth || 800 %>px">
<div id="post-content-target">
</div>
2014-10-22 10:42:15 +02:00
2015-06-28 12:25:35 +02:00
<div class="post-footer">
2014-09-24 23:24:51 +02:00
2015-06-28 12:25:35 +02:00
<span class="left">
<% var showLink = canViewPosts %>
2014-09-30 22:09:43 +02:00
2015-06-28 12:25:35 +02:00
<% if (showLink) { %>
<a href="#/post/<%= post.id %>">
<% } %>
2014-09-30 22:09:43 +02:00
2015-06-28 12:25:35 +02:00
<%= post.idMarkdown %>
2014-09-30 22:09:43 +02:00
2015-06-28 12:25:35 +02:00
<% if (showLink) { %>
</a>
<% } %>
2014-09-24 23:24:51 +02:00
2015-06-28 12:25:35 +02:00
uploaded
<%= util.formatRelativeTime(post.creationTime) %>
2015-06-28 12:25:35 +02:00
by
<% showUser(post.user.name) %>
</span>
2014-09-24 23:24:51 +02:00
2015-06-28 12:25:35 +02:00
<span class="right">
featured
<%= util.formatRelativeTime(post.lastFeatureTime) %>
by
<% showUser(user.name) %>
</span>
2014-09-24 23:24:51 +02:00
2015-06-28 12:25:35 +02:00
</div>
</div>
<% } %>
2015-06-28 12:25:35 +02:00
<p>
<small class="version">
Version: <a href="//github.com/rr-/szurubooru/commits/master"><%= version %></a> (built <%= util.formatRelativeTime(buildTime) %>)
|
<a href="#/history">Recent tag and post edits</a>
</small>
</p>
2014-09-24 23:24:51 +02:00
</div>