From e9976635ba8742bb5116b76175f4979edcda84a8 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 8 May 2019 17:13:01 -0500 Subject: [PATCH] Align pseudo-columns for grid filters; let app settings define widths --- tailbone/subscribers.py | 11 +++++++++++ tailbone/templates/grids/buefy.mako | 7 ++++--- tailbone/templates/themes/falafel/base.mako | 10 ++++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/tailbone/subscribers.py b/tailbone/subscribers.py index ff4527e7..7d81b5b1 100644 --- a/tailbone/subscribers.py +++ b/tailbone/subscribers.py @@ -132,6 +132,17 @@ def before_render(event): renderer_globals['background_color'] = request.rattail_config.get( 'tailbone', 'background_color') + # here we globally declare widths for grid filter pseudo-columns + widths = request.rattail_config.get('tailbone', 'grids.filters.column_widths') + if widths: + widths = widths.split(';') + if len(widths) < 2: + widths = None + if not widths: + widths = ['15em', '15em'] + renderer_globals['filter_fieldname_width'] = widths[0] + renderer_globals['filter_verb_width'] = widths[1] + def add_inbox_count(event): """ diff --git a/tailbone/templates/grids/buefy.mako b/tailbone/templates/grids/buefy.mako index b56ddcae..220bb020 100644 --- a/tailbone/templates/grids/buefy.mako +++ b/tailbone/templates/grids/buefy.mako @@ -5,7 +5,7 @@
-
+
@@ -16,10 +16,11 @@
- + + @input="focusValue()" + class="filter-verb">