# Path: baton/config.py
# def get_config(key):
#     safe = ['SITE_HEADER', 'COPYRIGHT', 'POWERED_BY', ]
#     user_settings = getattr(settings, 'BATON', None)
# 
#     if user_settings is None:
#         value = default_config.get(key, None)
#     else:
#         value = user_settings.get(key, default_config.get(key, None))
# 
#     if key in safe:
#         return mark_safe(value)
# 
#     return value


import json
from django.urls import reverse
from django import template
from django.utils.html import escapejs
from django.core.exceptions import ImproperlyConfigured
from ..config import get_config
        from google.auth.transport.requests import Request
        from google.oauth2 import service_account


register = template.Library()


@register.simple_tag
def baton_config():
    conf = {
        "api": {
            "app_list": reverse('baton-app-list-json'),
            "gravatar": reverse('baton-gravatar-json'),
        },
        "confirmUnsavedChanges": get_config('CONFIRM_UNSAVED_CHANGES'),
        "showMultipartUploading": get_config('SHOW_MULTIPART_UPLOADING'),
        "enableImagesPreview": get_config('ENABLE_IMAGES_PREVIEW'),
        "changelistFiltersInModal": get_config('CHANGELIST_FILTERS_IN_MODAL'),
        "changelistFiltersAlwaysOpen": get_config('CHANGELIST_FILTERS_ALWAYS_OPEN'),
        "changelistFiltersForm": get_config('CHANGELIST_FILTERS_FORM'),
        "collapsableUserArea": get_config('COLLAPSABLE_USER_AREA'),
        "menuAlwaysCollapsed": get_config('MENU_ALWAYS_COLLAPSED'),
        "menuTitle": escapejs(get_config('MENU_TITLE')),
        "messagesToasts": get_config('MESSAGES_TOASTS'),
        "gravatarDefaultImg": get_config('GRAVATAR_DEFAULT_IMG'),
        "loginSplash": get_config('LOGIN_SPLASH'),

# Path: baton/config.py
# def get_config(key):
#     safe = ['SITE_HEADER', 'COPYRIGHT', 'POWERED_BY', ]
#     user_settings = getattr(settings, 'BATON', None)
# 
#     if user_settings is None:
#         value = default_config.get(key, None)
#     else:
#         value = user_settings.get(key, default_config.get(key, None))
# 
#     if key in safe:
#         return mark_safe(value)
# 
#     return value


# Path: baton/templatetags/baton_tags.py
import json
from django.urls import reverse
from django import template
from django.utils.html import escapejs
from django.core.exceptions import ImproperlyConfigured
from ..config import get_config
        from google.auth.transport.requests import Request
        from google.oauth2 import service_account



register = template.Library()


@register.simple_tag
def baton_config():
    conf = {
        "api": {
            "app_list": reverse('baton-app-list-json'),
            "gravatar": reverse('baton-gravatar-json'),
        },
        "confirmUnsavedChanges": get_config('CONFIRM_UNSAVED_CHANGES'),
        "showMultipartUploading": get_config('SHOW_MULTIPART_UPLOADING'),
        "enableImagesPreview": get_config('ENABLE_IMAGES_PREVIEW'),
        "changelistFiltersInModal": get_config('CHANGELIST_FILTERS_IN_MODAL'),
        "changelistFiltersAlwaysOpen": get_config('CHANGELIST_FILTERS_ALWAYS_OPEN'),
        "changelistFiltersForm": get_config('CHANGELIST_FILTERS_FORM'),
        "collapsableUserArea": get_config('COLLAPSABLE_USER_AREA'),
        "menuAlwaysCollapsed": get_config('MENU_ALWAYS_COLLAPSED'),
        "menuTitle": escapejs(get_config('MENU_TITLE')),
        "messagesToasts": get_config('MESSAGES_TOASTS'),
        "gravatarDefaultImg": get_config('GRAVATAR_DEFAULT_IMG'),
        "loginSplash": get_config('LOGIN_SPLASH'),

        "searchField": get_config('SEARCH_FIELD'),