Gitlab CSE Unil

context_processors.py 1.13 KB
Newer Older
Julien Furrer's avatar
Julien Furrer committed
1
2
3
4
5
6
7
8
9
10
# coding=utf-8
from __future__ import unicode_literals
from django.conf import settings


def default(request):
    """Add somr settings values to the context."""
    context_extras = {}

    context_extras.update({
11
        'UPLOAD_MAX_FILESIZE': settings.ADIM_UPLOAD_MAX_FILESIZE,
Julien Furrer's avatar
Julien Furrer committed
12
        'THUMB_SIZE': settings.ADIM_THUMB_SIZE,
13
        'JS_MIN': '' if settings.ADIM_DEBUG_JS and not settings.ADIM_PROD else '.min',
14
15
        'PROD': settings.ADIM_PROD,
        'AAI_CFG': getattr(settings, 'AAI', {'SLO': False})
Julien Furrer's avatar
Julien Furrer committed
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
    })

    # try:
    #     context_extras.update({
    #         'JS_OPTIMIZED': settings.THKCLD_JS_OPTIMIZED,
    #         'JS_OPTIMIZED_SUFFIX': settings.THKCLD_JS_OPTIMIZED_SUFFIX if settings.THKCLD_JS_OPTIMIZED else "",
    #         'CSS_OPTIMIZED': settings.THKCLD_CSS_OPTIMIZED,
    #     })
    # except AttributeError:
    #     pass
    #
    # try:
    #     if settings.GIT_DISPLAY_COMMIT:
    #         context_extras.update({
    #             'GIT_LAST_COMMIT': settings.GIT_LAST_COMMIT,
    #             'GIT_BRANCH': settings.GIT_BRANCH,
    #         })
    # except AttributeError:
    #     pass


    return context_extras