mirror of
https://codeberg.org/tacerus/teddit.git
synced 2024-11-26 09:09:27 +01:00
add * for comments which are edited, like in reddit
This commit is contained in:
parent
ad125a592b
commit
b8a819cfa4
@ -8,6 +8,7 @@ module.exports = function() {
|
|||||||
let submitter_link = ''
|
let submitter_link = ''
|
||||||
let moderator = false
|
let moderator = false
|
||||||
let submitter = false
|
let submitter = false
|
||||||
|
let edited_span = ''
|
||||||
|
|
||||||
if(post_author === comments.author) {
|
if(post_author === comments.author) {
|
||||||
classlist.push('submitter')
|
classlist.push('submitter')
|
||||||
@ -24,20 +25,23 @@ module.exports = function() {
|
|||||||
} else {
|
} else {
|
||||||
ups = `${kFormatter(comments.ups)} points`
|
ups = `${kFormatter(comments.ups)} points`
|
||||||
}
|
}
|
||||||
|
if(comments.edited) {
|
||||||
|
edited_span = `<span title="this comment is edited">*</span>`
|
||||||
|
}
|
||||||
comments_html = `
|
comments_html = `
|
||||||
<div class="comment" id="${comments.id}">
|
<div class="comment" id="${comments.id}">
|
||||||
<details open>
|
<details open>
|
||||||
<summary>
|
<summary>
|
||||||
<a href="/u/${comments.author}">${comments.author}${moderator ? moderator_badge : ''}</a>
|
<a href="/u/${comments.author}">${comments.author}${moderator ? moderator_badge : ''}</a>
|
||||||
<p class="ups">${ups}</p>
|
<p class="ups">${ups}</p>
|
||||||
<p class="created" title="${toUTCString(comments.created)}">${timeDifference(comments.created)}</p>
|
<p class="created" title="${toUTCString(comments.created)}">${timeDifference(comments.created)}${edited_span}</p>
|
||||||
<p class="stickied">${comments.stickied ? 'stickied comment' : ''}</p>
|
<p class="stickied">${comments.stickied ? 'stickied comment' : ''}</p>
|
||||||
</summary>
|
</summary>
|
||||||
<div class="meta">
|
<div class="meta">
|
||||||
<p class="author"><a href="/u/${comments.author}" class="${classlist.join(' ')}">${comments.author}</a>${submitter ? submitter_link : ''}${moderator ? moderator_badge : ''}</p>
|
<p class="author"><a href="/u/${comments.author}" class="${classlist.join(' ')}">${comments.author}</a>${submitter ? submitter_link : ''}${moderator ? moderator_badge : ''}</p>
|
||||||
<p class="ups">${ups}</p>
|
<p class="ups">${ups}</p>
|
||||||
<p class="created" title="${toUTCString(comments.created)}">
|
<p class="created" title="${toUTCString(comments.created)}">
|
||||||
<a href="${comments.permalink}">${timeDifference(comments.created)}</a>
|
<a href="${comments.permalink}">${timeDifference(comments.created)}${edited_span}</a>
|
||||||
</p>
|
</p>
|
||||||
<p class="stickied">${comments.stickied ? 'stickied comment' : ''}</p>
|
<p class="stickied">${comments.stickied ? 'stickied comment' : ''}</p>
|
||||||
</div>
|
</div>
|
||||||
@ -90,6 +94,7 @@ module.exports = function() {
|
|||||||
let moderator = false
|
let moderator = false
|
||||||
let submitter = false
|
let submitter = false
|
||||||
let ups = ''
|
let ups = ''
|
||||||
|
let edited_span = ''
|
||||||
|
|
||||||
if(post_author === comment.author) {
|
if(post_author === comment.author) {
|
||||||
classlist.push('submitter')
|
classlist.push('submitter')
|
||||||
@ -106,20 +111,23 @@ module.exports = function() {
|
|||||||
} else {
|
} else {
|
||||||
ups = `${kFormatter(comment.ups)} points`
|
ups = `${kFormatter(comment.ups)} points`
|
||||||
}
|
}
|
||||||
|
if(comment.edited) {
|
||||||
|
edited_span = `<span title="this comment is edited">*</span>`
|
||||||
|
}
|
||||||
comments_html += `
|
comments_html += `
|
||||||
<div class="comment" id="${comment.id}">
|
<div class="comment" id="${comment.id}">
|
||||||
<details open>
|
<details open>
|
||||||
<summary>
|
<summary>
|
||||||
<a href="/u/${comment.author}">${comment.author}${moderator ? moderator_badge : ''}</a>
|
<a href="/u/${comment.author}">${comment.author}${moderator ? moderator_badge : ''}</a>
|
||||||
<p class="ups">${ups}</p>
|
<p class="ups">${ups}</p>
|
||||||
<p class="created" title="${toUTCString(comment.created)}">${timeDifference(comment.created)}</p>
|
<p class="created" title="${toUTCString(comment.created)}">${timeDifference(comment.created)}${edited_span}</p>
|
||||||
<p class="stickied">${comment.stickied ? 'stickied comment' : ''}</p>
|
<p class="stickied">${comment.stickied ? 'stickied comment' : ''}</p>
|
||||||
</summary>
|
</summary>
|
||||||
<div class="meta">
|
<div class="meta">
|
||||||
<p class="author"><a href="/u/${comment.author}" class="${classlist.join(' ')}">${comment.author}</a>${submitter ? submitter_link : ''}${moderator ? moderator_badge : ''}</p>
|
<p class="author"><a href="/u/${comment.author}" class="${classlist.join(' ')}">${comment.author}</a>${submitter ? submitter_link : ''}${moderator ? moderator_badge : ''}</p>
|
||||||
<p class="ups">${ups}</p>
|
<p class="ups">${ups}</p>
|
||||||
<p class="created" title="${toUTCString(comment.created)}">
|
<p class="created" title="${toUTCString(comment.created)}">
|
||||||
<a href="${comment.permalink}">${timeDifference(comment.created)}</a>
|
<a href="${comment.permalink}">${timeDifference(comment.created)}${edited_span}</a>
|
||||||
</p>
|
</p>
|
||||||
<p class="stickied">${comment.stickied ? 'stickied comment' : ''}</p>
|
<p class="stickied">${comment.stickied ? 'stickied comment' : ''}</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -139,6 +139,7 @@ module.exports = function(fetch) {
|
|||||||
stickied: comment.stickied,
|
stickied: comment.stickied,
|
||||||
distinguished: comment.distinguished,
|
distinguished: comment.distinguished,
|
||||||
score_hidden: comment.score_hidden,
|
score_hidden: comment.score_hidden,
|
||||||
|
edited: comment.edited,
|
||||||
replies: []
|
replies: []
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -214,6 +215,7 @@ module.exports = function(fetch) {
|
|||||||
stickied: reply.stickied,
|
stickied: reply.stickied,
|
||||||
distinguished: reply.distinguished,
|
distinguished: reply.distinguished,
|
||||||
score_hidden: reply.score_hidden,
|
score_hidden: reply.score_hidden,
|
||||||
|
edited: reply.edited,
|
||||||
replies: []
|
replies: []
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -247,6 +249,7 @@ module.exports = function(fetch) {
|
|||||||
permalink: comment.permalink,
|
permalink: comment.permalink,
|
||||||
score_hidden: comment.score_hidden,
|
score_hidden: comment.score_hidden,
|
||||||
distinguished: comment.distinguished,
|
distinguished: comment.distinguished,
|
||||||
|
distinguished: comment.edited,
|
||||||
replies: []
|
replies: []
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user