Ticket #3180 (new enhancement)

Opened 7 months ago

Last modified 2 months ago

Patch for allowing info in template

Reported by: trac@tigris.id.au Assigned to: coderanger
Priority: low Component: ThemeEnginePlugin
Severity: minor Keywords:
Cc: Trac Release: 0.11

Description

--- web_ui.py.orig	2008-06-13 09:58:46.000000000 +1000
+++ web_ui.py	2008-06-13 09:58:51.000000000 +1000
@@ -40,4 +40,6 @@
             add_stylesheet(req, 'theme/'+theme['css'])
         if theme and 'template' in theme:
             req.chrome['theme'] = os.path.basename(theme['template'])
+        if theme:
+            req.chrome['theme_info'] = theme
         return template, data, content_type

The above code block allows you to get at your theme info by using chrome['theme_info']['some_thing_you_want'] .

This allows you define extra stuff in your theme.py if you overload the get_theme_info() method, as I have done to allow for a color setting in a theme i will be uploading shortly. Without the above patch it will not be possible to use a different color of the same theme by simply putting a line in the trac.ini

It would be nice if you could apply the above patch, or have some other way of getting at the [theme] stuff from trac.ini in the template. Like how you can get at the footer/about info from there.

regards, Danial

Attachments

Change History

08/21/08 01:45:41 changed by hrj

Confirming that this works!

09/26/08 14:07:45 changed by butterflow

+1 confirms that this works and fixes #3689

10/15/08 04:24:51 changed by szabi4@gmail.com

Works here too! And fixes #3689

10/28/08 01:34:48 changed by otaku42

I can also confirm that this patch works as expected with r3416 of the theme engine plugin. As stated by others before, it also fixes #3689.


Add/Change #3180 (Patch for allowing info in template)




Change Properties
Action