snapshot: preserve state before onboarding field parity and refactor slice
This commit is contained in:
@@ -3167,11 +3167,31 @@ def intro_builder_page(request):
|
||||
]
|
||||
|
||||
items = list(IntroChecklistItem.objects.all().order_by('section', 'sort_order', 'label'))
|
||||
section_label_map = dict(_translate_choice_list(IntroChecklistItem.SECTION_CHOICES))
|
||||
grouped_items = []
|
||||
for value, _label in IntroChecklistItem.SECTION_CHOICES:
|
||||
section_items = [item for item in items if item.section == value]
|
||||
grouped_items.append(
|
||||
{
|
||||
'key': value,
|
||||
'label': section_label_map.get(value, value),
|
||||
'items': section_items,
|
||||
'count': len(section_items),
|
||||
'active_count': len([item for item in section_items if item.is_active]),
|
||||
}
|
||||
)
|
||||
return render(
|
||||
request,
|
||||
'workflows/intro_builder.html',
|
||||
{
|
||||
'items': items,
|
||||
'grouped_items': grouped_items,
|
||||
'intro_summary': {
|
||||
'total_items': len(items),
|
||||
'active_items': len([item for item in items if item.is_active]),
|
||||
'conditional_items': len([item for item in items if item.condition_operator != 'always']),
|
||||
'section_count': len([group for group in grouped_items if group['count']]),
|
||||
},
|
||||
'section_choices': _translate_choice_list(IntroChecklistItem.SECTION_CHOICES),
|
||||
'operator_choices': _translate_choice_list(IntroChecklistItem.OPERATOR_CHOICES),
|
||||
'condition_field_choices': condition_field_choices,
|
||||
|
||||
Reference in New Issue
Block a user