Skip to content

Commit

Permalink
Further improved on the work done in r16622 by making the help text i…
Browse files Browse the repository at this point in the history
…cons look hoverable in the admin tabular inline headers.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16690 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
jphalip committed Aug 26, 2011
1 parent 804a6db commit 3e65f96
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions django/contrib/admin/static/admin/css/base.css
Expand Up @@ -189,6 +189,10 @@ p.mini {
color: #999; color: #999;
} }


img.help-tooltip {
cursor: help;
}

p img, h1 img, h2 img, h3 img, h4 img, td img { p img, h1 img, h2 img, h3 img, h4 img, td img {
vertical-align: middle; vertical-align: middle;
} }
Expand Down
Expand Up @@ -10,7 +10,7 @@ <h2>{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}</h2>
{% for field in inline_admin_formset.fields %} {% for field in inline_admin_formset.fields %}
{% if not field.widget.is_hidden %} {% if not field.widget.is_hidden %}
<th{% if forloop.first %} colspan="2"{% endif %}{% if field.required %} class="required"{% endif %}>{{ field.label|capfirst }} <th{% if forloop.first %} colspan="2"{% endif %}{% if field.required %} class="required"{% endif %}>{{ field.label|capfirst }}
{% if field.help_text %}&nbsp;<img src="{% static "admin/img/icon-unknown.gif" %}" alt="({{ field.help_text|striptags }})" title="{{ field.help_text|striptags }}" />{% endif %} {% if field.help_text %}&nbsp;<img src="{% static "admin/img/icon-unknown.gif" %}" class="help help-tooltip" width="10" height="10" alt="({{ field.help_text|striptags }})" title="{{ field.help_text|striptags }}" />{% endif %}
</th> </th>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion tests/regressiontests/admin_inlines/tests.py
Expand Up @@ -111,7 +111,7 @@ def test_help_text(self):
""" """
response = self.client.get('/test_admin/admin/admin_inlines/holder4/add/') response = self.client.get('/test_admin/admin/admin_inlines/holder4/add/')
self.assertContains(response, '<p class="help">Awesome stacked help text is awesome.</p>', 4) self.assertContains(response, '<p class="help">Awesome stacked help text is awesome.</p>', 4)
self.assertContains(response, '<img src="/static/admin/img/icon-unknown.gif" alt="(Awesome tabular help text is awesome.)" title="Awesome tabular help text is awesome." />', 1) self.assertContains(response, '<img src="/static/admin/img/icon-unknown.gif" class="help help-tooltip" width="10" height="10" alt="(Awesome tabular help text is awesome.)" title="Awesome tabular help text is awesome." />', 1)


class TestInlineMedia(TestCase): class TestInlineMedia(TestCase):
fixtures = ['admin-views-users.xml'] fixtures = ['admin-views-users.xml']
Expand Down

0 comments on commit 3e65f96

Please sign in to comment.