From 0aad36228a4860a21d665764c2eb3ffe09afee38 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Fri, 13 Mar 2015 21:00:09 +0100 Subject: [PATCH] Added featured post uploader name to home page --- public_html/css/home.css | 2 +- public_html/templates/home.tpl | 37 +++++++++++++++++++--------------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/public_html/css/home.css b/public_html/css/home.css index 46eb93e2..702aa4a7 100644 --- a/public_html/css/home.css +++ b/public_html/css/home.css @@ -14,7 +14,7 @@ margin: 0 auto; display: inline-block; max-width: 60%; - min-width: 32em; + min-width: 40em; } #home .post .left { display: inline-block; diff --git a/public_html/templates/home.tpl b/public_html/templates/home.tpl index 9f8238fe..0c6ef50e 100644 --- a/public_html/templates/home.tpl +++ b/public_html/templates/home.tpl @@ -1,3 +1,21 @@ +<% function showUser(name) { %> + <% var showLink = canViewUsers && name %> + + <% if (showLink) { %> + + <% } %> + + <%= name || 'Anonymous user' %> + + <%= name || 'Anonymous user' %> + + <% if (showLink) { %> + + <% } %> +<% } %> +

<%= title %>

@@ -26,28 +44,15 @@ uploaded <%= util.formatRelativeTime(post.uploadTime) %> + by + <% showUser(post.user.name) %> featured <%= util.formatRelativeTime(post.lastFeatureTime) %> by - - <% var showLink = canViewUsers && user.name %> - - <% if (showLink) { %> - - <% } %> - - <%= user.name || 'Anonymous user' %> - - <%= user.name || 'Anonymous user' %> - - <% if (showLink) { %> - - <% } %> + <% showUser(user.name) %>