diff --git a/frontend/app.js b/frontend/app.js old mode 100755 new mode 100644 index 490729e..70527aa --- a/frontend/app.js +++ b/frontend/app.js @@ -340,9 +340,9 @@ function renderDetail(p) { '

' + escapeHtml(s.headline) + '

' + escapeHtml(s.description || '') + '

'; }).join(''); const forkNotice = (p.forked_from && p.forked_from !== 'null') ? '
forked from: ' + p.forked_from + '
' : ''; - const sourceLine = p.source ? 'SOURCE: ' + escapeHtml(p.source) : ''; + const sourceLine = (p.source && p.source !== '@' + (p.author || '')) ? 'SOURCE: ' + escapeHtml(p.source) : ''; var sourceLink = p.source_url ? ' · view_original' : ''; - var authorLine = p.author ? ' · authored by @' + escapeHtml(p.author) + '' : ''; + var authorLine = p.author ? (sourceLine ? ' · ' : '') + 'authored by @' + escapeHtml(p.author) + '' : ''; var dateLine = p.created_at ? ' · added ' + formatDate(p.created_at) : ''; return '
' + tags + '
' + @@ -742,8 +742,8 @@ async function showCollectionDetail(slug) { } } } - var sourceLine = c.source ? 'SOURCE: ' + escapeHtml(c.source) : ''; - var authorLine = c.author ? ' · authored by @' + escapeHtml(c.author) + '' : ''; + var sourceLine = (c.source && c.source !== '@' + (c.author || '')) ? 'SOURCE: ' + escapeHtml(c.source) : ''; + var authorLine = c.author ? (sourceLine ? ' · ' : '') + 'curated by @' + escapeHtml(c.author) + '' : ''; var dateLine = c.created_at ? ' · added ' + formatDate(c.created_at) : ''; document.getElementById('collectionDetailContent').innerHTML =