forked from mirrors/bookwyrm
Creates link template subdirectory
This commit is contained in:
parent
5fcdc284ce
commit
262e641c79
7 changed files with 7 additions and 7 deletions
|
@ -375,7 +375,7 @@
|
|||
{% endif %}
|
||||
|
||||
<section class="content block">
|
||||
{% include "book/links.html" %}
|
||||
{% include "book/file_links/links.html" %}
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -6,5 +6,5 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% include "book/file_link_modal.html" with book=book active=True static=True id="file-link" %}
|
||||
{% include "book/file_links/add_link_modal.html" with book=book active=True static=True id="file-link" %}
|
||||
{% endblock %}
|
|
@ -35,7 +35,7 @@
|
|||
</ul>
|
||||
{% for link in links.all %}
|
||||
{% join "verify" link.id as verify_modal %}
|
||||
{% include "book/link_verification_modal.html" with id=verify_modal %}
|
||||
{% include "book/file_links/verification_modal.html" with id=verify_modal %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<em>{% trans "No links available" %}</em>
|
||||
|
@ -46,7 +46,7 @@
|
|||
<span class="icon icon-pencil" aria-hidden="true"></span>
|
||||
<span>{% trans "Edit links" %}</span>
|
||||
</a>
|
||||
{% include 'book/file_link_modal.html' with book=book id="add-links" %}
|
||||
{% include 'book/file_links/add_link_modal.html' with book=book id="add-links" %}
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
|
@ -16,7 +16,7 @@ class BookFileLinks(View):
|
|||
def get(self, request, book_id):
|
||||
"""view links"""
|
||||
book = get_object_or_404(models.Edition, id=book_id)
|
||||
return TemplateResponse(request, "book/edit_links.html", {"book": book})
|
||||
return TemplateResponse(request, "book/file_links/edit_links.html", {"book": book})
|
||||
|
||||
def post(self, request, book_id, link_id):
|
||||
"""delete link"""
|
||||
|
@ -39,7 +39,7 @@ class AddFileLink(View):
|
|||
"file_link_form": forms.FileLinkForm(),
|
||||
"book": book,
|
||||
}
|
||||
return TemplateResponse(request, "book/file_link_page.html", data)
|
||||
return TemplateResponse(request, "book/file_links/file_link_page.html", data)
|
||||
|
||||
@transaction.atomic
|
||||
def post(self, request, book_id, link_id=None):
|
||||
|
@ -49,7 +49,7 @@ class AddFileLink(View):
|
|||
form = forms.FileLinkForm(request.POST, instance=link)
|
||||
if not form.is_valid():
|
||||
data = {"file_link_form": form, "book": book}
|
||||
return TemplateResponse(request, "book/file_link_page.html", data)
|
||||
return TemplateResponse(request, "book/file_links/file_link_page.html", data)
|
||||
|
||||
link = form.save()
|
||||
book.file_links.add(link)
|
||||
|
|
Loading…
Reference in a new issue