summaryrefslogtreecommitdiff
path: root/meetingtools/context_processors.py
blob: f20b3fbf8b301a2eee0eafcb798994231b250d30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from utils import base_url

__author__ = 'leifj'

from django.conf import settings

def theme(request):

    def _w(x):
        return {'theme': x}

    vhost = request.get_host()
    vhost = vhost.replace(':','_')

    ctx = {'vhost': vhost}
    if hasattr(settings,'THEMES'):
        if settings.THEMES.has_key(vhost):
            ctx.update(settings.THEMES[vhost])
        elif settings.THEMES.has_key('__default__'):
            ctx.update(settings.THEMES['__default__'])

    return _w(ctx)

def misc_urls(request):
    return {'LOGIN_URL': settings.LOGIN_URL,'BASE_URL':base_url(request)}

def request(request):
    return {'request': request}