diff --git a/app/static/app.css b/app/static/app.css index 2fcad39..9376299 100644 --- a/app/static/app.css +++ b/app/static/app.css @@ -763,6 +763,9 @@ body[data-reader="open"] .row[data-open="true"] { } .meta .badge.closed, .reader-meta .badge.closed { color: var(--error); border-color: var(--error); } .meta .gated { color: var(--error); } +/* How many postings a row stands for (roles.js `dupes`), newsdesk's "+N more + outlets": beside the company and in the accent, not a badge. */ +.dupes { color: var(--accent); white-space: nowrap; } .excerpt { font-family: var(--read); @@ -928,6 +931,20 @@ body[data-reader="open"] .company-strip { display: none; } } .prose p { margin: 0 0 1.05rem; } .reader-out { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); } +.reader-note a { color: var(--accent); } +.reader-copy { margin-top: .8rem; } +/* The other postings of the role (roles.js `alsoPosted`), newsdesk's "Also + covered by": the host over the place, one link each. */ +.also { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); } +.also a { + display: block; margin-bottom: .55rem; + color: var(--dim); font-size: .92rem; text-decoration: none; + line-height: 1.4; +} +.also a b { display: block; color: var(--faint); font-size: .78rem; font-weight: 600; } +@media (hover: hover) { + .also a:hover { color: var(--fg); } +} /* The step through the list, for the pointer that has no `j` and `k`. At the foot of the pane because that is where a thumb already is. Shown only by diff --git a/app/static/roles.js b/app/static/roles.js index 3040f1f..635c057 100644 --- a/app/static/roles.js +++ b/app/static/roles.js @@ -860,6 +860,31 @@ + words.map((w) => `${esc(w)}`).join(""); } + /* How many postings the row stands for, when a board or another host + lists the same role more than once (`dupes`); the reader lists them. */ + function dupes(role) { + const n = (role.copies || 0) + 1; + return n > 1 ? `×${n}` : ""; + } + + /* The other postings of this role, each a link to where it is posted, + labelled by host and place, as newsdesk's "Also covered by". */ + function alsoPosted(r) { + const copies = (Array.isArray(r.copies) ? r.copies : []) + .filter((c) => safeUrl(c.original_url)); + if (!copies.length) return ""; + return `
+

Also posted

+ ${copies.map((c) => { + const url = safeUrl(c.original_url); + const when = c.posted_at ? ago(c.posted_at) : ""; + return ` + ${esc(c.host || host(url))} + ${esc([c.place, when].filter(Boolean).join(" · ") || host(url))} ↗`; + }).join("")} +
`; + } + function drawRow(el, role) { const scored = role.score !== null && role.score !== undefined; const pct = scored ? Math.round(Math.min(1, Math.max(0, role.score)) * 100) : 0; @@ -871,6 +896,7 @@ ${esc(role.title || "(untitled)")}
${role.company ? companyName(role) : ""} + ${dupes(role)} ${role.place ? `${esc(role.place)}` : ""} ${badges(role)} ${ago(role.posted_at)} @@ -1244,6 +1270,8 @@ ${tagChips(r.tags)}

${esc(r.title || "")}

+ ${loaded && r.dup_of ? `

A copy of + a posting the feed lists once.

` : ""} ${pay ? `

${esc(pay.range)}

${pay.detail ? `

${esc(pay.detail)}

` : ""} ${pay.note ? `

${esc(pay.note)}

` : ""}` : ""} @@ -1259,6 +1287,7 @@
${body}
${out ? `

Read it on ${esc(host(out) || "the board")} ↗

` : ""} + ${loaded ? alsoPosted(r) : ""}
@@ -1280,6 +1309,11 @@ el.querySelector('[data-tool="fetch"]')?.addEventListener("click", (e) => fetchText(e.currentTarget)); el.querySelector(".reader-out a")?.addEventListener("click", () => markRead(r.uid)); + el.querySelector(".reader-copy a")?.addEventListener("click", (e) => { + if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button !== 0) return; + e.preventDefault(); + openReader(r.dup_of); + }); el.querySelector(".reader-body").scrollTop = scrolled; }