[enh] change categories_as_tabs from a list to a dict

The tab icon names are currently hard coded in the templates.
This commit lets us introduce an icon property in the future, e.g:

categories_as_tabs:
  general:
    icon: search-outline
This commit is contained in:
Martin Fischer 2022-01-04 18:00:45 +01:00
parent b38036d519
commit a4c2cfb837
7 changed files with 40 additions and 38 deletions

View file

@ -20,18 +20,18 @@ OUTPUT_FORMATS = ['html', 'csv', 'json', 'rss']
LANGUAGE_CODES = ['all'] + list(l[0] for l in languages)
OSCAR_STYLE = ('logicodev', 'logicodev-dark', 'pointhi')
SIMPLE_STYLE = ('auto', 'light', 'dark')
CATEGORIES_AS_TABS = [
'general',
'images',
'videos',
'news',
'map',
'music',
'it',
'science',
'files',
'social media',
]
CATEGORIES_AS_TABS = {
'general': {},
'images': {},
'videos': {},
'news': {},
'map': {},
'music': {},
'it': {},
'science': {},
'files': {},
'social media': {},
}
STR_TO_BOOL = {
'0': False,
'false': False,
@ -211,7 +211,7 @@ SCHEMA = {
'checker': {
'off_when_debug': SettingsValue(bool, True),
},
'categories_as_tabs': SettingsValue(list, CATEGORIES_AS_TABS),
'categories_as_tabs': SettingsValue(dict, CATEGORIES_AS_TABS),
'engines': SettingsValue(list, []),
'doi_resolvers': {},
}