scripts/wiki/patches/moin1.9.2-theme-vhost.patch
Antoine Durand-Gasselin a7a85ff7ec [wiki/patches] patches pour lee moinmoin du crans
Ces patches sont pour la version 1.9.2 de moinmoin
Pour le moinmoin du crans, récupérer les ressources statiques dans git et appliquer les patches
Actuellement, on est encore sur le paquet custom du crans, mais avec les ressources statiques du git. On migrera sans doute un peu avant squeeze ?

darcs-hash:20100908115755-bd074-f9fb78bcf8e62e8cee632acffe65b6d0d83907ab.gz
2010-09-08 13:57:55 +02:00

31 lines
1.2 KiB
Diff

--- a/MoinMoin/config/multiconfig.py 2010-04-03 16:28:21.000000000 +0200
+++ b/MoinMoin/config/multiconfig.py 2010-06-03 18:27:43.000000000 +0200
@@ -855,6 +855,7 @@
('theme_default', 'modernized',
"the name of the theme that is used by default (see HelpOnThemes)"),
+ ('theme_vhost', {}, "If a key matches the vhost, forces its value as the theme."),
('theme_force', False,
"if True, do not allow to change the theme"),
--- a/MoinMoin/web/contexts.py 2010-06-03 18:29:00.000000000 +0200
+++ b/MoinMoin/web/contexts.py 2010-06-03 18:42:47.000000000 +0200
@@ -10,7 +10,7 @@
import time, inspect, StringIO, sys, warnings
-from werkzeug import Headers, http_date, create_environ, redirect, abort
+from werkzeug import Headers, http_date, create_environ, redirect, abort, get_host
from werkzeug.exceptions import Unauthorized, NotFound
from MoinMoin import i18n, error, user, config, wikiutil
@@ -184,6 +184,9 @@
theme_name = self.cfg.theme_default
else:
theme_name = self.user.theme_name
+ ### HACK SAUVAGE 1/1
+ theme_name = self.cfg.theme_vhost.get(get_host(self.environ), theme_name)
+ ### FIN HACK 1/1
load_theme_fallback(self, theme_name)