WhisperMaPhone/thoughts/templates/thoughts/thought.html

54 lines
2.1 KiB
HTML

<div class="main">
<span class="main-text text">{{ thought.text|urlize }}</span>
</div>
{% with file_type=thought.get_media_type %}
{% if file_type or thought.extended_text.strip %}
<div class="extended">
{% if thought.extended_text.strip %}
<span class="extended-text text">{{ thought.extended_text|urlize }}</span>
{% endif %}
{% if file_type == "png" or file_type == "jpeg" or file_type == "jpg" %}
<img src="{{ thought.media.url }}" class="extended-media" alt="{{ thought.media_alt }}">
{% elif file_type == "m4a" or file_type == "mp3" or file_type == "aac" %}
<audio controls src="{{ thought.media.url }}" class="extended-media"></audio>
{% if thought.media_alt %}
<button class="transcript-button">View transcription</button>
<div class="transcript-label">Transcript</div>
<div class="transcript">{{ thought.media_alt|urlize }}</div>
{% endif %}
{% elif file_type == "mov" or file_type == "mp4" %}
<video src="{{ thought.media.url }}" controls class="extended-media"></video>
{% if thought.media_alt %}
<button class="transcript-button">View description</button>
<div class="transcript-label">Description</div>
<div class="transcript">{{ thought.media_alt|urlize }}</div>
{% endif %}
{% endif %}
</div>
{% endif %}
{% endwith %}
<div class="thought-end">
<span class="permalink">
<a class="button" href="/?show={{thought.uuid}}">Link</a>
</span>
{% if authenticated %}
<span class="permalink edit-link">
<a class="button" href="/post?editing={{thought.uuid}}">Edit</a>
</span>
{% endif %}
{% load tz %}
<span class="timestamp">
{% timezone thought.get_timezone %}
{{ thought.posted|time:"g:i a" }}
{{ thought.posted|date:"M d, Y" }},
UTC{{ thought.get_offset_hours }}
{% endtimezone %}
</span>
</div>
<hr>