fix: merge filters into main grid template
to better match wuttaweb
This commit is contained in:
parent
cea3e4b927
commit
37f760959d
3 changed files with 64 additions and 91 deletions
|
@ -1318,28 +1318,6 @@ class Grid(WuttaGrid):
|
|||
|
||||
return data
|
||||
|
||||
def render_filters(self, template='/grids/filters.mako', **kwargs):
|
||||
"""
|
||||
Render the filters to a Unicode string, using the specified template.
|
||||
Additional kwargs are passed along as context to the template.
|
||||
"""
|
||||
# Provide default data to filters form, so renderer can do some of the
|
||||
# work for us.
|
||||
data = {}
|
||||
for filtr in self.iter_active_filters():
|
||||
data['{}.active'.format(filtr.key)] = filtr.active
|
||||
data['{}.verb'.format(filtr.key)] = filtr.verb
|
||||
data[filtr.key] = filtr.value
|
||||
|
||||
form = gridfilters.GridFiltersForm(self.filters,
|
||||
request=self.request,
|
||||
defaults=data)
|
||||
|
||||
kwargs['request'] = self.request
|
||||
kwargs['grid'] = self
|
||||
kwargs['form'] = form
|
||||
return render(template, kwargs)
|
||||
|
||||
def render_actions(self, row, i): # pragma: no cover
|
||||
""" """
|
||||
warnings.warn("grid.render_actions() is deprecated!",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue