Only show approved links
This commit is contained in:
@ -383,37 +383,7 @@
|
||||
{% endif %}
|
||||
|
||||
<section class="content block">
|
||||
<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 book.file_links %}
|
||||
<ul class="mt-0">
|
||||
{% for link in book.file_links.all %}
|
||||
<li>
|
||||
<a href="{{ link.url }}" rel="noopener" target="_blank" title="{{ link.url }}">{{ link.name }}</a>
|
||||
({{ link.filetype }})
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{% if can_edit_book %}
|
||||
{% include 'book/file_link_modal.html' with book=book id="edit-links" %}
|
||||
{% endif %}
|
||||
{% include "book/links.html" %}
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
34
bookwyrm/templates/book/links.html
Normal file
34
bookwyrm/templates/book/links.html
Normal file
@ -0,0 +1,34 @@
|
||||
{% load i18n %}
|
||||
{% load bookwyrm_tags %}
|
||||
{% 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 %}
|
||||
<li>
|
||||
<a href="{{ link.url }}" rel="noopener" target="_blank" title="{{ link.url }}">{{ link.name }}</a>
|
||||
({{ link.filetype }})
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{% if can_edit_book %}
|
||||
{% include 'book/file_link_modal.html' with book=book id="edit-links" %}
|
||||
{% endif %}
|
Reference in New Issue
Block a user