From 77eeb63b62fb806fdb0b2c5017bc2b81a52228d8 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 1 Jun 2024 17:46:35 -0500 Subject: [PATCH] Add styling for checked grid rows, per oruga/butterball --- tailbone/templates/grids/complete.mako | 9 ++++--- .../templates/themes/butterball/base.mako | 25 +++++++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/tailbone/templates/grids/complete.mako b/tailbone/templates/grids/complete.mako index a54cc127..e200cdc3 100644 --- a/tailbone/templates/grids/complete.mako +++ b/tailbone/templates/grids/complete.mako @@ -44,6 +44,9 @@ :data="visibleData" :loading="loading" :row-class="getRowClass" + % if request.use_oruga: + tr-checked-class="is-checked" + % endif % if request.rattail_config.getbool('tailbone', 'sticky_headers'): sticky-header @@ -58,9 +61,9 @@ % else: :checked-rows.sync="checkedRows" % endif - % if grid.clicking_row_checks_box: - @click="rowClick" - % endif + % if grid.clicking_row_checks_box: + @click="rowClick" + % endif % endif % if grid.check_handler: diff --git a/tailbone/templates/themes/butterball/base.mako b/tailbone/templates/themes/butterball/base.mako index ba0f64ba..7a27c0ed 100644 --- a/tailbone/templates/themes/butterball/base.mako +++ b/tailbone/templates/themes/butterball/base.mako @@ -242,6 +242,31 @@ white-space: nowrap; } + /************************************************** + * grid rows which are "checked" (selected) + **************************************************/ + + /* TODO: this references some color values, whereas it would be preferable + * to refer to some sort of "state" instead, color of which was + * configurable. b/c these are just the default Buefy theme colors. */ + + tr.is-checked { + background-color: #7957d5; + color: white; + } + + tr.is-checked:hover { + color: #363636; + } + + tr.is-checked a { + color: white; + } + + tr.is-checked:hover a { + color: #7957d5; + } + /* ****************************** */ /* forms */ /* ****************************** */