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 ''
Esempio n. 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_title(context):
    # Translators: This is already translated in Django
    return get_wpadmin_settings(get_admin_site_name(context)) \
        .get('title', _('Django site admin'))
Esempio n. 4
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)
Esempio n. 5
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'))
Esempio n. 7
0
def get_menu_cls(menu, admin_site_name='admin'):
    """
    """
    return get_wpadmin_settings(admin_site_name).get('menu', {}).get(menu, None)
Esempio n. 8
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))