def plugin_data(self): return { "contentCacheKey": ContentCacheKey.get_cache_key(), "languageGlobals": self.language_globals(), "oidcProviderEnabled": OIDCProviderHook().is_enabled, "kolibriTheme": ThemeHook().theme, }
def kolibri_content_cache_key(): js = """ <script> var contentCacheKey = '{cache_key}'; </script> """.format(cache_key=ContentCacheKey.get_cache_key(), ) return mark_safe(js)
def plugin_data(self): language_code = get_language() static_root = static("assets/fonts/noto-full") full_file = "{}.{}.{}.css?v={}" return { "fullCSSFileModern": full_file.format( static_root, language_code, "modern", kolibri.__version__ ), "fullCSSFileBasic": full_file.format( static_root, language_code, "basic", kolibri.__version__ ), "allowRemoteAccess": allow_other_browsers_to_connect() or not interface.enabled, "appCapabilities": interface.capabilities, "contentCacheKey": ContentCacheKey.get_cache_key(), "languageGlobals": self.language_globals(), "oidcProviderEnabled": OIDCProviderHook.is_enabled(), "kolibriTheme": ThemeHook.get_theme(), }
def plugin_data(self): language_code = get_language() static_root = static("assets/fonts/noto-full") full_file = "{}.{}.{}.css?v={}" return { "fullCSSFileModern": full_file.format(static_root, language_code, "modern", kolibri.__version__), "fullCSSFileBasic": full_file.format(static_root, language_code, "basic", kolibri.__version__), "contentCacheKey": ContentCacheKey.get_cache_key(), "languageGlobals": self.language_globals(), "oidcProviderEnabled": OIDCProviderHook.is_enabled(), "kolibriTheme": ThemeHook.get_theme(), }
def get_cache_key(*args, **kwargs): return str(ContentCacheKey.get_cache_key())
def calculate_spa_etag(*args, **kwargs): return hashlib.md5( kolibri_version.encode("utf-8") + str(ContentCacheKey.get_cache_key()).encode("utf-8") + str(ThemeHook.cacheKey()).encode("utf-8") ).hexdigest()