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 %}
|
{% endif %}
|
||||||
|
|
||||||
<section class="content block">
|
<section class="content block">
|
||||||
{% include "book/links.html" %}
|
{% include "book/file_links/links.html" %}
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -6,5 +6,5 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% 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 %}
|
{% endblock %}
|
|
@ -35,7 +35,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
{% for link in links.all %}
|
{% for link in links.all %}
|
||||||
{% join "verify" link.id as verify_modal %}
|
{% 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 %}
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<em>{% trans "No links available" %}</em>
|
<em>{% trans "No links available" %}</em>
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
<span class="icon icon-pencil" aria-hidden="true"></span>
|
<span class="icon icon-pencil" aria-hidden="true"></span>
|
||||||
<span>{% trans "Edit links" %}</span>
|
<span>{% trans "Edit links" %}</span>
|
||||||
</a>
|
</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 %}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
|
@ -16,7 +16,7 @@ class BookFileLinks(View):
|
||||||
def get(self, request, book_id):
|
def get(self, request, book_id):
|
||||||
"""view links"""
|
"""view links"""
|
||||||
book = get_object_or_404(models.Edition, id=book_id)
|
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):
|
def post(self, request, book_id, link_id):
|
||||||
"""delete link"""
|
"""delete link"""
|
||||||
|
@ -39,7 +39,7 @@ class AddFileLink(View):
|
||||||
"file_link_form": forms.FileLinkForm(),
|
"file_link_form": forms.FileLinkForm(),
|
||||||
"book": book,
|
"book": book,
|
||||||
}
|
}
|
||||||
return TemplateResponse(request, "book/file_link_page.html", data)
|
return TemplateResponse(request, "book/file_links/file_link_page.html", data)
|
||||||
|
|
||||||
@transaction.atomic
|
@transaction.atomic
|
||||||
def post(self, request, book_id, link_id=None):
|
def post(self, request, book_id, link_id=None):
|
||||||
|
@ -49,7 +49,7 @@ class AddFileLink(View):
|
||||||
form = forms.FileLinkForm(request.POST, instance=link)
|
form = forms.FileLinkForm(request.POST, instance=link)
|
||||||
if not form.is_valid():
|
if not form.is_valid():
|
||||||
data = {"file_link_form": form, "book": book}
|
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()
|
link = form.save()
|
||||||
book.file_links.add(link)
|
book.file_links.add(link)
|
||||||
|
|
Loading…
Reference in a new issue