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',
|
a = $.el 'a',
|
||||||
className: "#{type}-thread-button"
|
className: "#{type}-thread-button"
|
||||||
href: 'javascript:;'
|
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
|
a.dataset.fullID = thread.fullID
|
||||||
$.on a, 'click', ThreadHiding.toggle
|
$.on a, 'click', ThreadHiding.toggle
|
||||||
a
|
a
|
||||||
|
|||||||
@ -2,14 +2,14 @@ ThreadStats =
|
|||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW isnt 'thread' or !Conf['Thread Stats']
|
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'
|
statsTitle = 'Posts / Files'
|
||||||
if Conf['IP Count in Stats']
|
statsTitle += ' / IPs' if Conf['IP Count in Stats']
|
||||||
statsHTML = <%= html('&{statsHTML} / <span id="ip-count">?</span>') %>
|
statsTitle += ' / Page' if Conf['Page Count in Stats']
|
||||||
statsTitle += ' / IPs'
|
|
||||||
if Conf['Page Count in Stats']
|
|
||||||
statsHTML = <%= html('&{statsHTML} / <span id="page-count">?</span>') %>
|
|
||||||
statsTitle += ' / Page'
|
|
||||||
|
|
||||||
if Conf['Updater and Stats in Header']
|
if Conf['Updater and Stats in Header']
|
||||||
@dialog = sc = $.el 'span',
|
@dialog = sc = $.el 'span',
|
||||||
|
|||||||
@ -48,7 +48,7 @@ QR =
|
|||||||
|
|
||||||
link = $.el 'h1',
|
link = $.el 'h1',
|
||||||
className: "qr-link-container"
|
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
|
QR.link = link.firstElementChild
|
||||||
$.on link.firstChild, 'click', ->
|
$.on link.firstChild, 'click', ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user