def media(self): media = super(AuthorAdmin, self).media + Media( js = get_theme_files(settings.SUMMERNOTE_THEME, 'base_js'), css = { 'all': get_theme_files(settings.SUMMERNOTE_THEME, 'base_css'), }) return media
def update_config(self): self.theme = getattr(django_settings, 'SUMMERNOTE_THEME', 'bs3') DEFAULT_CONFIG = self.get_default_config() CONFIG = getattr(django_settings, 'SUMMERNOTE_CONFIG', {}) for key in ('base_css', 'base_js', 'default_css', 'default_js'): CONFIG[key] = get_theme_files(self.theme, key) self.config = DEFAULT_CONFIG.copy() self.config.update(CONFIG) self._copy_old_configs(CONFIG, DEFAULT_CONFIG)
def update_config(self): self.theme = getattr(django_settings, 'SUMMERNOTE_THEME', 'bs3') DEFAULT_CONFIG = self.get_default_config() CONFIG = getattr(django_settings, 'SUMMERNOTE_CONFIG', {}) for key in ('base_css', 'base_js', 'default_css', 'default_js'): CONFIG[key] = get_theme_files(self.theme, key) self.config = DEFAULT_CONFIG.copy() self.config.update(CONFIG) self._copy_old_configs(CONFIG, DEFAULT_CONFIG)