Use conditional to simplify some other HTML templates.
This commit is contained in:
parent
bf34d8cacb
commit
b2659b91dd
@ -131,7 +131,7 @@ ThreadHiding =
|
||||
a = $.el 'a',
|
||||
className: "#{type}-thread-button"
|
||||
href: 'javascript:;'
|
||||
$.extend a, <%= html('<span class="fa fa-${(type === "hide") ? "minus" : "plus"}-square"></span>') %>
|
||||
$.extend a, <%= html('<span class="fa fa-?{type === "hide"}{minus}{plus}-square"></span>') %>
|
||||
a.dataset.fullID = thread.fullID
|
||||
$.on a, 'click', ThreadHiding.toggle
|
||||
a
|
||||
|
||||
@ -2,14 +2,14 @@ ThreadStats =
|
||||
init: ->
|
||||
return if g.VIEW isnt 'thread' or !Conf['Thread Stats']
|
||||
|
||||
statsHTML = <%= html('<span id="post-count">?</span> / <span id="file-count">?</span>') %>
|
||||
statsHTML = <%= html(
|
||||
'<span id="post-count">?</span> / <span id="file-count">?</span>' +
|
||||
'?{Conf["IP Count in Stats"]}{ / <span id="ip-count">?</span>}' +
|
||||
'?{Conf["Page Count in Stats"]}{ / <span id="page-count">?</span>}'
|
||||
) %>
|
||||
statsTitle = 'Posts / Files'
|
||||
if Conf['IP Count in Stats']
|
||||
statsHTML = <%= html('&{statsHTML} / <span id="ip-count">?</span>') %>
|
||||
statsTitle += ' / IPs'
|
||||
if Conf['Page Count in Stats']
|
||||
statsHTML = <%= html('&{statsHTML} / <span id="page-count">?</span>') %>
|
||||
statsTitle += ' / Page'
|
||||
statsTitle += ' / IPs' if Conf['IP Count in Stats']
|
||||
statsTitle += ' / Page' if Conf['Page Count in Stats']
|
||||
|
||||
if Conf['Updater and Stats in Header']
|
||||
@dialog = sc = $.el 'span',
|
||||
|
||||
@ -48,7 +48,7 @@ QR =
|
||||
|
||||
link = $.el 'h1',
|
||||
className: "qr-link-container"
|
||||
$.extend link, <%= html('<a href="javascript:;" class="qr-link">${(g.VIEW === "thread") ? "Reply to Thread" : "Start a Thread"}</a>') %>
|
||||
$.extend link, <%= html('<a href="javascript:;" class="qr-link">?{g.VIEW === "thread"}{Reply to Thread}{Start a Thread}</a>') %>
|
||||
|
||||
QR.link = link.firstElementChild
|
||||
$.on link.firstChild, 'click', ->
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user