diff --git a/django/contrib/admin/templates/admin/app_list.html b/django/contrib/admin/templates/admin/app_list.html index 00c4178bd2..941680d89b 100644 --- a/django/contrib/admin/templates/admin/app_list.html +++ b/django/contrib/admin/templates/admin/app_list.html @@ -8,29 +8,33 @@ {{ app.name }} {% for model in app.models %} - - {% if model.admin_url %} - {{ model.name }} - {% else %} - {{ model.name }} - {% endif %} + {% with model_name=model.object_name|lower %} + + + {% if model.admin_url %} + {{ model.name }} + {% else %} + {{ model.name }} + {% endif %} + - {% if model.add_url %} - {% translate 'Add' %} - {% else %} - - {% endif %} - - {% if model.admin_url and show_changelinks %} - {% if model.view_only %} - {% translate 'View' %} + {% if model.add_url %} + {% translate 'Add' %} {% else %} - {% translate 'Change' %} + {% endif %} - {% elif show_changelinks %} - - {% endif %} - + + {% if model.admin_url and show_changelinks %} + {% if model.view_only %} + {% translate 'View' %} + {% else %} + {% translate 'Change' %} + {% endif %} + {% elif show_changelinks %} + + {% endif %} + + {% endwith %} {% endfor %}