moviewyrm/bookwyrm/templates/book/links.html

42 lines
1.3 KiB
HTML
Raw Normal View History

2022-01-10 04:30:23 +00:00
{% load i18n %}
{% load bookwyrm_tags %}
2022-01-10 19:47:52 +00:00
{% load utilities %}
2022-01-10 04:30:23 +00:00
{% get_book_file_links book as links %}
<header class="columns is-mobile mb-0">
<div class="column">
<h2 class="title is-5">{% trans "Get a copy" %}</h2>
</div>
{% if can_edit_book %}
<div class="column is-narrow">
{% url 'file-link' book.id as fallback_url %}
<button class="button is-small" type="button" data-modal-open="edit-links">
<span class="icon icon-plus">
<span class="is-sr-only">
{% trans "Add link to copy" %}
</span>
</span>
</button>
</div>
{% endif %}
</header>
{% if links %}
<ul class="mt-0">
{% for link in links.all %}
2022-01-10 19:47:52 +00:00
{% join "verify" link.id as verify_modal %}
2022-01-10 04:30:23 +00:00
<li>
2022-01-10 19:47:52 +00:00
<a href="{{ link.url }}" rel="noopener" target="_blank" title="{{ link.url }}" data-modal-open="{{ verify_modal }}">{{ link.name }}</a>
2022-01-10 04:30:23 +00:00
({{ link.filetype }})
</li>
{% endfor %}
</ul>
2022-01-10 19:47:52 +00:00
{% for link in links.all %}
{% join "verify" link.id as verify_modal %}
{% include "book/link_verification_modal.html" with id=verify_modal %}
{% endfor %}
2022-01-10 04:30:23 +00:00
{% endif %}
{% if can_edit_book %}
{% include 'book/file_link_modal.html' with book=book id="edit-links" %}
{% endif %}