From cd7c1bba21292bc9d255e03d65694586bfbbd698 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 13 Apr 2024 09:21:48 -0500 Subject: [PATCH] Rename template for grid filters (drop buefy suffix) also remove some deprecated functions --- tailbone/config.py | 21 +---- tailbone/templates/grids/buefy.mako | 2 +- tailbone/templates/grids/filters.mako | 98 ++++++++++++++------- tailbone/templates/grids/filters_buefy.mako | 70 --------------- 4 files changed, 67 insertions(+), 124 deletions(-) delete mode 100644 tailbone/templates/grids/filters_buefy.mako diff --git a/tailbone/config.py b/tailbone/config.py index 6106e87e..9326a3cb 100644 --- a/tailbone/config.py +++ b/tailbone/config.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2023 Lance Edgar +# Copyright © 2010-2024 Lance Edgar # # This file is part of Rattail. # @@ -61,25 +61,6 @@ def csrf_header_name(config): return config.get('tailbone', 'csrf_header_name', default='X-CSRF-TOKEN') -def get_buefy_version(config): - warnings.warn("get_buefy_version() is deprecated; please use " - "tailbone.util.get_libver() instead", - DeprecationWarning, stacklevel=2) - - version = config.get('tailbone', 'libver.buefy') - if version: - return version - - return config.get('tailbone', 'buefy_version', - default='latest') - - -def get_buefy_0_8(config, version=None): - warnings.warn("get_buefy_0_8() is no longer supported", - DeprecationWarning, stacklevel=2) - return False - - def global_help_url(config): return config.get('tailbone', 'global_help_url') diff --git a/tailbone/templates/grids/buefy.mako b/tailbone/templates/grids/buefy.mako index cbe33062..73c7e415 100644 --- a/tailbone/templates/grids/buefy.mako +++ b/tailbone/templates/grids/buefy.mako @@ -136,7 +136,7 @@
% if grid.filterable: ## TODO: stop using |n filter - ${grid.render_filters(template='/grids/filters_buefy.mako', allow_save_defaults=allow_save_defaults)|n} + ${grid.render_filters(allow_save_defaults=allow_save_defaults)|n} % endif
diff --git a/tailbone/templates/grids/filters.mako b/tailbone/templates/grids/filters.mako index 857f53b1..5e1fef9b 100644 --- a/tailbone/templates/grids/filters.mako +++ b/tailbone/templates/grids/filters.mako @@ -1,38 +1,70 @@ ## -*- coding: utf-8; -*- -
- ${h.form(form.action_url, method='get')} - ${h.hidden('reset-to-default-filters', value='false')} - ${h.hidden('save-current-filters-as-defaults', value='false')} +
-
- Filters - % for filtr in form.iter_filters(): - - % endfor -
+ + -
- - - - - % if allow_save_defaults and request.user: - - % endif -
+ - ${h.end_form()} -
+ + Apply Filters + + + + Add Filter + + + + + + + Default View + + + + No Filters + + + % if allow_save_defaults and request.user: + + Save Defaults + + % endif + + + + diff --git a/tailbone/templates/grids/filters_buefy.mako b/tailbone/templates/grids/filters_buefy.mako deleted file mode 100644 index 5e1fef9b..00000000 --- a/tailbone/templates/grids/filters_buefy.mako +++ /dev/null @@ -1,70 +0,0 @@ -## -*- coding: utf-8; -*- - -
- - - - - - - - Apply Filters - - - - Add Filter - - - - - - - Default View - - - - No Filters - - - % if allow_save_defaults and request.user: - - Save Defaults - - % endif - - - -