Ticket #3180 (new enhancement)

Opened 5 years ago

Last modified 3 years ago

[Patch] Allow 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

t3180-info-in-template.diff (0.6 kB) - added by otaku42 on 12/02/09 16:31:13.

Change History

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

Confirming that this works!

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

+1 confirms that this works and fixes #3689

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

Works here too! And fixes #3689

10/28/08 07: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.

01/11/09 23:10:40 changed by anonymous

it works so why doesn't mr code ranger incorporate it?

01/11/09 23:12:48 changed by coderanger

Been busy ;-)

11/05/09 02:52:32 changed by rjollos

  • summary changed from Patch for allowing info in template to [Patch] Allow info in template.

12/02/09 16:31:13 changed by otaku42

  • attachment t3180-info-in-template.diff added.

12/02/09 16:54:04 changed by otaku42

The patch works fine with the current version of the 0.11 branch (r5930). I've also attached the patch, which should make it a bit easier to apply it.


Add/Change #3180 ([Patch] Allow info in template)




Change Properties
Action