Edgewall Software
Modify

Opened 10 years ago

Closed 9 years ago

Last modified 8 years ago

#9678 closed enhancement (fixed)

Please add __class__ like __style__

Reported by: Marthein1@… Owned by: matthew.schnee@…
Priority: normal Milestone: 1.0
Component: report system Version: 0.12-stable
Severity: normal Keywords:
Cc: trac@… Branch:
Release Notes:

In TracReports, add special column __class__ for defining zero or more space-separated CSS class names to be set on the <tr> element of the current row

API Changes:
Internal Changes:

Description (last modified by Christian Boos)

For a clearer view of the ticket, I would like to add html classes to report rows.

This would be possible with a __class__ tag, similar to the __style__ tag. One could then output for example 'status AS __class__' and change report.css to display other colors/pictures, etc for example when status == closed.

Attachments (1)

trac.cssclass.patch (2.8 KB ) - added by matthew.schnee@… 9 years ago.
patch to handle cssclass in the report view.

Download all attachments as: .zip

Change History (10)

comment:1 by Reinder <trac@…>, 10 years ago

Cc: trac@… added

comment:2 by Christian Boos, 10 years ago

Description: modified (diff)
Milestone: unscheduled

by matthew.schnee@…, 9 years ago

Attachment: trac.cssclass.patch added

patch to handle cssclass in the report view.

comment:3 by matthew.schnee@…, 9 years ago

I have attached a patch to this ticket which implements this feature request. We started using Trac recently where I work, and we've been customizing it pretty heavily in order to add some flexibility to the report views, considering we use some pretty complicated workflow targets that are nice to have visual representation- using __color__ by default applies styles that can override text color, font-weight, and a bunch of other styles (because they're applied by css to the TD element, overwriting your TR style attribute).

A couple of caveats for you:

  • The implementation uses __cssclass__ instead of __class__ as was requested. __class__ is a magic attribute in Python.
  • __cssclass__, like __style__ and __color__ apply to the TR element, and not to any TD or child-elements. Your css selectors should reflect this. I've updated the default TracReport wikipage in the source to clarify this as well.

Follow the Trac Install wiki section on Site Appearance guide for adding a link to your custom css file.

comment:4 by Remy Blank, 9 years ago

Milestone: unscheduled0.13
Owner: set to Remy Blank
Summary: Please add __class__ like __stylePlease add __class__ like __style__

Thanks for the patch. __class__ is probably ok, even though it's a "magic attribute" in Python. The name is never used in a Python context.

comment:5 by Remy Blank, 9 years ago

Well, ok, technically __class__ is used in a Python context, but it's easy to work around ;)

Slightly refactored patch (using __class__) applied in [10822]. Thanks!

comment:6 by Remy Blank, 9 years ago

Resolution: fixed
Status: newclosed

… and documented in 0.13/TracReports@2.

comment:7 by Remy Blank, 9 years ago

Owner: changed from Remy Blank to matthew.schnee@…

comment:8 by Christian Boos, 8 years ago

Release Notes: modified (diff)

comment:9 by Remy Blank, 8 years ago

Release Notes: modified (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain matthew.schnee@….
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from matthew.schnee@… 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.