Fix conditional display journal & change log tabs

This commit is contained in:
Jeremy Stretch 2021-03-16 15:33:41 -04:00
parent 1f1a62da67
commit 64d11d32c8

View File

@ -53,16 +53,22 @@
<a href="{{ object.get_absolute_url }}">{{ object|meta:"verbose_name"|bettertitle }}</a> <a href="{{ object.get_absolute_url }}">{{ object|meta:"verbose_name"|bettertitle }}</a>
</li> </li>
{% if perms.extras.view_journalentry %} {% if perms.extras.view_journalentry %}
<li role="presentation"{% if active_tab == 'journal' %} class="active"{% endif %}> {% with journal_viewname=object|viewname:'journal' %}
{# TODO: Fix journal URL resolution hack #} {% url journal_viewname pk=object.pk as journal_url %}
<a href="{{ object.get_absolute_url }}journal/">Journal</a> {% if journal_url %}
</li> <li role="presentation"{% if active_tab == 'journal' %} class="active"{% endif %}>
<a href="{{ journal_url }}">Journal</a>
</li>
{% endif %}
{% endwith %}
{% endif %} {% endif %}
{% if perms.extras.view_objectchange %} {% if perms.extras.view_objectchange %}
<li role="presentation"{% if active_tab == 'changelog' %} class="active"{% endif %}> {% with changelog_viewname=object|viewname:'changelog' %}
{# TODO: Fix changelog URL resolution hack #} {% url changelog_viewname pk=object.pk as changelog_url %}
<a href="{{ object.get_absolute_url }}changelog/">Change Log</a> <li role="presentation"{% if active_tab == 'changelog' %} class="active"{% endif %}>
</li> <a href="{{ changelog_url }}">Change Log</a>
</li>
{% endwith %}
{% endif %} {% endif %}
</ul> </ul>
{% endblock %} {% endblock %}