Пример #1
0
def get_theme(request):

    this_theme = hz_themes.get_default_theme()
    try:
        theme = request.COOKIES[hz_themes.get_theme_cookie_name()]
        for each_theme in hz_themes.get_themes():
            if theme == each_theme[0]:
                this_theme = each_theme[0]
    except KeyError:
        pass

    return this_theme
Пример #2
0
def get_theme(request):

    this_theme = hz_themes.get_default_theme()
    try:
        theme = request.COOKIES[hz_themes.get_theme_cookie_name()]
        for each_theme in hz_themes.get_themes():
            if theme == each_theme[0]:
                this_theme = each_theme[0]
    except KeyError:
        pass

    return this_theme
Пример #3
0
def find_asset(theme, asset):

    theme_path = ''
    for name, label, path in hz_themes.get_themes():
        if theme == name:
            theme_path = path

    theme_path = os.path.join(settings.ROOT_PATH, theme_path)

    # If there is a 'static' subdir of the theme, then use
    # that as the theme's asset root path
    static_path = os.path.join(theme_path, 'static')
    if os.path.exists(static_path):
        theme_path = static_path

    # The full path to the asset requested
    asset_path = os.path.join(theme_path, asset)
    if os.path.exists(asset_path):
        return_path = os.path.join(hz_themes.get_theme_dir(), theme, asset)
    else:
        return_path = os.path.join('dashboard', asset)

    return staticfiles_storage.url(pathname2url(return_path))
Пример #4
0
def find_asset(theme, asset):

    theme_path = ''
    for name, label, path in hz_themes.get_themes():
        if theme == name:
            theme_path = path

    theme_path = os.path.join(settings.ROOT_PATH, theme_path)

    # If there is a 'static' subdir of the theme, then use
    # that as the theme's asset root path
    static_path = os.path.join(theme_path, 'static')
    if os.path.exists(static_path):
        theme_path = static_path

    # The full path to the asset requested
    asset_path = os.path.join(theme_path, asset)
    if os.path.exists(asset_path):
        return_path = os.path.join(hz_themes.get_theme_dir(), theme, asset)
    else:
        return_path = os.path.join('dashboard', asset)

    return staticfiles_storage.url(pathname2url(return_path))
Пример #5
0
def themes():
    return hz_themes.get_themes()
Пример #6
0
def themes():
    return hz_themes.get_themes()