Merge pull request #642 from po5/better-links
This commit is contained in:
commit
93fc15f2a4
3 changed files with 12 additions and 11 deletions
|
@ -21,10 +21,11 @@
|
||||||
.details
|
.details
|
||||||
font-size: 90%
|
font-size: 90%
|
||||||
line-height: 130%
|
line-height: 130%
|
||||||
|
.image
|
||||||
|
margin: 0.25em 0.6em 0.25em 0
|
||||||
.thumbnail
|
.thumbnail
|
||||||
width: 3em
|
width: 3em
|
||||||
height: 3em
|
height: 3em
|
||||||
margin: 0.25em 0.6em 0 0
|
|
||||||
|
|
||||||
.darktheme .user-list
|
.darktheme .user-list
|
||||||
ul li
|
ul li
|
||||||
|
|
|
@ -17,8 +17,8 @@
|
||||||
'video/mp4': 'MPEG-4',
|
'video/mp4': 'MPEG-4',
|
||||||
'video/quicktime': 'MOV',
|
'video/quicktime': 'MOV',
|
||||||
'application/x-shockwave-flash': 'SWF',
|
'application/x-shockwave-flash': 'SWF',
|
||||||
}[ctx.post.mimeType] %>
|
}[ctx.post.mimeType] %><!--
|
||||||
</a>
|
--></a>
|
||||||
(<%- ctx.post.canvasWidth %>x<%- ctx.post.canvasHeight %>)
|
(<%- ctx.post.canvasWidth %>x<%- ctx.post.canvasHeight %>)
|
||||||
<% if (ctx.post.flags.length) { %><!--
|
<% if (ctx.post.flags.length) { %><!--
|
||||||
--><% if (ctx.post.flags.includes('loop')) { %><i class='fa fa-repeat'></i><% } %><!--
|
--><% if (ctx.post.flags.includes('loop')) { %><i class='fa fa-repeat'></i><% } %><!--
|
||||||
|
@ -99,10 +99,10 @@
|
||||||
--><% if (ctx.canListPosts) { %><!--
|
--><% if (ctx.canListPosts) { %><!--
|
||||||
--><a href='<%- ctx.formatClientLink('posts', {query: ctx.escapeTagName(tag.names[0])}) %>' class='<%= ctx.makeCssName(tag.category, 'tag') %>'><!--
|
--><a href='<%- ctx.formatClientLink('posts', {query: ctx.escapeTagName(tag.names[0])}) %>' class='<%= ctx.makeCssName(tag.category, 'tag') %>'><!--
|
||||||
--><% } %><!--
|
--><% } %><!--
|
||||||
--><%- ctx.getPrettyName(tag.names[0]) %> <!--
|
--><%- ctx.getPrettyName(tag.names[0]) %><!--
|
||||||
--><% if (ctx.canListPosts) { %><!--
|
--><% if (ctx.canListPosts) { %><!--
|
||||||
--></a><!--
|
--></a><!--
|
||||||
--><% } %><!--
|
--><% } %> <!--
|
||||||
--><span class='tag-usages' data-pseudo-content='<%- tag.postCount %>'></span><!--
|
--><span class='tag-usages' data-pseudo-content='<%- tag.postCount %>'></span><!--
|
||||||
--></li><!--
|
--></li><!--
|
||||||
--><% } %><!--
|
--><% } %><!--
|
||||||
|
|
|
@ -209,13 +209,13 @@ function makePostLink(id, includeHash) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function makeTagLink(name, includeHash, includeCount, tag) {
|
function makeTagLink(name, includeHash, includeCount, tag) {
|
||||||
const category = tag ? tag.category : "unknown";
|
const category = tag && tag.category ? tag.category : "unknown";
|
||||||
let text = misc.getPrettyName(name);
|
let text = misc.getPrettyName(name);
|
||||||
if (includeHash === true) {
|
if (includeHash === true) {
|
||||||
text = "#" + text;
|
text = "#" + text;
|
||||||
}
|
}
|
||||||
if (includeCount === true) {
|
if (includeCount === true) {
|
||||||
text += " (" + (tag ? tag.postCount : 0) + ")";
|
text += " (" + (tag && tag.postCount ? tag.postCount : 0) + ")";
|
||||||
}
|
}
|
||||||
return api.hasPrivilege("tags:view")
|
return api.hasPrivilege("tags:view")
|
||||||
? makeElement(
|
? makeElement(
|
||||||
|
@ -234,15 +234,15 @@ function makeTagLink(name, includeHash, includeCount, tag) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function makePoolLink(id, includeHash, includeCount, pool, name) {
|
function makePoolLink(id, includeHash, includeCount, pool, name) {
|
||||||
const category = pool ? pool.category : "unknown";
|
const category = pool && pool.category ? pool.category : "unknown";
|
||||||
let text = misc.getPrettyName(
|
let text = misc.getPrettyName(
|
||||||
name ? name : pool ? pool.names[0] : "unknown"
|
name ? name : pool && pool.names ? pool.names[0] : "pool " + id
|
||||||
);
|
);
|
||||||
if (includeHash === true) {
|
if (includeHash === true) {
|
||||||
text = "#" + text;
|
text = "#" + text;
|
||||||
}
|
}
|
||||||
if (includeCount === true) {
|
if (includeCount === true) {
|
||||||
text += " (" + (pool ? pool.postCount : 0) + ")";
|
text += " (" + (pool && pool.postCount ? pool.postCount : 0) + ")";
|
||||||
}
|
}
|
||||||
return api.hasPrivilege("pools:view")
|
return api.hasPrivilege("pools:view")
|
||||||
? makeElement(
|
? makeElement(
|
||||||
|
@ -264,7 +264,7 @@ function makeUserLink(user) {
|
||||||
let text = makeThumbnail(user ? user.avatarUrl : null);
|
let text = makeThumbnail(user ? user.avatarUrl : null);
|
||||||
text += user && user.name ? misc.escapeHtml(user.name) : "Anonymous";
|
text += user && user.name ? misc.escapeHtml(user.name) : "Anonymous";
|
||||||
const link =
|
const link =
|
||||||
user && api.hasPrivilege("users:view")
|
user && user.name && api.hasPrivilege("users:view")
|
||||||
? makeElement(
|
? makeElement(
|
||||||
"a",
|
"a",
|
||||||
{ href: uri.formatClientLink("user", user.name) },
|
{ href: uri.formatClientLink("user", user.name) },
|
||||||
|
|
Loading…
Reference in a new issue