from onegov.core import Framework, utils
from onegov.file import DepotApp
from onegov.onboarding.theme import OnboardingTheme
from onegov.reservation import LibresIntegration
from onegov.search import ElasticsearchApp
from typing import Any, TYPE_CHECKING
if TYPE_CHECKING:
from collections.abc import Iterator
[docs]
class OnboardingApp(Framework, LibresIntegration, DepotApp, ElasticsearchApp):
[docs]
serve_static_files = True
@OnboardingApp.static_directory()
[docs]
def get_static_directory() -> str:
return 'static'
@OnboardingApp.template_directory()
[docs]
def get_template_directory() -> str:
return 'templates'
@OnboardingApp.setting(section='core', name='theme')
[docs]
def get_theme() -> OnboardingTheme:
return OnboardingTheme()
@OnboardingApp.setting(section='i18n', name='localedirs')
[docs]
def get_i18n_localedirs() -> list[str]:
return [
utils.module_path('onegov.onboarding', 'locale'),
utils.module_path('onegov.town6', 'locale'),
utils.module_path('onegov.org', 'locale'),
utils.module_path('onegov.form', 'locale'),
utils.module_path('onegov.user', 'locale')
]
@OnboardingApp.setting(section='i18n', name='locales')
[docs]
def get_i18n_used_locales() -> set[str]:
return {'de_CH'}
@OnboardingApp.setting(section='i18n', name='default_locale')
[docs]
def get_i18n_default_locale() -> str:
return 'de_CH'
@OnboardingApp.webasset_path()
[docs]
def get_js_path() -> str:
return 'assets/js'
@OnboardingApp.webasset_output()
[docs]
def get_webasset_output() -> str:
return 'assets/bundles'
@OnboardingApp.webasset('common')
[docs]
def get_common_asset() -> 'Iterator[str]':
yield 'modernizr.js'
yield 'jquery.js'
yield 'placeholder.js'
yield 'foundation.js'
yield 'underscore.js'
yield 'colorpicker.js'
yield 'awesomeplete.js'
yield 'common.js'