2 from django
.conf
import settings
4 from gitology
.config
import settings
as gsettings
6 # context_processor # {{{
7 def context_processor(request
):
8 return { 'LOCAL_INSTANCE': getattr(settings
, 'LOCAL_INSTANCE', False) }
12 def select_theme(view_func
):
13 def wrapped(request
, *args
, **kw
):
14 if request
.GET
.get("theme"):
15 gsettings
.threadlocal
.theme
= request
.GET
["theme"]
16 elif "THEME" in request
.COOKIES
:
17 gsettings
.threadlocal
.theme
= request
.COOKIES
["THEME"]
18 elif "THEME" in request
.session
:
19 gsettings
.threadlocal
.theme
= request
.session
["THEME"]
20 elif "THEME" in gsettings
.DEFAULTS
:
21 gsettings
.threadlocal
.theme
= gsettings
.DEFAULTS
.THEME
22 return view_func(request
, *args
, **kw
)
23 wrapped
.__doc
__ = view_func
.__doc
__
24 wrapped
.__dict
__ = view_func
.__dict
__
30 1:'january', 2:'february', 3:'march', 4:'april', 5:'may', 6:'june',
31 7:'july', 8:'august', 9:'september', 10:'october', 11:'november',