backoffice: omit filtered fields from detailed statistics (#6890)
This commit is contained in:
parent
39896c1869
commit
9195b848bc
|
@ -1133,7 +1133,14 @@ class FormPage(Directory):
|
|||
r += htmltext('</ul>')
|
||||
r += htmltext('</div>')
|
||||
|
||||
stats_for_fields = self.stats_fields(values)
|
||||
excluded_fields = []
|
||||
for criteria in criterias:
|
||||
if not isinstance(criteria, Equal):
|
||||
continue
|
||||
excluded_fields.append(criteria.attribute[1:])
|
||||
|
||||
stats_for_fields = self.stats_fields(values,
|
||||
excluded_fields=excluded_fields)
|
||||
if stats_for_fields:
|
||||
r += htmltext('<div class="bo-block">')
|
||||
r += stats_for_fields
|
||||
|
@ -1171,12 +1178,14 @@ class FormPage(Directory):
|
|||
|
||||
return page.getvalue()
|
||||
|
||||
def stats_fields(self, values):
|
||||
def stats_fields(self, values, excluded_fields=None):
|
||||
r = TemplateIO(html=True)
|
||||
had_page = False
|
||||
last_page = None
|
||||
last_title = None
|
||||
for f in self.formdef.fields:
|
||||
if excluded_fields and f.id in excluded_fields:
|
||||
continue
|
||||
if f.type == 'page':
|
||||
last_page = f.label
|
||||
last_title = None
|
||||
|
|
Loading…
Reference in New Issue