#8190 closed New feature (fixed)
Utilise help_text for TabularInline in Admin
| Reported by: | glenjamin | Owned by: | Alexander Herrmann |
|---|---|---|---|
| Component: | contrib.admin | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | rlaager@…, net147@…, glicerinu@…, django@… | Triage Stage: | Accepted |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | yes |
| Easy pickings: | no | UI/UX: | yes |
Description
When using TabularInline in the automatic admin interface the help_text for fields is not displayed anywhere.
I suggest that the information could be displayed as a tooltip on the column heading, like so:
<th {% if forloop.first %}colspan="2"{% endif %}>{{ field.label|capfirst|escape }}</th>
becomes
<th {% if forloop.first %}colspan="2"{% endif %}>
{{ field.label|capfirst|escape }}
{% if field.help_text %}<abbr class="help-text-tooltip" title="{{ field.help_text|striptags }}">?</abbr>{% endif %}
</th>
and then in the CSS:
.help-text-tooltip { cursor: help; }
Attachments (2)
Change History (22)
comment:1 by , 17 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:2 by , 16 years ago
comment:3 by , 16 years ago
| Cc: | added |
|---|
comment:4 by , 15 years ago
| Cc: | added |
|---|
comment:6 by , 15 years ago
| Cc: | added |
|---|
comment:8 by , 15 years ago
| Severity: | → Normal |
|---|---|
| Type: | → New feature |
comment:9 by , 14 years ago
| UI/UX: | set |
|---|
comment:10 by , 14 years ago
| Easy pickings: | unset |
|---|---|
| Owner: | changed from to |
| Status: | new → assigned |
by , 14 years ago
| Attachment: | 8190-r16351.diff added |
|---|
comment:11 by , 14 years ago
| Has patch: | set |
|---|
comment:12 by , 14 years ago
| Needs tests: | set |
|---|
comment:13 by , 14 years ago
| Cc: | added |
|---|
Whats about simply add the help_text to td title ?
e.g:
django/contrib/admin/templates/admin/edit_inline/tabular.html @@ -42,7 +42,7 @@ {% for fieldset in inline_admin_form %} {% for line in fieldset %} {% for field in line %} - <td class="{{ field.field.name }}"> + <td class="{{ field.field.name }}" title="{{ field.field.help_text }}"> {% if field.is_readonly %} <p>{{ field.contents }}</p> {% else %}
by , 14 years ago
| Attachment: | 8190.tabular-inline-help-text.diff added |
|---|
comment:14 by , 14 years ago
| Needs tests: | unset |
|---|
The attached patch contains a binary image I've created to symbolise the help text (instead of using a '?' character). I've also added some tests.
comment:15 by , 14 years ago
By the way, you will need to use 'git apply' to create the binary image from the patch.
comment:16 by , 14 years ago
| Patch needs improvement: | set |
|---|
I don't know the small icon looks a little odd (too dark), maybe we could ask our Design BDFL to create a better one.
comment:18 by , 14 years ago
Small icon is indeed too dark. icon-unknown.gif would be a fine solution here, even if it is used for other purposes elsewhere.
I would prefer this:
<th {% if forloop.first %}colspan="2"{% endif %}> <span class="inline-field-label">{{ field.label|capfirst }}</span> {% if field.help_text %}<abbr class="help" title="{{ field.help_text|striptags }}">?</abbr>{% endif %} </th>and
.inline-group .tabular .inline-field-label { float: left; } .inline-group .tabular abbr.help { cursor: help; float: right; }