Modify

Opened 16 years ago

Closed 10 years ago

#3180 closed enhancement (fixed)

[Patch] Allow info in template

Reported by: Danial Pearce Owned by: Olemis Lang
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 (1)

t3180-info-in-template.diff (629 bytes) - added by Michael Renzmann 14 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 16 years ago by hrj

Confirming that this works!

comment:2 Changed 16 years ago by JaeWook Choi

+1 confirms that this works and fixes #3689

comment:3 Changed 15 years ago by szabi4@…

Works here too! And fixes #3689

comment:4 Changed 15 years ago by Michael Renzmann

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.

comment:5 Changed 15 years ago by anonymous

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

comment:6 Changed 15 years ago by Noah Kantrowitz

Been busy ;-)

comment:7 Changed 14 years ago by Ryan J Ollos

Summary: Patch for allowing info in template[Patch] Allow info in template

Changed 14 years ago by Michael Renzmann

Attachment: t3180-info-in-template.diff added

comment:8 Changed 14 years ago by Michael Renzmann

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.

comment:9 Changed 10 years ago by Olemis Lang

Owner: changed from Noah Kantrowitz to Olemis Lang

comment:10 Changed 10 years ago by Olemis Lang

Resolution: fixed
Status: newclosed

In 13519:

ThemeEnginePlugin [ close #3180 ] : Theme info added in reqtheme_info?

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Olemis Lang.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.