Use new templating in catalog.
This commit is contained in:
parent
6e1d89e187
commit
20b5dac267
@ -198,36 +198,16 @@ Build =
|
|||||||
src = "#{staticPath}nofile.png"
|
src = "#{staticPath}nofile.png"
|
||||||
imgClass = 'no-file'
|
imgClass = 'no-file'
|
||||||
|
|
||||||
thumb = if imgClass
|
|
||||||
<%= html('<img src="${src}" class="catalog-thumb ${imgClass}">') %>
|
|
||||||
else
|
|
||||||
<%= html('<img src="${src}" class="catalog-thumb" data-width="${data.tn_w}" data-height="${data.tn_h}">') %>
|
|
||||||
|
|
||||||
postCount = data.replies + 1
|
postCount = data.replies + 1
|
||||||
fileCount = data.images + !!data.ext
|
fileCount = data.images + !!data.ext
|
||||||
pageCount = Index.liveThreadIDs.indexOf(thread.ID) // Index.threadsNumPerPage + 1
|
pageCount = Index.liveThreadIDs.indexOf(thread.ID) // Index.threadsNumPerPage + 1
|
||||||
|
|
||||||
subject = if thread.OP.info.subject
|
|
||||||
<%= html('<div class="subject">${thread.OP.info.subject}</div>') %>
|
|
||||||
else
|
|
||||||
<%= html('') %>
|
|
||||||
|
|
||||||
comment = innerHTML: data.com or ''
|
comment = innerHTML: data.com or ''
|
||||||
|
|
||||||
root = $.el 'div',
|
root = $.el 'div',
|
||||||
className: 'catalog-thread'
|
className: 'catalog-thread'
|
||||||
|
|
||||||
$.extend root, <%= html(
|
$.extend root, <%= importHTML('Build/CatalogThread') %>
|
||||||
'<a href="/${thread.board}/thread/${thread.ID}">' +
|
|
||||||
'&{thumb}' +
|
|
||||||
'</a>' +
|
|
||||||
'<div class="catalog-stats" title="Post count / File count / Page count">' +
|
|
||||||
'<span class="post-count">${postCount}</span> / <span class="file-count">${fileCount}</span> / <span class="page-count">${pageCount}</span>' +
|
|
||||||
'<span class="catalog-icons"></span>' +
|
|
||||||
'</div>' +
|
|
||||||
'&{subject}' +
|
|
||||||
'<div class="comment">&{comment}</div>'
|
|
||||||
) %>
|
|
||||||
|
|
||||||
root.dataset.fullID = thread.fullID
|
root.dataset.fullID = thread.fullID
|
||||||
$.addClass root, thread.OP.highlights... if thread.OP.highlights
|
$.addClass root, thread.OP.highlights... if thread.OP.highlights
|
||||||
|
|||||||
9
src/General/html/Build/CatalogThread.html
Normal file
9
src/General/html/Build/CatalogThread.html
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<a href="/${thread.board}/thread/${thread.ID}">
|
||||||
|
<img src="${src}"?{imgClass}{ class="catalog-thumb ${imgClass}"}{ class="catalog-thumb" data-width="${data.tn_w}" data-height="${data.tn_h}"}>
|
||||||
|
</a>
|
||||||
|
<div class="catalog-stats" title="Post count / File count / Page count">
|
||||||
|
<span class="post-count">${postCount}</span> / <span class="file-count">${fileCount}</span> / <span class="page-count">${pageCount}</span>
|
||||||
|
<span class="catalog-icons"></span>
|
||||||
|
</div>
|
||||||
|
?{thread.OP.info.subject}{<div class="subject">${thread.OP.info.subject}</div>}
|
||||||
|
<div class="comment">&{comment}</div>
|
||||||
Loading…
x
Reference in New Issue
Block a user