Opened 15 years ago
Closed 15 years ago
#8595 closed enhancement (worksforme)
Add IDs to the labels in the ticket modification form
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | ticket system | Version: | none |
Severity: | normal | Keywords: | HTML form template genshi label ID for |
Cc: | ryano@… | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
I was recently trying to do a bit of CSS hacking to a local install. Part of it involved modifying the labels for certain fields but not others. It seemed like the easiest way to do it was to add IDs to the labels. That way you can apply rules to label#label-milestone
rather than trying to hack it with a Genshi rule or something less reliable like that.
I've attached a patch that seemed to work for all fields I saw, and addressed my needs, but it's possible I missed some.
The impact is that the final HTML changes like so:
-
.html
old new 1 1 <th class="col2"> 2 <label for="field-component">Component:</label>2 <label id="label-component" for="field-component">Component:</label> 3 3 </th> 4 4 <td class="col2"> 5 5 <select id="field-component" name="field_component"> 6 6 <option>admin/console</option><option>admin/web</option><option>attachment</option><option>database backend</option><option selected="selected">general</option><option>i18n</option><option>notification</option><option>plugin/mercurial</option><option>plugin/spamfilter</option><option>project</option><option>rendering</option><option>report system</option><option>roadmap</option><option>search system</option><option>ticket system</option><option>timeline</option><option>version control</option><option>version control/browser</option><option>version control/changeset view</option><option>version control/log view</option><option>web frontend</option><option>web frontend/mod_python</option><option>web frontend/tracd</option><option>wiki system</option>
I don't see much downside to this - it's fairly light weight and I don't see how it would get in anyone's way.
Attachments (1)
Change History (4)
by , 15 years ago
Attachment: | ticket8595.patch added |
---|
comment:1 by , 15 years ago
Cc: | added |
---|
comment:2 by , 15 years ago
That's what the site.html
template is for, see TracInterfaceCustomization. There's nothing fragile or unreliable about it.
I suggest closing as "worksforme".
comment:3 by , 15 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
I was recently trying to do a bit of CSS hacking to a local install. Part of it involved modifying the labels for certain fields but not others. It seemed like the easiest way to do it was to add IDs to the labels. That way you can apply rules to
label#label-milestone
Note that you can use something like label[for=field-milestone] { ... }
in your CSS, that works fine.
Proposed patch to add IDs to labels