Skip to content

Speakr is a personal, self-hosted web application designed for transcribing audio recordings

Python

Shared Transcripts tab: one row per entry on wide screens (#416)

Murtaza Nasir2aedb034c16b
diff --git a/templates/account.html b/templates/account.html
index a01d42f0..d18e4c75 100644
--- a/templates/account.html
+++ b/templates/account.html
@@ -4128,9 +4128,10 @@ curl "https://your-speakr-instance.com/api/recordings?token=YOUR_TOKEN_HERE"</co
if (!(overview.shared_by_me || []).length) empty(peopleSection, t('sharedTranscripts.noInternalShares'));
(overview.shared_by_me || []).forEach(entry => {
const card = document.createElement('div');
- card.className = 'bg-[var(--bg-tertiary)] p-4 rounded-lg border border-[var(--border-primary)]';
- card.innerHTML = `<a href="/recordings/${entry.recording_id}" dir="auto" class="font-semibold hover:underline">${escapeHtml(entry.recording_title)}</a>
- <ul class="mt-2 divide-y divide-[var(--border-primary)]">${entry.recipients.map(p => `
+ // Wide screens: the recording on the left, its people on the right.
+ card.className = 'bg-[var(--bg-tertiary)] px-4 py-3 rounded-lg border border-[var(--border-primary)] lg:grid lg:grid-cols-[minmax(0,3fr)_minmax(0,2fr)] lg:gap-x-6 lg:items-start';
+ card.innerHTML = `<a href="/recordings/${entry.recording_id}" dir="auto" class="font-semibold hover:underline block truncate lg:py-2" title="${escapeHtml(entry.recording_title)}">${escapeHtml(entry.recording_title)}</a>
+ <ul class="mt-2 lg:mt-0 divide-y divide-[var(--border-primary)]">${entry.recipients.map(p => `
<li class="py-2 flex items-center justify-between gap-3">
<div class="min-w-0"><p class="text-sm font-medium">${escapeHtml(p.username || '')}</p>
<p class="text-xs text-[var(--text-muted)]">${escapeHtml(permissions(p))}</p></div>
@@ -4145,7 +4146,7 @@ curl "https://your-speakr-instance.com/api/recordings?token=YOUR_TOKEN_HERE"</co
if (!(overview.shared_with_me || []).length) empty(withMeSection, t('sharedTranscripts.nothingSharedWithMe'));
(overview.shared_with_me || []).forEach(item => {
const row = document.createElement('div');
- row.className = 'bg-[var(--bg-tertiary)] p-3 rounded-lg border border-[var(--border-primary)] flex items-center justify-between gap-3';
+ row.className = 'bg-[var(--bg-tertiary)] px-4 py-3 rounded-lg border border-[var(--border-primary)] flex items-center justify-between gap-3';
const from = item.owner_username ? t('sharedTranscripts.fromOwner', { name: item.owner_username }) + ' · ' : '';
row.innerHTML = `<div class="min-w-0"><a href="/recordings/${item.recording_id}" dir="auto" class="font-semibold hover:underline">${escapeHtml(item.recording_title)}</a>
<p class="text-xs text-[var(--text-muted)]">${escapeHtml(from + permissions(item))} · ${formatInstant(item.created_at)}</p></div>`;
@@ -4159,16 +4160,15 @@ curl "https://your-speakr-instance.com/api/recordings?token=YOUR_TOKEN_HERE"</co
shares.forEach(share => {
const shareEl = document.createElement('div');
- shareEl.className = 'bg-[var(--bg-tertiary)] p-4 rounded-lg border border-[var(--border-primary)]';
+ // One row per link on wide screens: title and date, the
+ // two toggles, the link, delete. Stacked when narrow.
+ shareEl.className = 'bg-[var(--bg-tertiary)] px-4 py-3 rounded-lg border border-[var(--border-primary)] grid grid-cols-[minmax(0,1fr)_auto] gap-x-4 gap-y-3 items-center lg:grid-cols-[minmax(0,3fr)_auto_minmax(0,2fr)_auto]';
shareEl.innerHTML = `
- <div class="flex justify-between items-start">
- <div>
- <p class="font-semibold">${escapeHtml(share.recording_title)}</p>
- <p class="text-sm text-[var(--text-muted)]">${t('sharedTranscripts.sharedOn')}: ${formatInstant(share.created_at)}</p>
- </div>
- <button data-share-id="${share.id}" class="delete-share-btn text-[var(--text-danger)] hover:opacity-80 p-1"><i class="fas fa-trash"></i></button>
+ <div class="min-w-0 order-1">
+ <a href="/recordings/${share.recording_id}" dir="auto" class="font-semibold hover:underline block truncate" title="${escapeHtml(share.recording_title)}">${escapeHtml(share.recording_title)}</a>
+ <p class="text-sm text-[var(--text-muted)]">${t('sharedTranscripts.sharedOn')}: ${formatInstant(share.created_at)}</p>
</div>
- <div class="mt-4 flex items-center gap-4">
+ <div class="order-3 col-span-2 lg:order-2 lg:col-span-1 flex items-center gap-4 whitespace-nowrap">
<label class="flex items-center text-sm">
<input type="checkbox" data-share-id="${share.id}" data-share-prop="share_summary" class="share-checkbox h-4 w-4 rounded border-[var(--border-secondary)] text-[var(--text-accent)] focus:ring-[var(--border-focus)]" ${share.share_summary ? 'checked' : ''}>
<span class="ml-2">${t('sharedTranscripts.shareSummary')}</span>
@@ -4178,12 +4178,13 @@ curl "https://your-speakr-instance.com/api/recordings?token=YOUR_TOKEN_HERE"</co
<span class="ml-2">${t('sharedTranscripts.shareNotes')}</span>
</label>
</div>
- <div class="mt-4 relative">
+ <div class="order-4 col-span-2 lg:order-3 lg:col-span-1 relative min-w-0">
<input value="{{ request.url_root }}share/${share.public_id}" readonly class="share-link-input w-full px-3 py-2 pr-12 bg-[var(--bg-input)] border border-[var(--border-secondary)] rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-[var(--border-accent)]">
<button class="copy-share-link-btn absolute right-1.5 top-1/2 -translate-y-1/2 w-7 h-7 flex items-center justify-center rounded bg-[var(--bg-button)] text-[var(--text-button)] hover:bg-[var(--bg-button-hover)] transition-colors" title="${t('buttons.copy')}">
<i class="fas fa-copy text-xs"></i>
</button>
</div>
+ <button data-share-id="${share.id}" class="delete-share-btn order-2 lg:order-4 justify-self-end text-[var(--text-danger)] hover:opacity-80 p-1" title="${t('buttons.delete')}"><i class="fas fa-trash"></i></button>
`;
publicSection.appendChild(shareEl);
});