Open
Bug 1015226
Opened 10 years ago
Updated 2 years ago
When using field-label.html.tmpl there is not a way to underline the access key letter in the field description
Categories
(Bugzilla :: Creating/Changing Bugs, defect)
Tracking
()
REOPENED
People
(Reporter: dkl, Unassigned)
References
Details
Attachments
(1 file, 3 obsolete files)
1.39 KB,
patch
|
Details | Diff | Splinter Review |
When working on bug 1009216 we noticed that when using field-label.html.tmpl and designating an access key, you cannot embed a <u>W</u> or other letter in the field description to show the access key. Patch coming
Reporter | ||
Comment 1•10 years ago
|
||
This is actually not a trivial fix as I first imagined it as it will break localization of the labels on show_bug.cgi for fields that currently use field-label.html.tmpl. I will need to rethink how this is implemented so that it still works fine for that use case. dkl
Assignee: dkl → create-and-change
Status: ASSIGNED → NEW
OS: Linux → All
Hardware: x86_64 → All
Reporter | ||
Comment 2•10 years ago
|
||
Comment on attachment 8427815 [details] [diff] [review] 1015226_1.patch Review of attachment 8427815 [details] [diff] [review]: ----------------------------------------------------------------- i don't think that field-descs is the correct place to define html markup for field labels. it's loaded by a lot of files, so should be kept lean, and it's also very easy to overlook when adding new fields. it should be possible to automatically underline the first matching letter in the label. this removes the redundancy, and will automatically display accesskeys for fields that you've missed (eg. classification, product, component, status, resolution, ..., have access keys on search forms).
Attachment #8427815 -
Flags: review?(glob) → review-
Reporter | ||
Comment 4•10 years ago
|
||
Attachment #8427815 -
Attachment is obsolete: true
Attachment #8435171 -
Flags: review?(glob)
Comment on attachment 8435171 [details] [diff] [review] 1015226_2.patch Review of attachment 8435171 [details] [diff] [review]: ----------------------------------------------------------------- ::: template/en/default/bug/field-label.html.tmpl @@ +18,5 @@ > [% DEFAULT tag_name = "th" %] > +[% DEFAULT field_name = field_descs.${field.name} FILTER html %] > + > +[%# Underline the accesskey if defined and found in the field name %] > +[% IF accesskey %] as you only need to do this if the field is editable, move this within the [% IF editable %] block @@ +20,5 @@ > + > +[%# Underline the accesskey if defined and found in the field name %] > +[% IF accesskey %] > + [% matches = field_name.match("(?i)($accesskey)") %] > + [% field_name = field_name.replace(matches.0, "<u>${matches.0}</u>") IF matches.0 %] this doesn't work if there are no matches. you have to use [% IF matches.0 %] [% field_name = ... %] [% END %]
Attachment #8435171 -
Flags: review?(glob) → review-
Reporter | ||
Comment 6•10 years ago
|
||
Attachment #8435171 -
Attachment is obsolete: true
Attachment #8440833 -
Flags: review?(glob)
Comment on attachment 8440833 [details] [diff] [review] 1015226_3.patch Review of attachment 8440833 [details] [diff] [review]: ----------------------------------------------------------------- r=glob
Attachment #8440833 -
Flags: review?(glob) → review+
Reporter | ||
Comment 8•10 years ago
|
||
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git 0898458..a9081c2 master -> master
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Comment 9•10 years ago
|
||
Comment on attachment 8440833 [details] [diff] [review] 1015226_3.patch >+[% DEFAULT field_name = field_descs.${field.name} FILTER html %] This syntax is broken, see bug 1085173. >+ [% matches = field_name.match("(?i)($accesskey)") %] >+ [% IF matches.0 %] >+ [% field_name = field_name.replace(matches.0, "<u>${matches.0}</u>") %] >+ [% END %] You must not run this code against the HTML-filtered field description, because a field description of the form "H & M" with an accesskey = a breaks the output, because & is first converted into & and then you run the regexp against it, converting & into &<u>a</u>mp;. I suggest to backout this patch.
Attachment #8440833 -
Flags: review-
Updated•10 years ago
|
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Reporter | ||
Comment 10•10 years ago
|
||
Backed out for now: To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git cd3b8b4..2ebb8b6 master -> master dkl
Updated•10 years ago
|
Flags: approval+
Reporter | ||
Comment 11•10 years ago
|
||
Attachment #8440833 -
Attachment is obsolete: true
Attachment #8508698 -
Flags: review?(LpSolit)
Comment 12•10 years ago
|
||
Comment on attachment 8508698 [details] [diff] [review] 1015226_4.patch >- >[%- field_descs.${field.name} FILTER html %]:</a> >+ >[%- field_name FILTER html_light %]:</a> If a custom field name has HTML entities in it (which is very unlikely), it would be rendered differently, which is not good. Couldn't you use a similar trick as in bug 998323, i.e. using \x{FDD2} and \x{FDD3} to represent <u> and </u> respectively, and substitute them after calling FILTER html?
Updated•10 years ago
|
Attachment #8508698 -
Flags: review?(LpSolit)
Updated•9 years ago
|
Target Milestone: Bugzilla 5.0 → ---
Reporter | ||
Updated•2 years ago
|
Assignee: dkl → create-and-change
You need to log in
before you can comment on or make changes to this bug.
Description
•