Opened 16 years ago

Closed 13 years ago

Last modified 13 years ago

#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)

8190-r16351.diff (1.4 KB ) - added by Alexander Herrmann 13 years ago.
8190.tabular-inline-help-text.diff (5.4 KB ) - added by Julien Phalip 13 years ago.

Download all attachments as: .zip

Change History (22)

comment:1 by Jacob, 16 years ago

Triage Stage: UnreviewedAccepted

comment:2 by anonymous, 15 years ago

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;
}

comment:3 by anonymous, 15 years ago

Cc: rlaager@… added

comment:4 by net147, 14 years ago

Cc: net147@… added

comment:5 by Ramiro Morales, 14 years ago

#6077 proposed the same with a slightly different UI.

comment:6 by Marc Aymerich, 14 years ago

Cc: glicerinu@… added

comment:7 by Julien Phalip, 14 years ago

milestone: 1.4

I'd like to see this in 1.4.

comment:8 by Luke Plant, 14 years ago

Severity: Normal
Type: New feature

comment:9 by Julien Phalip, 13 years ago

UI/UX: set

comment:10 by Alexander Herrmann, 13 years ago

Easy pickings: unset
Owner: changed from nobody to Alexander Herrmann
Status: newassigned

by Alexander Herrmann, 13 years ago

Attachment: 8190-r16351.diff added

comment:11 by Alexander Herrmann, 13 years ago

Has patch: set

comment:12 by Julien Phalip, 13 years ago

Needs tests: set

comment:13 by jedie, 13 years ago

Cc: django@… 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 Julien Phalip, 13 years ago

comment:14 by Julien Phalip, 13 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 Julien Phalip, 13 years ago

By the way, you will need to use 'git apply' to create the binary image from the patch.

comment:16 by Jannis Leidel, 13 years ago

Patch needs improvement: set

I don't know the small icon looks a little odd (to dark), maybe we could ask our Design BDFL to create a better one.

Version 0, edited 13 years ago by Jannis Leidel (next)

comment:18 by Idan Gazit, 13 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.

comment:19 by Jannis Leidel, 13 years ago

Resolution: fixed
Status: assignedclosed

In [16622]:

Fixed #8190 -- Added support for a field's help text to the tabular admin inline. Thanks, Julien Phalip and Idan Gazit.

comment:20 by Jacob, 13 years ago

milestone: 1.4

Milestone 1.4 deleted

Note: See TracTickets for help on using tickets.
Back to Top