summaryrefslogtreecommitdiff
path: root/meetingtools/context_processors.py
blob: f2848670d4f6268e914fa4713d407de62adc9c16 (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
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)}