Skip to content

Commit

Permalink
Fixed #21685 -- Displayed app verbose name in admindocs model index
Browse files Browse the repository at this point in the history
  • Loading branch information
claudep committed May 10, 2014
1 parent edecbb5 commit 4cf82e5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 4 additions & 4 deletions django/contrib/admindocs/templates/admin_doc/model_index.html
Expand Up @@ -17,12 +17,12 @@

<h1>{% trans 'Model documentation' %}</h1>

{% regroup models by app_label as grouped_models %}
{% regroup models by app_config as grouped_models %}

<div id="content-main">
{% for group in grouped_models %}
<div class="module">
<h2 id="app-{{ group.grouper }}">{{ group.grouper|capfirst }}</h2>
<h2 id="app-{{ group.grouper.label }}">{{ group.grouper.verbose_name }} ({{ group.grouper.name }})</h2>

<table class="xfull">
{% for model in group.list %}
Expand All @@ -42,9 +42,9 @@ <h2 id="app-{{ group.grouper }}">{{ group.grouper|capfirst }}</h2>
<div class="module">
<h2>{% trans 'Model groups' %}</h2>
<ul>
{% regroup models by app_label as grouped_models %}
{% regroup models by app_config as grouped_models %}
{% for group in grouped_models %}
<li><a href="#app-{{ group.grouper }}">{{ group.grouper|capfirst }}</a></li>
<li><a href="#app-{{ group.grouper.label }}">{{ group.grouper.verbose_name }}</a></li>
{% endfor %}
</ul>
</div>
Expand Down
6 changes: 5 additions & 1 deletion tests/admin_docs/tests.py
Expand Up @@ -81,7 +81,11 @@ def test_view_detail(self):

def test_model_index(self):
response = self.client.get(reverse('django-admindocs-models-index'))
self.assertContains(response, '<h2 id="app-auth">Auth</h2>', html=True)
self.assertContains(
response,
'<h2 id="app-auth">Authentication and Authorization (django.contrib.auth)</h2>',
html=True
)

def test_template_detail(self):
response = self.client.get(reverse('django-admindocs-templates',
Expand Down

0 comments on commit 4cf82e5

Please sign in to comment.