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, 'valueless_verbs': valueless,
'verb_labels': filtr.verb_labels, 'verb_labels': filtr.verb_labels,
'verb': filtr.verb or filtr.default_verb or filtr.verbs[0], '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 return data
@ -1088,12 +1088,12 @@ class Grid(object):
# leverage configured rendering logic where applicable; # leverage configured rendering logic where applicable;
# otherwise use "raw" data value as string # otherwise use "raw" data value as string
if self.renderers and name in self.renderers: if self.renderers and name in self.renderers:
row[name] = self.renderers[name](rowobj, name) value = self.renderers[name](rowobj, name)
else: else:
value = self.obtain_value(rowobj, name) value = self.obtain_value(rowobj, name)
if value is None: if value is None:
value = "" value = ""
row[name] = six.text_type(value) row[name] = six.text_type(value)
# set action URL(s) for row, as needed # set action URL(s) for row, as needed
self.set_action_urls(row, rowobj, i) 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 style="display: flex; justify-content: space-between; margin-bottom: 0.5em;">
<div class="filters"> <div style="display: flex; flex-direction: column; justify-content: space-between;">
% if grid.filterable: <div></div>
## TODO: stop using |n filter <div class="filters">
${grid.render_filters(allow_save_defaults=allow_save_defaults)|n} % if grid.filterable:
% endif ## TODO: stop using |n filter
${grid.render_filters(allow_save_defaults=allow_save_defaults)|n}
% endif
</div>
</div> </div>
<div style="display: flex; flex-direction: column; justify-content: space-between;"> <div style="display: flex; flex-direction: column; justify-content: space-between;">
@ -107,7 +110,7 @@
% if grid.is_linked(column['field']): % if grid.is_linked(column['field']):
<a :href="props.row._action_url_view" v-html="props.row.${column['field']}"></a> <a :href="props.row._action_url_view" v-html="props.row.${column['field']}"></a>
% else: % else:
{{ props.row.${column['field']} }} <span v-html="props.row.${column['field']}"></span>
% endif % endif
</b-table-column> </b-table-column>
% endfor % endfor

View file

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

View file

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

View file

@ -122,8 +122,6 @@ class MasterView(View):
grid_index = None grid_index = None
use_index_links = False use_index_links = False
# this should be turned on per-view as progress is made
use_buefy = False
has_versions = False has_versions = False
help_url = None help_url = None
@ -254,7 +252,7 @@ class MasterView(View):
return labels return labels
def get_use_buefy(self): 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 # Available Views

View file

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

View file

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