Add basic Buefy support for App Settings page

also various buttons have been tweaked on some other "master view" pages
This commit is contained in:
Lance Edgar 2019-04-17 14:55:27 -05:00
parent e1ff4578e9
commit fcfc8b56bb
13 changed files with 245 additions and 52 deletions

View file

@ -251,25 +251,6 @@ class MasterView(View):
labels.update(cls.row_labels)
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)
##############################
# Available Views
##############################
@ -368,6 +349,8 @@ class MasterView(View):
defaults = {
'model_class': getattr(self, 'model_class', None),
'model_title': self.get_model_title(),
'model_title_plural': self.get_model_title_plural(),
'width': 'full',
'filterable': self.filterable,
'use_byte_string_filters': self.use_byte_string_filters,