Add additional media buttons

Relevant media "reading" buutons are visible.
This commit is contained in:
Blondel MONDESIR 2023-09-14 22:44:54 -04:00 committed by GitHub
parent 9d248c82e5
commit 3281ef880c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 55 additions and 1 deletions

View File

@ -120,7 +120,61 @@
<a target="_blank" href="{{ url_for('web.read_book', book_id=entry.id, book_format=entry.audio_entries[0]) }}" id="listenbtn" class="btn btn-primary" role="button"><span class="glyphicon glyphicon-music"></span> {{ _('Listen in Browser') }} - {{ entry.audio_entries[0] }}</a>
{% endif %}
</div>
{% endif %}
{% elif entry.video_entries|length > 0 and current_user.role_viewer() %}
<div class="btn-group" role="group">
{% if entry.video_entries|length > 1 %}
<button id="listen-in-browser" type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="glyphicon glyphicon-film"></span> {{ _('Watch in Browser') }}
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="listen-in-browser">
{% for format in entry.reader_list %}
<li><a target="_blank" href="{{ url_for('web.read_book', book_id=entry.id, book_format=format) }}">{{ format }}</a>
</li>
{% endfor %}
</ul>
<ul class="dropdown-menu" aria-labelledby="listen-in-browser">
{% for format in entry.data %}
{% if format.format|lower in entry.video_entries %}
<li><a target="_blank"
href="{{ url_for('web.read_book', book_id=entry.id, book_format=format.format|lower) }}">{{ format.format|lower }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
{% else %}
<a target="_blank" href="{{ url_for('web.read_book', book_id=entry.id, book_format=entry.video_entries[0]) }}" id="listenbtn" class="btn btn-primary" role="button"><span class="glyphicon glyphicon-film"></span> {{ _('Watch in Browser') }} - {{ entry.video_entries[0] }}</a>
{% endif %}
</div>
{% elif entry.image_entries|length > 0 and current_user.role_viewer() %}
<div class="btn-group" role="group">
{% if entry.image_entries|length > 1 %}
<button id="listen-in-browser" type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="glyphicon glyphicon-picture"></span> {{ _('View in Browser') }}
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="listen-in-browser">
{% for format in entry.reader_list %}
<li><a target="_blank" href="{{ url_for('web.read_book', book_id=entry.id, book_format=format) }}">{{ format }}</a>
</li>
{% endfor %}
</ul>
<ul class="dropdown-menu" aria-labelledby="listen-in-browser">
{% for format in entry.data %}
{% if format.format|lower in entry.image_entries %}
<li><a target="_blank"
href="{{ url_for('web.read_book', book_id=entry.id, book_format=format.format|lower) }}">{{ format.format|lower }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
{% else %}
<a target="_blank" href="{{ url_for('web.read_book', book_id=entry.id, book_format=entry.image_entries[0]) }}" id="listenbtn" class="btn btn-primary" role="button"><span class="glyphicon glyphicon-picture"></span> {{ _('View in Browser') }} - {{ entry.image_entries[0] }}</a>
{% endif %}
</div>
{% endif %}
</div>
</div>
<h2 id="title">{{ entry.title }}</h2>