More tweaks for Buefy support

This commit is contained in:
Lance Edgar 2019-04-15 20:34:34 -05:00
parent 4a92b05b57
commit e45dfd7351
7 changed files with 15 additions and 18 deletions

View file

@ -959,7 +959,7 @@ class Grid(object):
'valueless_verbs': valueless,
'verb_labels': filtr.verb_labels,
'verb': filtr.verb or filtr.default_verb or filtr.verbs[0],
'value': filtr.value,
'value': six.text_type(filtr.value) if filtr.value is not None else "",
}
return data
@ -1088,12 +1088,12 @@ class Grid(object):
# leverage configured rendering logic where applicable;
# otherwise use "raw" data value as string
if self.renderers and name in self.renderers:
row[name] = self.renderers[name](rowobj, name)
value = self.renderers[name](rowobj, name)
else:
value = self.obtain_value(rowobj, name)
if value is None:
value = ""
row[name] = six.text_type(value)
if value is None:
value = ""
row[name] = six.text_type(value)
# set action URL(s) for row, as needed
self.set_action_urls(row, rowobj, i)

View file

@ -44,11 +44,14 @@
<div style="display: flex; justify-content: space-between; margin-bottom: 0.5em;">
<div class="filters">
% if grid.filterable:
## TODO: stop using |n filter
${grid.render_filters(allow_save_defaults=allow_save_defaults)|n}
% endif
<div style="display: flex; flex-direction: column; justify-content: space-between;">
<div></div>
<div class="filters">
% if grid.filterable:
## TODO: stop using |n filter
${grid.render_filters(allow_save_defaults=allow_save_defaults)|n}
% endif
</div>
</div>
<div style="display: flex; flex-direction: column; justify-content: space-between;">
@ -107,7 +110,7 @@
% if grid.is_linked(column['field']):
<a :href="props.row._action_url_view" v-html="props.row.${column['field']}"></a>
% else:
{{ props.row.${column['field']} }}
<span v-html="props.row.${column['field']}"></span>
% endif
</b-table-column>
% endfor

View file

@ -47,7 +47,6 @@ class DataSyncChangesView(MasterView):
creatable = False
editable = False
bulk_deletable = True
use_buefy = True
grid_columns = [
'source',

View file

@ -52,7 +52,6 @@ class ProfilesView(MasterView):
pageable = False
creatable = False
deletable = False
use_buefy = True
grid_columns = [
'key',

View file

@ -122,8 +122,6 @@ class MasterView(View):
grid_index = None
use_index_links = False
# this should be turned on per-view as progress is made
use_buefy = False
has_versions = False
help_url = None
@ -254,7 +252,7 @@ class MasterView(View):
return labels
def get_use_buefy(self):
return self.use_buefy and self.rattail_config.getbool('tailbone', 'grids.use_buefy')
return self.rattail_config.getbool('tailbone', 'grids.use_buefy', default=False)
##############################
# Available Views

View file

@ -42,7 +42,6 @@ class TablesView(MasterView):
viewable = False
filterable = False
pageable = False
use_buefy = True
grid_columns = [
'name',

View file

@ -68,7 +68,6 @@ class UpgradeView(MasterView):
executable = True
execute_progress_template = '/upgrade.mako'
execute_progress_initial_msg = "Upgrading"
use_buefy = True
labels = {
'executed_by': "Executed by",