Beispiel #1
0
def wpadmin_render_custom_style(context):
    custom_style_path = get_wpadmin_settings(get_admin_site_name(context)) \
        .get('custom_style', None)
    if custom_style_path:
        return f"<link type='text/css' rel='stylesheet' href='{{% static '{custom_style_path}' %}}' />"
    else:
        return ''
Beispiel #2
0
    def get_model_children(self, context):
        if not self.is_user_allowed(context.get('request').user):
            return []

        tree = get_wpadmin_settings(get_admin_site_name(context)).get('custom_menu', [])
        menu = SubModelMenu('', tree)
        menu.init_with_context(context)
        return menu.children
def wpadmin_render_custom_style(context):
    custom_style_path = get_wpadmin_settings(get_admin_site_name(context)) \
        .get('custom_style', None)
    if custom_style_path:
        return '<link type="text/css" rel="stylesheet" href="%s" />' \
            % custom_style_path
    else:
        return ''
Beispiel #4
0
def wpadmin_render_custom_style(context):
    custom_style_path = get_wpadmin_settings(get_admin_site_name(context)) \
        .get('custom_style', None)
    if custom_style_path:
        return mark_safe('<link type="text/css" rel="stylesheet" href="%s" />' \
                         % custom_style_path % custom_style_path)
    else:
        return ''
Beispiel #5
0
    def get_model_children(self, context):
        if not self.is_user_allowed(context.get('request').user):
            return []

        tree = get_wpadmin_settings(get_admin_site_name(context)).get('custom_menu', [])
        menu = SubModelMenu('', tree)
        menu.init_with_context(context)
        return menu.children
Beispiel #6
0
def wpadmin_render_custom_title(context):
    # Translators: This is already translated in Django
    return get_wpadmin_settings(get_admin_site_name(context)) \
        .get('title', context.get('site_title', _('Django site admin')))
def wpadmin_render_custom_title(context):
    # Translators: This is already translated in Django
    return get_wpadmin_settings(get_admin_site_name(context)) \
        .get('title', _('Django site admin'))
Beispiel #8
0
def get_menu_cls(menu, admin_site_name='admin'):
    """
    menu - menu name ('top' or 'left')
    """
    return get_wpadmin_settings(admin_site_name).get('menu', {}).get(menu, None)
Beispiel #9
0
def get_menu_cls(menu, admin_site_name='admin'):
    """
    menu - menu name ('top' or 'left')
    """
    return get_wpadmin_settings(admin_site_name).get('menu', {}).get(menu, None)
Beispiel #10
0
def are_breadcrumbs_enabled(admin_site_name='admin'):
    """
    """
    return get_wpadmin_settings(admin_site_name).get('dashboard', {}).get('breadcrumbs', True)
def wpadmin_render_custom_title(context):
    return get_wpadmin_settings(get_admin_site_name(context)) \
        .get('title', _('Django site admin'))
Beispiel #12
0
def get_menu_cls(menu, admin_site_name='admin'):
    """
    """
    return get_wpadmin_settings(admin_site_name).get('menu', {}).get(menu, None)
Beispiel #13
0
def _get_settings(configuration, **kwargs):
    wpconf = get_wpadmin_settings(kwargs.pop('admin_site_name', 'admin'))
    slices = configuration.split('.')
    for node in slices[:-1]:
        wpconf = wpconf.get(node, {})
    return wpconf.get(slices[-1], kwargs.pop('default', None))