Speakr is a personal, self-hosted web application designed for transcribing audio recordings
Python
Group saved-template dropdown with initial prompt and hotwords in a bordered sub-card so it is clear the template fills both fields
Murtaza Nasir395a162e659b
diff --git a/static/locales/de.json b/static/locales/de.jsonindex e07bb086..6bdb21d2 100644--- a/static/locales/de.json+++ b/static/locales/de.json@@ -1615,7 +1615,8 @@"pickPlaceholder": "Gespeicherte Vorlage einfügen…","hotwords": "Hotwords","hotwordsHelp": "Optionale, durch Komma getrennte Wörter zur Verbesserung der Erkennung domänenspezifischer Begriffe.",- "savedTemplate": "Gespeicherte Vorlage"+ "savedTemplate": "Gespeicherte Vorlage",+ "savedTemplateHelp": "Füllt den Initial-Prompt und die Hotwords unten aus."},"detail": {"hints": "Hinweise",diff --git a/static/locales/en.json b/static/locales/en.jsonindex 9c850fdb..8a341e8d 100644--- a/static/locales/en.json+++ b/static/locales/en.json@@ -1624,7 +1624,8 @@"pickPlaceholder": "Insert a saved template…","hotwords": "Hotwords","hotwordsHelp": "Optional comma-separated words to bias recognition of domain-specific terms.",- "savedTemplate": "Saved template"+ "savedTemplate": "Saved template",+ "savedTemplateHelp": "Fills the initial prompt and hotwords below."},"detail": {"hints": "Hints",diff --git a/static/locales/es.json b/static/locales/es.jsonindex a385b7bc..654915ad 100644--- a/static/locales/es.json+++ b/static/locales/es.json@@ -1615,7 +1615,8 @@"pickPlaceholder": "Insertar una plantilla guardada…","hotwords": "Hotwords","hotwordsHelp": "Palabras opcionales separadas por comas para mejorar el reconocimiento de términos específicos.",- "savedTemplate": "Plantilla guardada"+ "savedTemplate": "Plantilla guardada",+ "savedTemplateHelp": "Rellena el prompt inicial y las palabras clave a continuación."},"detail": {"hints": "Indicaciones",diff --git a/static/locales/fr.json b/static/locales/fr.jsonindex 7083e1e9..c6d18dc1 100644--- a/static/locales/fr.json+++ b/static/locales/fr.json@@ -1615,7 +1615,8 @@"pickPlaceholder": "Insérer un modèle enregistré…","hotwords": "Hotwords","hotwordsHelp": "Mots optionnels séparés par des virgules pour améliorer la reconnaissance de termes spécifiques.",- "savedTemplate": "Modèle enregistré"+ "savedTemplate": "Modèle enregistré",+ "savedTemplateHelp": "Remplit le prompt initial et les mots-clés ci-dessous."},"detail": {"hints": "Indices",diff --git a/static/locales/pt-BR.json b/static/locales/pt-BR.jsonindex 5cb3a62d..8250393b 100644--- a/static/locales/pt-BR.json+++ b/static/locales/pt-BR.json@@ -1615,7 +1615,8 @@"pickPlaceholder": "Inserir um modelo salvo…","hotwords": "Hotwords","hotwordsHelp": "Palavras opcionais separadas por vírgula para melhorar o reconhecimento de termos específicos.",- "savedTemplate": "Modelo salvo"+ "savedTemplate": "Modelo salvo",+ "savedTemplateHelp": "Preenche o prompt inicial e as hotwords abaixo."},"detail": {"hints": "Dicas",diff --git a/static/locales/ru.json b/static/locales/ru.jsonindex 32cf2c66..37ee1da5 100644--- a/static/locales/ru.json+++ b/static/locales/ru.json@@ -1615,7 +1615,8 @@"pickPlaceholder": "Вставить сохранённый шаблон…","hotwords": "Hotwords","hotwordsHelp": "Необязательные слова через запятую для улучшения распознавания специфичных терминов.",- "savedTemplate": "Сохранённый шаблон"+ "savedTemplate": "Сохранённый шаблон",+ "savedTemplateHelp": "Заполняет начальный промпт и ключевые слова ниже."},"detail": {"hints": "Подсказки",diff --git a/static/locales/zh.json b/static/locales/zh.jsonindex d672ca7a..92d309a5 100644--- a/static/locales/zh.json+++ b/static/locales/zh.json@@ -1615,7 +1615,8 @@"pickPlaceholder": "插入已保存的模板…","hotwords": "热词","hotwordsHelp": "可选的、以逗号分隔的词语,用于提高特定术语的识别。",- "savedTemplate": "已保存的模板"+ "savedTemplate": "已保存的模板",+ "savedTemplateHelp": "填充下方的初始提示和热词。"},"detail": {"hints": "提示",diff --git a/templates/components/upload-view.html b/templates/components/upload-view.htmlindex 41ba8b19..aaae18ee 100644--- a/templates/components/upload-view.html+++ b/templates/components/upload-view.html@@ -699,42 +699,48 @@<div class="disclosure-anim" :class="{ 'is-open': showAdvancedOptions }"><div class="disclosure-anim__inner"><div class="disclosure-panel p-3 bg-[var(--bg-tertiary)] space-y-3 border border-[var(--border-secondary)]">- <!-- Saved transcription template (#309): fills BOTH the initial- prompt and hotwords below. Hidden until the user has saved- templates. -->- <div v-if="initialPromptTemplates && initialPromptTemplates.length && (connectorSupportsInitialPrompt || connectorSupportsHotwords)">- <label class="block text-xs font-medium text-[var(--text-secondary)] mb-1">- ${ t('initialPromptTemplates.savedTemplate') }- </label>- <select @change="applyInitialPromptTemplate($event.target.value); $event.target.value=''"- class="w-full px-2 py-1 text-sm bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-primary)] rounded focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)]">- <option value="">${ t('initialPromptTemplates.pickPlaceholder') }</option>- <option v-for="tpl in initialPromptTemplates" :key="tpl.id" :value="tpl.id" v-text="tpl.name"></option>- </select>- </div>+ <!-- Prompt & hotwords sub-card (#309): the saved-template dropdown+ fills BOTH the initial prompt and hotwords, so the three are+ grouped in one bordered card to make that relationship obvious. -->+ <div v-if="connectorSupportsInitialPrompt || connectorSupportsHotwords"+ class="rounded-md border border-[var(--border-secondary)] bg-[var(--bg-secondary)] p-3 space-y-3">+ <!-- Saved transcription template: fills the fields below. Hidden+ until the user has saved templates. -->+ <div v-if="initialPromptTemplates && initialPromptTemplates.length">+ <label class="block text-xs font-medium text-[var(--text-secondary)] mb-1">+ ${ t('initialPromptTemplates.savedTemplate') }+ </label>+ <select @change="applyInitialPromptTemplate($event.target.value); $event.target.value=''"+ class="w-full px-2 py-1 text-sm bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-primary)] rounded focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)]">+ <option value="">${ t('initialPromptTemplates.pickPlaceholder') }</option>+ <option v-for="tpl in initialPromptTemplates" :key="tpl.id" :value="tpl.id" v-text="tpl.name"></option>+ </select>+ <p class="text-[10px] text-[var(--text-muted)] mt-0.5">${ t('initialPromptTemplates.savedTemplateHelp') }</p>+ </div>- <!-- Initial Prompt -->- <div v-if="connectorSupportsInitialPrompt">- <label class="block text-xs font-medium text-[var(--text-secondary)] mb-1">- ${ t('form.initialPrompt') }- </label>- <textarea v-model="uploadInitialPrompt"- rows="2"- :placeholder="t('form.initialPromptPlaceholder')"- class="w-full px-2 py-1 text-sm bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-primary)] rounded focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)] resize-y"></textarea>- <p class="text-[10px] text-[var(--text-muted)] mt-0.5">${ t('form.initialPromptHelp') }</p>- </div>+ <!-- Initial Prompt -->+ <div v-if="connectorSupportsInitialPrompt">+ <label class="block text-xs font-medium text-[var(--text-secondary)] mb-1">+ ${ t('form.initialPrompt') }+ </label>+ <textarea v-model="uploadInitialPrompt"+ rows="2"+ :placeholder="t('form.initialPromptPlaceholder')"+ class="w-full px-2 py-1 text-sm bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-primary)] rounded focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)] resize-y"></textarea>+ <p class="text-[10px] text-[var(--text-muted)] mt-0.5">${ t('form.initialPromptHelp') }</p>+ </div>- <!-- Hotwords -->- <div v-if="connectorSupportsHotwords">- <label class="block text-xs font-medium text-[var(--text-secondary)] mb-1">- ${ t('form.hotwords') }- </label>- <input v-model="uploadHotwords"- type="text"- :placeholder="t('form.hotwordsPlaceholder')"- class="w-full px-2 py-1 text-sm bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-primary)] rounded focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)]">- <p class="text-[10px] text-[var(--text-muted)] mt-0.5">${ t('form.hotwordsHelp') }</p>+ <!-- Hotwords -->+ <div v-if="connectorSupportsHotwords">+ <label class="block text-xs font-medium text-[var(--text-secondary)] mb-1">+ ${ t('form.hotwords') }+ </label>+ <input v-model="uploadHotwords"+ type="text"+ :placeholder="t('form.hotwordsPlaceholder')"+ class="w-full px-2 py-1 text-sm bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-primary)] rounded focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)]">+ <p class="text-[10px] text-[var(--text-muted)] mt-0.5">${ t('form.hotwordsHelp') }</p>+ </div></div><!-- Transcription Model (issue #266 — visible only when admin set TRANSCRIPTION_MODELS_AVAILABLE).