Add hidden "next" input set to current path

This commit is contained in:
Joachim 2022-12-23 21:34:53 +01:00
parent 6947e74f5d
commit 3f52d6ee33
9 changed files with 15 additions and 4 deletions

View file

@ -13,7 +13,8 @@ Finish "<em>{{ book_title }}</em>"
{% csrf_token %}
<input type="hidden" name="id" value="{{ readthrough.id }}">
<input type="hidden" name="reading_status" value="read">
<input type="hidden" name="shelf" value="{{ move_from }}">
<input type="hidden" name="shelf" value="{{ move_from }}">
<input type="hidden" name="next" value="{{ request.path }}">
{% endblock %}
{% block reading-dates %}

View file

@ -11,6 +11,7 @@
{% csrf_token %}
<input type="hidden" name="id" value="{{ readthrough.id }}">
<input type="hidden" name="start_date" value="{{ readthrough.start_date|date:'Y-m-d' }}">
<input type="hidden" name="next" value="{{ request.path }}">
{% endblock %}
{% block reading-dates %}

View file

@ -10,9 +10,10 @@ Start "<em>{{ book_title }}</em>"
{% block modal-form-open %}
<form name="start-reading-{{ uuid }}" action="{% url 'reading-status' 'start' book.id %}" method="post" {% if not refresh %}class="submit-status"{% endif %}>
{% csrf_token %}
<input type="hidden" name="reading_status" value="reading">
<input type="hidden" name="shelf" value="{{ move_from }}">
{% csrf_token %}
<input type="hidden" name="next" value="{{ request.path }}">
{% endblock %}
{% block reading-dates %}

View file

@ -14,6 +14,7 @@ Stop Reading "<em>{{ book_title }}</em>"
<input type="hidden" name="id" value="{{ readthrough.id }}">
<input type="hidden" name="reading_status" value="stopped-reading">
<input type="hidden" name="shelf" value="{{ move_from }}">
<input type="hidden" name="next" value="{{ request.path }}">
{% endblock %}
{% block reading-dates %}

View file

@ -10,9 +10,10 @@ Want to Read "<em>{{ book_title }}</em>"
{% block modal-form-open %}
<form name="want-to-read-{{ uuid }}" action="{% url 'reading-status' 'want' book.id %}" method="post" {% if not refresh %}class="submit-status"{% endif %}>
{% csrf_token %}
<input type="hidden" name="reading_status" value="to-read">
<input type="hidden" name="shelf" value="{{ move_from }}">
{% csrf_token %}
<input type="hidden" name="next" value="{{ request.path }}">
{% endblock %}
{% block form %}

View file

@ -22,7 +22,7 @@
<input type="hidden" name="book" value="{{ book.id }}">
<input type="hidden" name="change-shelf-from" value="{{ current.identifier }}">
<input type="hidden" name="shelf" value="{{ shelf.identifier }}">
<input type="hidden" name="next" value="{{ request.path }}">
<button class="button is-fullwidth is-small shelf-option is-radiusless has-background-body" type="submit" {% if shelf.identifier == current.identifier %}disabled{% endif %}>
<span>
{% include "snippets/translated_shelf_name.html" with shelf=shelf %}
@ -78,6 +78,7 @@
{% csrf_token %}
<input type="hidden" name="book" value="{{ book.id }}">
<input type="hidden" name="shelf" value="{{ user_shelf.id }}">
<input type="hidden" name="next" value="{{ request.path }}">
<button class="button is-fullwidth is-small is-radiusless is-danger is-light" type="submit">
{% blocktrans with name=user_shelf|translate_shelf_name %}Remove from {{ name }}{% endblocktrans %}
</button>
@ -92,6 +93,7 @@
{% csrf_token %}
<input type="hidden" name="book" value="{{ book.id }}">
<input type="hidden" name="shelf" value="{{ shelf.id }}">
<input type="hidden" name="next" value="{{ request.path }}">
<button class="button is-fullwidth is-small is-radiusless is-danger is-light" type="submit">{% trans "Remove from" %} {{ shelf.name }}</button>
</form>
</li>

View file

@ -1,5 +1,6 @@
{% load utilities %}
<form name="fallback_form_{{ 0|uuid }}" method="GET" action="{{ fallback_url }}" autocomplete="off">
<input type="hidden" name="next" value="{{ request.path }}">
<button
type="submit"
class="button {{ class }}"

View file

@ -45,6 +45,7 @@
<form name="shelve-{{ uuid }}-{{ shelf.identifier }}" action="/shelve/" method="post" autocomplete="off">
{% csrf_token %}
<input type="hidden" name="book" value="{{ active_shelf.book.id }}">
<input type="hidden" name="next" value="{{ request.path }}">
<button class="button {{ class }}" name="shelf" type="submit" value="{{ shelf.identifier }}" {% if book|is_book_on_shelf:shelf %} disabled {% endif %}>
<span>{{ shelf.name }}</span>
</button>
@ -69,6 +70,7 @@
{% csrf_token %}
<input type="hidden" name="book" value="{{ active_shelf.book.id }}">
<input type="hidden" name="shelf" value="{{ active_shelf.shelf.id }}">
<input type="hidden" name="next" value="{{ request.path }}">
<button class="button is-fullwidth is-small{% if dropdown %} is-radiusless{% endif %} is-danger is-light" type="submit">
{% blocktrans with name=active_shelf.shelf|translate_shelf_name %}Remove from {{ name }}{% endblocktrans %}
</button>

View file

@ -62,6 +62,7 @@
<form name="shelve-{{ uuid }}-{{ shelf.identifier }}" action="/shelve/" method="post">
{% csrf_token %}
<input type="hidden" name="book" value="{{ active_shelf.book.id }}">
<input type="hidden" name="next" value="{{ request.path }}">
<button
class="button {{ class }}"
name="shelf"