Add the ViewSupplement concept
also fix cell-class for grid columns. cannot use "raw" fieldname because in some cases (e.g. 'number', 'rate') Bulma may interpret that as actually meaning something, and affect the display
This commit is contained in:
parent
1a51f3d854
commit
d5d9c644a2
9 changed files with 153 additions and 14 deletions
|
@ -177,6 +177,7 @@ def make_pyramid_config(settings, configure_csrf=True):
|
|||
# and some similar magic for certain master views
|
||||
config.add_directive('add_tailbone_index_page', 'tailbone.app.add_index_page')
|
||||
config.add_directive('add_tailbone_config_page', 'tailbone.app.add_config_page')
|
||||
config.add_directive('add_tailbone_view_supplement', 'tailbone.app.add_view_supplement')
|
||||
|
||||
config.add_directive('add_tailbone_websocket', 'tailbone.app.add_websocket')
|
||||
|
||||
|
@ -239,6 +240,17 @@ def add_config_page(config, route_name, label, permission):
|
|||
config.action(None, action)
|
||||
|
||||
|
||||
def add_view_supplement(config, route_prefix, cls):
|
||||
"""
|
||||
Register a master view supplement for the app.
|
||||
"""
|
||||
def action():
|
||||
supplements = config.get_settings().get('tailbone_view_supplements', {})
|
||||
supplements.setdefault(route_prefix, []).append(cls)
|
||||
config.add_settings({'tailbone_view_supplements': supplements})
|
||||
config.action(None, action)
|
||||
|
||||
|
||||
def establish_theme(settings):
|
||||
rattail_config = settings['rattail_config']
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue