Code

Opened 6 years ago

Closed 6 years ago

#6270 closed (wontfix)

There should be a way to easy edit a form's label_tag output!

Reported by: italomaia Owned by: dtulig
Component: Forms Version: master
Severity: Keywords: label, edit
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Well, for what i noticed, label_tag output is plain text, so, using a filter for the change would be difficult.
Something like: if you would like your filed help_text to become you label's title, so that a javascript framework
could get all your labels titles and make good looking "tip boxes" for them, how could one acomplish that?
It would be necessary to subclass ModelForm or Form, or even create some bad looking filters...bad solution.
A suggestion for the work would be that the label_tag output was not plain text, but an object, widget-like.
So that a object.widget.attrs.update({'title':value}) could be used through filters, or even a option for
the described behavior ( help_text as the label's title ).
I believe that would make the web-designers lifes easier.

Attachments (1)

label_attrs.diff (3.1 KB) - added by dtulig 6 years ago.
Adds "label_attrs" to the Field constructor to define attributes for the label tag

Download all attachments as: .zip

Change History (3)

Changed 6 years ago by dtulig

Adds "label_attrs" to the Field constructor to define attributes for the label tag

comment:1 Changed 6 years ago by dtulig

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to dtulig
  • Patch needs improvement unset
  • Status changed from new to assigned

comment:2 Changed 6 years ago by jacob

  • Resolution set to wontfix
  • Status changed from assigned to closed

If you need custom label attributes you ought to simply do that at the template level. Something like <label class="woo">{{ field.label }}</label>{{ field }}.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.