wiki:ContextChromePlugin

Version 26 (modified by figaro, 9 years ago) (diff)

Cosmetic changes, tagged with license

Add context-aware CSS attribute

Description

  1. Wiki Link Decoration by age of wiki page ... add "new" css-class to link to wiki page that is young. You can specify ages at trac.ini.
  2. Decayed Wiki ... Indicate how old the wiki page is. You can specify colors by age in seconds at trac.ini. (so far this feature requires python 2.7 or leter.)
  3. Ticket Link Decoration by field value ... Set css-class to link to tickets by field value. You can specify field names at trac.ini.
    1. you can decorate over intertrac links, with XmlRpcPlugin and corsEnabler included.
  4. Ticket color by Type ... Set css-class by type or specified field value on ticket. You can design for each type of ticket with trac:wiki:CookBook/SiteStyleCss feature.
  5. Wiki color by tags ... Set css-class by tags added by TagsPlugin.
  6. marked for validation ... set css-class to field specified by validator (TracTicketValidatorPlugin or TracTicketConditionalValidatePlugin).

If you want to edit the CSS on browser, use WikiCssPlugin or ThemeEnginePlugin.
If you want to modify decoration link to new page, edit site.html and site.css.

Bugs/Feature Requests

Existing bugs and feature requests for ContextChromePlugin are here.

If you have any issues, create a new ticket.

defect

4 / 4

enhancement

2 / 2

Download

Download the zipped source from [download:contextchromeplugin here].

Source

You can check out ContextChromePlugin from here using Subversion, or browse the source with Trac.

Example

Sample trac.ini:

[components]
contextchrome.linkdeco.internalstylesheet = enabled
contextchrome.linkdeco.ticketlinkdecorator = enabled
contextchrome.linkdeco.wikilinknewdecolator = enabled
contextchrome.style.typeclasstoticket = enabled
decayed.wiki.decayedwiki = enabled

Wiki age to decorate or not

Example trac.ini:

[wiki]
wiki_new_info_second = 432000

Decayed Wiki

Sample trac.ini:

[wiki]
decay_colors = 86400:#ffffff, 604800:#eeeeee, 2678400:#dddddd, 31536000:#aaaaaa, 2147483647: #777777

background of wiki pages are colored by age, white for modified in a day, light grey for in a week, and so on.

Ticket link decoration by field value

Sample trac.ini:

[ticket]
decorate_fields = owner, milestone, type

Sample style.css:

a.type_is_defect      { background-color: #f5deb3; /* wheat */    }
a.type_is_enhancement { background-color: #87ceeb; /* sky blue */ }
a.type_is_task        { background-color: #ffd700; /* gold */     }
a.owner_is_somebody   { border: maroon thin solid;                }

To decorate over intertrac links, use XmlRpcPlugin and CrossOriginResourceSharingEnabler as follows:

Ticket color by Type

Sample style.css:

body.type_is_defect      { background-color: #f5deb3; /* wheat */    }
body.type_is_enhancement { background-color: #87ceeb; /* sky blue */ }
body.type_is_task        { background-color: #ffd700; /* gold */     }
body.tagged_as_sometag   { background-color: #ffcccc;                }

Marked for validation

Enable required TracTicketValidatorPlugin.

Sample trac.ini:

[ticketvalidator]
validates = keywords, vote
keywords.rule = .+
vote.rule = .+

Recent Changes

17546 by matobaa on 2019-10-19 10:34:22
ContextChromePlugin: cosmetic changes
17535 by matobaa on 2019-10-01 16:21:17
ContextChromePlugin: support Trac 1.4+ by Jinja2 template
16959 by matobaa on 2017-11-06 03:17:17
Fixes #13317; a bug of TracLinksPlugin, by ContextChromePlugin
(more)

Author/Contributors

Author: matobaa
Maintainer: matobaa
Contributors:

Attachments (5)

Download all attachments as: .zip