Align pseudo-columns for grid filters; let app settings define widths

This commit is contained in:
Lance Edgar 2019-05-08 17:13:01 -05:00
parent 079680d72e
commit e9976635ba
3 changed files with 25 additions and 3 deletions

View file

@ -132,6 +132,17 @@ def before_render(event):
renderer_globals['background_color'] = request.rattail_config.get( renderer_globals['background_color'] = request.rattail_config.get(
'tailbone', 'background_color') '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): def add_inbox_count(event):
""" """

View file

@ -5,7 +5,7 @@
<div class="level filter" v-show="filter.visible"> <div class="level filter" v-show="filter.visible">
<div class="level-left"> <div class="level-left">
<div class="level-item"> <div class="level-item filter-fieldname">
<b-field> <b-field>
<b-checkbox-button v-model="filter.active" native-value="IGNORED"> <b-checkbox-button v-model="filter.active" native-value="IGNORED">
@ -16,10 +16,11 @@
</div> </div>
<b-field grouped v-show="filter.active" custom-class="level-item"> <b-field grouped v-show="filter.active" class="level-item">
<b-select v-model="filter.verb" <b-select v-model="filter.verb"
@input="focusValue()"> @input="focusValue()"
class="filter-verb">
<option v-for="verb in filter.verbs" <option v-for="verb in filter.verbs"
:key="verb" :key="verb"
:value="verb"> :value="verb">

View file

@ -338,6 +338,16 @@
${h.stylesheet_link(request.static_url('tailbone:static/themes/falafel/css/filters.css') + '?ver={}'.format(tailbone.__version__))} ${h.stylesheet_link(request.static_url('tailbone:static/themes/falafel/css/filters.css') + '?ver={}'.format(tailbone.__version__))}
${h.stylesheet_link(request.static_url('tailbone:static/themes/bobcat/css/forms.css') + '?ver={}'.format(tailbone.__version__))} ${h.stylesheet_link(request.static_url('tailbone:static/themes/bobcat/css/forms.css') + '?ver={}'.format(tailbone.__version__))}
${h.stylesheet_link(request.static_url('tailbone:static/css/diffs.css') + '?ver={}'.format(tailbone.__version__))} ${h.stylesheet_link(request.static_url('tailbone:static/css/diffs.css') + '?ver={}'.format(tailbone.__version__))}
<style type="text/css">
.filters .filter-fieldname {
min-width: ${filter_fieldname_width};
justify-content: left;
}
.filters .filter-verb {
min-width: ${filter_verb_width};
}
</style>
</%def> </%def>
<%def name="buefy_styles()"> <%def name="buefy_styles()">