Add isReply property.

This commit is contained in:
ccd0 2015-04-25 11:22:15 -07:00
parent 4a7d238ea9
commit a8c544c862
4 changed files with 9 additions and 8 deletions

View File

@ -38,6 +38,7 @@ Build =
postID: data.no postID: data.no
threadID: data.resto or data.no threadID: data.resto or data.no
boardID: boardID boardID: boardID
isReply: !!data.resto
# thread status # thread status
isSticky: !!data.sticky isSticky: !!data.sticky
isClosed: !!data.closed isClosed: !!data.closed
@ -98,7 +99,6 @@ Build =
### ###
{postID, threadID, boardID, file} = o {postID, threadID, boardID, file} = o
{subject, email, name, tripcode, capcode, uniqueID, flagCode, flag, dateUTC, dateText, commentHTML} = o.info {subject, email, name, tripcode, capcode, uniqueID, flagCode, flag, dateUTC, dateText, commentHTML} = o.info
isOP = postID is threadID
{staticPath, gifIcon} = Build {staticPath, gifIcon} = Build
### Post Info ### ### Post Info ###
@ -134,7 +134,7 @@ Build =
### Whole Post ### ### Whole Post ###
postClass = if isOP then 'op' else 'reply' postClass = if o.isReply then 'reply' else 'op'
wholePost = <%= importHTML('Build/Post') %> wholePost = <%= importHTML('Build/Post') %>

View File

@ -1,5 +1,5 @@
?{!isOP}{<div class="sideArrows" id="sa${postID}">&gt;&gt;</div>} ?{o.isReply}{<div class="sideArrows" id="sa${postID}">&gt;&gt;</div>}
<div id="p${postID}" class="post ${postClass}?{o.capcodeHighlight}{ highlightPost}"> <div id="p${postID}" class="post ${postClass}?{o.capcodeHighlight}{ highlightPost}">
?{isOP}{&{fileBlock}&{postInfo}}{&{postInfo}&{fileBlock}} ?{o.isReply}{&{postInfo}&{fileBlock}}{&{fileBlock}&{postInfo}}
<blockquote class="postMessage" id="m${postID}">&{commentHTML}</blockquote> <blockquote class="postMessage" id="m${postID}">&{commentHTML}</blockquote>
</div> </div>

View File

@ -1,24 +1,24 @@
<div class="postInfo desktop" id="pi${postID}"> <div class="postInfo desktop" id="pi${postID}">
<input type="checkbox" name="${postID}" value="delete"> <input type="checkbox" name="${postID}" value="delete">
?{isOP || boardID === "f" || subject}{<span class="subject">${subject || ""}</span> } ?{!o.isReply || boardID === "f" || subject}{<span class="subject">${subject || ""}</span> }
<span class="nameBlock?{capcode}{ capcode${capcodeUC}}"> <span class="nameBlock?{capcode}{ capcode${capcodeUC}}">
?{email}{<a href="mailto:${encodeURIComponent(email).replace(/%40/g, "@")}" class="useremail">} ?{email}{<a href="mailto:${encodeURIComponent(email).replace(/%40/g, "@")}" class="useremail">}
<span class="name?{capcode}{ capcode}">${name}</span> <span class="name?{capcode}{ capcode}">${name}</span>
?{tripcode}{ <span class="postertrip">${tripcode}</span>} ?{tripcode}{ <span class="postertrip">${tripcode}</span>}
?{capcode}{ <strong class="capcode hand id_${capcodeLC}" title="Highlight posts by ${capcodePlural}">## ${capcode}</strong>} ?{capcode}{ <strong class="capcode hand id_${capcodeLC}" title="Highlight posts by ${capcodePlural}">## ${capcode}</strong>}
?{email}{</a>} ?{email}{</a>}
?{boardID === "f" && isOP || capcode}{}{ } ?{boardID === "f" && !o.isReply || capcode}{}{ }
?{capcode}{ <img src="${staticPath}${capcodeLC}icon${gifIcon}" alt="${capcodeUC} Icon" title="This user is ${capcodeDescription}." class="identityIcon retina">} ?{capcode}{ <img src="${staticPath}${capcodeLC}icon${gifIcon}" alt="${capcodeUC} Icon" title="This user is ${capcodeDescription}." class="identityIcon retina">}
?{uniqueID && !capcode}{ <span class="posteruid id_${uniqueID}">(ID: <span class="hand" title="Highlight posts by this ID">${uniqueID}</span>)</span>} ?{uniqueID && !capcode}{ <span class="posteruid id_${uniqueID}">(ID: <span class="hand" title="Highlight posts by this ID">${uniqueID}</span>)</span>}
?{flagCode}{ <span title="${flag}" class="flag flag-${flagCode.toLowerCase()}"></span>} ?{flagCode}{ <span title="${flag}" class="flag flag-${flagCode.toLowerCase()}"></span>}
</span> </span>
<span class="dateTime" data-utc="${dateUTC}">${dateText}</span> <span class="dateTime" data-utc="${dateUTC}">${dateText}</span>
<span class="postNum?{!(boardID === "f" && isOP)}{ desktop}"> <span class="postNum?{!(boardID === "f" && !o.isReply)}{ desktop}">
<a href="${postLink}" title="Link to this post">No.</a> <a href="${postLink}" title="Link to this post">No.</a>
<a href="${quoteLink}" title="Reply to this post">${postID}</a> <a href="${quoteLink}" title="Reply to this post">${postID}</a>
?{o.isSticky}{ <img src="${staticPath}sticky${gifIcon}" alt="Sticky" title="Sticky" class="stickyIcon retina">} ?{o.isSticky}{ <img src="${staticPath}sticky${gifIcon}" alt="Sticky" title="Sticky" class="stickyIcon retina">}
?{o.isClosed && !o.isArchived}{ <img src="${staticPath}closed${gifIcon}" alt="Closed" title="Closed" class="closedIcon retina">} ?{o.isClosed && !o.isArchived}{ <img src="${staticPath}closed${gifIcon}" alt="Closed" title="Closed" class="closedIcon retina">}
?{o.isArchived}{ <img src="${staticPath}archived${gifIcon}" alt="Archived" title="Archived" class="archivedIcon retina">} ?{o.isArchived}{ <img src="${staticPath}archived${gifIcon}" alt="Archived" title="Archived" class="archivedIcon retina">}
?{isOP && g.VIEW === "index"}{ &nbsp; <span>[<a href="/${boardID}/thread/${threadID}" class="replylink">Reply</a>]</span>} ?{!o.isReply && g.VIEW === "index"}{ &nbsp; <span>[<a href="/${boardID}/thread/${threadID}" class="replylink">Reply</a>]</span>}
</span> </span>
</div> </div>

View File

@ -129,6 +129,7 @@ class Fetcher
postID: @postID postID: @postID
threadID: @threadID threadID: @threadID
boardID: @boardID boardID: @boardID
isReply: @postID isnt @threadID
o.info = o.info =
subject: data.title subject: data.title
email: data.email email: data.email