1
0
mirror of https://github.com/django/django.git synced 2025-01-03 06:55:47 +00:00

Refs #34909 -- Made cosmetic edits to admin navigation template.

This commit is contained in:
Eliana Rosselli 2023-12-15 11:37:59 +01:00 committed by Mariusz Felisiak
parent 8709fe61ba
commit 5b885106a7

View File

@ -8,29 +8,33 @@
<a href="{{ app.app_url }}" class="section" title="{% blocktranslate with name=app.name %}Models in the {{ name }} application{% endblocktranslate %}">{{ app.name }}</a> <a href="{{ app.app_url }}" class="section" title="{% blocktranslate with name=app.name %}Models in the {{ name }} application{% endblocktranslate %}">{{ app.name }}</a>
</caption> </caption>
{% for model in app.models %} {% for model in app.models %}
<tr class="model-{{ model.object_name|lower }}{% if model.admin_url in request.path|urlencode %} current-model{% endif %}"> {% with model_name=model.object_name|lower %}
{% if model.admin_url %} <tr class="model-{{ model_name }}{% if model.admin_url in request.path|urlencode %} current-model{% endif %}">
<th scope="row"><a href="{{ model.admin_url }}"{% if model.admin_url in request.path|urlencode %} aria-current="page"{% endif %}>{{ model.name }}</a></th> <th scope="row">
{% else %} {% if model.admin_url %}
<th scope="row">{{ model.name }}</th> <a href="{{ model.admin_url }}"{% if model.admin_url in request.path|urlencode %} aria-current="page"{% endif %}>{{ model.name }}</a>
{% endif %} {% else %}
{{ model.name }}
{% endif %}
</th>
{% if model.add_url %} {% if model.add_url %}
<td><a href="{{ model.add_url }}" class="addlink">{% translate 'Add' %}</a></td> <td><a href="{{ model.add_url }}" class="addlink">{% translate 'Add' %}</a></td>
{% else %}
<td></td>
{% endif %}
{% if model.admin_url and show_changelinks %}
{% if model.view_only %}
<td><a href="{{ model.admin_url }}" class="viewlink">{% translate 'View' %}</a></td>
{% else %} {% else %}
<td><a href="{{ model.admin_url }}" class="changelink">{% translate 'Change' %}</a></td> <td></td>
{% endif %} {% endif %}
{% elif show_changelinks %}
<td></td> {% if model.admin_url and show_changelinks %}
{% endif %} {% if model.view_only %}
</tr> <td><a href="{{ model.admin_url }}" class="viewlink">{% translate 'View' %}</a></td>
{% else %}
<td><a href="{{ model.admin_url }}" class="changelink">{% translate 'Change' %}</a></td>
{% endif %}
{% elif show_changelinks %}
<td></td>
{% endif %}
</tr>
{% endwith %}
{% endfor %} {% endfor %}
</table> </table>
</div> </div>