Edgewall Software
Modify

Opened 15 years ago

Closed 14 years ago

#8595 closed enhancement (worksforme)

Add IDs to the labels in the ticket modification form

Reported by: Chris Mulligan <chris.mulligan@…> 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  
    11                <th class="col2">
    2                   <label for="field-component">Component:</label>
     2                  <label id="label-component" for="field-component">Component:</label>
    33                </th>
    44                <td class="col2">
    55                    <select id="field-component" name="field_component">
    66                      <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)

ticket8595.patch (3.0 KB ) - added by Chris Mulligan <chris.mulligan@…> 15 years ago.
Proposed patch to add IDs to labels

Download all attachments as: .zip

Change History (4)

by Chris Mulligan <chris.mulligan@…>, 15 years ago

Attachment: ticket8595.patch added

Proposed patch to add IDs to labels

comment:1 by Ryan Ollos <ryano@…>, 15 years ago

Cc: ryano@… added

comment:2 by Remy Blank, 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".

in reply to:  description comment:3 by Christian Boos, 14 years ago

Resolution: worksforme
Status: newclosed

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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.