#9678 closed enhancement (fixed)
Please add __class__ like __style__
Reported by: | Owned by: | ||
---|---|---|---|
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 |
||
API Changes: | |||
Internal Changes: |
Description (last modified by )
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)
Change History (10)
comment:1 by , 14 years ago
Cc: | added |
---|
comment:2 by , 14 years ago
Description: | modified (diff) |
---|---|
Milestone: | → unscheduled |
by , 13 years ago
Attachment: | trac.cssclass.patch added |
---|
patch to handle cssclass in the report view.
comment:3 by , 13 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 , 13 years ago
Milestone: | unscheduled → 0.13 |
---|---|
Owner: | set to |
Summary: | Please add __class__ like __style → Please 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 , 13 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 , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
… and documented in 0.13/TracReports@2.
comment:7 by , 13 years ago
Owner: | changed from | to
---|
comment:8 by , 12 years ago
Release Notes: | modified (diff) |
---|
comment:9 by , 12 years ago
Release Notes: | modified (diff) |
---|
PatchWelcome (+WikiFormatting#FontStyles)