| 1 |
{#- The upload itself is described, not written out here: the accept list, the |
| 2 |
destination, the payload and the wait all come from |
| 3 |
`crate::quasi::upload_field`, and `static/upload.js` runs the presign chain |
| 4 |
behind the one address it emits. What is left in this file is the audio |
| 5 |
that is already there and the swap between it and the picker. -#} |
| 6 |
<div class="audio-upload" id="audio-upload"> |
| 7 |
{% if let Some(s3_key) = audio_s3_key %} |
| 8 |
<div class="current-audio" id="current-audio"> |
| 9 |
<div class="audio-info"> |
| 10 |
<span class="audio-icon">♫</span> |
| 11 |
<div class="audio-details"> |
| 12 |
<span class="audio-filename">{{ s3_key.rsplit('/').next().unwrap_or(&s3_key) }}</span> |
| 13 |
{% if let Some(duration) = duration_seconds %} |
| 14 |
<span class="audio-duration">{{ duration / 60 }}:{{ format!("{:02}", duration % 60) }}</span> |
| 15 |
{% endif %} |
| 16 |
</div> |
| 17 |
</div> |
| 18 |
<button type="button" class="btn-secondary" id="replace-audio-btn">Replace Audio</button> |
| 19 |
</div> |
| 20 |
{% endif %} |
| 21 |
|
| 22 |
<div class="upload-area {% if audio_s3_key.is_some() %}hidden{% endif %}" id="upload-area" |
| 23 |
data-upload-goes="/dashboard/item/{{ item.id }}?tab=files"> |
| 24 |
{{ crate::quasi::upload_field::audio(item.id.as_str())|safe }} |
| 25 |
</div> |
| 26 |
</div> |
| 27 |
|