consolidated player-table

to consolidate, had to move the filtering to the context instead of the template (probably the right way to do it anyway)
also switched from using display to using class to hide cells (also probably the more right/consistent way to do this)
This commit is contained in:
2021-12-10 10:18:48 -06:00
parent 66d7a1226d
commit 1d893a1d97
5 changed files with 108 additions and 126 deletions

View File

@@ -102,7 +102,13 @@ def edit_lineup(request, event_id):
f.availability = f.instance.member.availability_set.get(event_id=event_id)
# f.statline = f.instance.member.statline_set.get()
formset_lineup = [f for f in formset if f.instance.sequence]
formset_bench = [f for f in formset if f not in formset_lineup]
formset_dhd = [f for f in formset if not f.instance.sequence and f.instance.label]
return render(request, 'teamsnap/lineup.html', {'title': 'Lineup',
'event': event,
'formset': formset,
'formset_lineup': formset_lineup,
'formset_bench':formset_bench,
'formset_dhd':formset_dhd
})