Render feed from episode (#9)

- Render chapter if present (#5)
- Render transcript if present (#8)
- Require transcript type if URL entered (#8)
This commit is contained in:
2022-06-27 20:34:30 -04:00
parent 80c65bcad6
commit 16603bbcaf
4 changed files with 99 additions and 47 deletions

View File

@@ -157,7 +157,8 @@
<div class="col-12 col-md-8 pb-3">
<div class="form-floating">
<input type="text" name="transcriptUrl" id="transcriptUrl" class="form-control"
placeholder="Transcript URL" value="{{ model.transcript_url }}">
placeholder="Transcript URL" value="{{ model.transcript_url }}"
onkeyup="Admin.requireTranscriptType()">
<label for="transcriptUrl">Transcript URL</label>
<div class="form-text">Optional; relative URL served from this web log</div>
</div>
@@ -165,7 +166,8 @@
<div class="col-12 col-md-4 pb-3">
<div class="form-floating">
<input type="text" name="transcriptType" id="transcriptType" class="form-control"
placeholder="Transcript Type" value="{{ model.transcript_type }}">
placeholder="Transcript Type" value="{{ model.transcript_type }}"
{%- if model.transcript_url != "" %} required{% endif %}>
<label for="transcriptType">Transcript MIME Type</label>
<div class="form-text">Recommended if transcript file provided</div>
</div>

View File

@@ -255,6 +255,13 @@
document.getElementById(`link_${idx}`).remove()
},
/**
* Require transcript type if transcript URL is present
*/
requireTranscriptType() {
document.getElementById("transcriptType").required = document.getElementById("transcriptUrl").value.trim() !== ""
},
/**
* Show messages that may have come with an htmx response
* @param messages The messages from the response