make cancel go one page back

This commit is contained in:
Andreas Zweili 2020-06-02 06:15:58 +02:00
parent 320e5d449b
commit 490ac6d2cf
7 changed files with 7 additions and 6 deletions

View File

@ -5,7 +5,7 @@
<form method="post">{% csrf_token %}
<p>Are you sure you want to delete the IP "{{ object.ip }}" for "{{ object.device }}"?</p>
<button type="submit" class="btn btn-danger">Delete</button>
<a href="{{ view.get_success_url }}" class="btn btn-primary">Cancel</a>
<a href="{{ request.META.HTTP_REFERER }}" class="btn btn-primary">Cancel</a>
<input type="hidden" id="previous_page" name="previous_page" value="/previous/page/url">
</form>
<script>

View File

@ -8,7 +8,7 @@
{% csrf_token %}
{{ form|crispy }}
<button type="submit" class="btn btn-primary">Save</button>
<a href="{{ view.get_success_url }}" class="btn btn-secondary">Cancel</a>
<a href="{{ request.META.HTTP_REFERER }}" class="btn btn-primary">Cancel</a>
<input type="hidden" id="previous_page" name="previous_page" value="/previous/page/url">
</form>
<script>

View File

@ -16,7 +16,7 @@
</div>
<br>
<input type="submit" value="Save" class="btn btn-primary">
<a href="{{ view.get_success_url }}" class="btn btn-secondary">Cancel</a>
<a href="{{ request.META.HTTP_REFERER }}" class="btn btn-primary">Cancel</a>
<input type="hidden" id="previous_page" name="previous_page" value="/previous/page/url">
</form>
<script>

View File

@ -16,6 +16,7 @@
</div>
<br>
<input type="submit" value="Save" class="btn btn-primary">
<a href="{{ request.META.HTTP_REFERER }}" class="btn btn-primary">Cancel</a>
<input type="hidden" id="previous_page" name="previous_page" value="/previous/page/url">
</form>
<script>

View File

@ -5,7 +5,7 @@
<form method="post">{% csrf_token %}
<p>Are you sure you want to delete the warranty for "{{ object }}"?</p>
<button type="submit" class="btn btn-danger">Delete</button>
<a href="{{ view.get_success_url }}" class="btn btn-primary">Cancel</a>
<a href="{{ request.META.HTTP_REFERER }}" class="btn btn-primary">Cancel</a>
<input type="hidden" id="previous_page" name="previous_page" value="/previous/page/url">
</form>
<script>

View File

@ -8,7 +8,7 @@
{% csrf_token %}
{{ form|crispy }}
<button type="submit" class="btn btn-primary">Save</button>
<a href="{{ view.get_success_url }}" class="btn btn-secondary">Cancel</a>
<a href="{{ request.META.HTTP_REFERER }}" class="btn btn-primary">Cancel</a>
<input type="hidden" id="previous_page" name="previous_page" value="/previous/page/url">
</form>
<script>

View File

@ -16,7 +16,7 @@
</div>
<br>
<input type="submit" value="Save" class="btn btn-primary">
<a href="{{ view.get_success_url }}" class="btn btn-secondary">Cancel</a>
<a href="{{ request.META.HTTP_REFERER }}" class="btn btn-primary">Cancel</a>
<input type="hidden" id="previous_page" name="previous_page" value="/previous/page/url">
</form>
<script>