0001-backoffice-refactor-display-of-submission-listing-sc.patch
wcs/backoffice/submission.py | ||
---|---|---|
133 | 133 | |
134 | 134 |
cats = Category.select() |
135 | 135 |
Category.sort_by_position(cats) |
136 |
one = False |
|
137 |
for c in cats: |
|
138 |
l2 = [x for x in list_forms if str(x.category_id) == str(c.id)] |
|
139 |
if l2: |
|
140 |
r += self.form_list(l2, title=c.name) |
|
141 |
one = True |
|
142 | ||
143 |
l2 = [x for x in list_forms if not x.category] |
|
144 |
if l2: |
|
145 |
if one: |
|
146 |
title = _('Misc') |
|
147 |
else: |
|
148 |
title = None |
|
149 |
r += self.form_list(l2, title=title) |
|
136 |
for cat in cats: |
|
137 |
cat.formdefs = [x for x in list_forms if str(x.category_id) == str(cat.id)] |
|
138 |
misc_cat = Category(name=_('Misc')) |
|
139 |
misc_cat.formdefs = [x for x in list_forms if not x.category] |
|
140 |
cats.append(misc_cat) |
|
141 | ||
142 |
for cat in cats: |
|
143 |
if not cat.formdefs: |
|
144 |
continue |
|
145 |
r += self.form_list(cat.formdefs, title=cat.name) |
|
150 | 146 | |
151 | 147 |
return r.getvalue() |
152 | 148 | |
153 |
- |