From 2332cae09bf5ae52b526aa1d16dc00d82149f246 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 19 Mar 2021 10:39:25 -0500 Subject: [PATCH] Expose the new `Store.archived` flag --- tailbone/views/stores.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tailbone/views/stores.py b/tailbone/views/stores.py index a4c4d549..b3107a83 100644 --- a/tailbone/views/stores.py +++ b/tailbone/views/stores.py @@ -56,6 +56,7 @@ class StoreView(MasterView): 'phone', 'email', 'database_key', + 'archived', ] labels = { @@ -80,6 +81,10 @@ class StoreView(MasterView): g.filters['name'].default_active = True g.filters['name'].default_verb = 'contains' + # archived + g.filters['archived'].default_active = True + g.filters['archived'].default_verb = 'is_false_null' + g.set_sorter('phone', model.StorePhoneNumber.number) g.set_sorter('email', model.StoreEmailAddress.address) g.set_sort_defaults('id') @@ -87,6 +92,10 @@ class StoreView(MasterView): g.set_link('id') g.set_link('name') + def grid_extra_class(self, store, i): + if store.archived: + return 'warning' + def configure_form(self, f): super(StoreView, self).configure_form(f)