Skip to content

Commit

Permalink
\#527 Fixes issue where the history button doesn't work when viewing …
Browse files Browse the repository at this point in the history
…a historical entry
  • Loading branch information
trumpet2012 authored and tim-schilling committed Dec 5, 2024
1 parent 7cd4647 commit b890718
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ Authors
- `DanialErfanian <https://github.com/DanialErfanian>`_
- `Sridhar Marella <https://github.com/sridhar562345>`_
- `Mattia Fantoni <https://github.com/MattFanto>`_
- `Trent Holliday <https://github.com/trumpet2012>`_

Background
==========
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Unreleased
- Dropped support for Python 3.8, which reached end-of-life on 2024-10-07 (gh-1421)
- Added support for Django 5.1 (gh-1388)
- Added pagination to ``SimpleHistoryAdmin`` (gh-1277)
- Fixed issue with history button not working when viewing historical entries in the
admin (gh-527)

3.7.0 (2024-05-29)
------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "admin/change_form.html" %}
{% load i18n %}
{% load i18n admin_urls %}
{% load url from simple_history_compat %}

{% block breadcrumbs %}
Expand All @@ -21,6 +21,14 @@
{% include "simple_history/submit_line.html" %}
{% endblock %}

{% block object-tools-items %}
{# We override this block from the django template to fix up the history link #}
<li>
<a href="{% add_preserved_filters history_url %}" class="historylink">{% translate "History" %}</a>
</li>
{% if has_absolute_url %}<li><a href="{{ absolute_url }}" class="viewsitelink">{% translate "View on site" %}</a></li>{% endif %}
{% endblock %}

{% block form_top %}
<p>{% if not revert_disabled %}{% blocktrans %}Press the 'Revert' button below to revert to this version of the object.{% endblocktrans %}{% endif %}{% if change_history %}{% blocktrans %}Press the 'Change History' button below to edit the history.{% endblocktrans %}{% endif %}</p>
{% endblock %}

0 comments on commit b890718

Please sign in to comment.