From 7478031b14d02b5a3e245b72bd72d9d18840e7ae Mon Sep 17 00:00:00 2001 From: dev Date: Mon, 19 Oct 2026 14:39:20 +0300 Subject: [PATCH] feat(shorts): usage-chip shows usage date, author pill styled like fb-author --- public/js/shorts.js | 12 ++++++------ public/shorts.html | 3 +++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/public/js/shorts.js b/public/js/shorts.js index 39448b9..cddf659 100644 --- a/public/js/shorts.js +++ b/public/js/shorts.js @@ -282,18 +282,18 @@ function renderShortsList(items, deletedMode) { : delta < 0 ? '−1' : ''; const topic = s.topic ? `
${highlight(s.topic, term)}
` : ''; const author = s.author_name || s.author_username || ''; + const usageDate = s.used_at ? fmtDateOnlyIso(String(s.used_at).slice(0, 10)) : ''; const usage = s.used - ? `` + ? `` : ``; const actions = deletedMode ? (isAdmin() ? '' : '') : ''; - const meta = [ - author ? `Автор: ${esc(author)}` : '', - s.used_at ? `использовано ${esc(String(s.used_at).slice(0, 10))}` : '' - ].filter(Boolean).join(' · '); + const authorHtml = author + ? `${esc(author.charAt(0).toUpperCase())}${esc(author)}` + : ''; return `
${highlight(s.resident || '', term)} @@ -304,8 +304,8 @@ function renderShortsList(items, deletedMode) { ${topic}
${highlight(s.message || '', term)}
+ ${authorHtml} ${usage} - ${meta ? `${meta}` : ''}
`; }).join(''); diff --git a/public/shorts.html b/public/shorts.html index 3932727..6c2d25d 100644 --- a/public/shorts.html +++ b/public/shorts.html @@ -223,6 +223,9 @@ @keyframes shorts-skeleton { from { background-position:200% 0 } to { background-position:-200% 0 } } .shorts-author { display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end;align-self:flex-end;text-align:right } .shorts-author .icon-btn { width:26px;height:26px;border-radius:7px } +.shorts-author .lesson-author { display:inline-flex;align-items:center;gap:6px;min-width:0;font-size:.78rem;color:var(--muted);border:1px solid var(--border);border-radius:999px;background:rgba(127,127,127,.08);padding:2px 10px 2px 2px } +.shorts-author .lesson-author-name { overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:180px } +.shorts-author .lesson-author-av { flex:none;width:20px;height:20px;border-radius:50%;overflow:hidden;background:rgba(37,99,235,.12);color:var(--accent);display:flex;align-items:center;justify-content:center;font-size:.62rem;font-weight:700;user-select:none } .ai-btn { background:none;border:1px solid var(--border);border-radius:6px;padding:3px 9px;cursor:pointer;font-size:.76rem;color:var(--muted);display:inline-flex;align-items:center;gap:4px;margin-left:8px;vertical-align:1px } .ai-btn:hover { border-color:var(--accent);color:var(--accent) }