diff --git a/tailbone/views/master.py b/tailbone/views/master.py index acda43d6..6fe4d198 100644 --- a/tailbone/views/master.py +++ b/tailbone/views/master.py @@ -252,6 +252,22 @@ class MasterView(View): return labels def get_use_buefy(self): + """ + Returns a flag indicating whether or not the current theme supports + (and therefore should use) the Buefy JS library. + """ + # first check theme-specific setting, if one has been defined + theme = self.request.registry.settings['tailbone.theme'] + buefy = self.rattail_config.getbool('tailbone', 'themes.{}.use_buefy'.format(theme)) + if buefy is not None: + return buefy + + # TODO: should not hard-code this surely, but works for now... + if theme == 'falafel': + return True + + # TODO: probably should not use this fallback? it was the first setting + # i tested with, but is poorly named to say the least return self.rattail_config.getbool('tailbone', 'grids.use_buefy', default=False) ##############################