Add a search as you type form

As in other places where we have a long list of things where you might
want to jump to a specific thing. We use this pattern where there are
more than 7 things, per the magical number 7[1]

1. https://en.wikipedia.org/wiki/The_Magical_Number_Seven,_Plus_or_Minus_Two
This commit is contained in:
Chris Hill-Scott
2020-02-28 16:14:28 +00:00
parent 74dbd2b439
commit d2d5510376
3 changed files with 98 additions and 3 deletions

View File

@@ -143,6 +143,7 @@ def organisation_dashboard(org_id):
end=current_financial_year + 1,
),
selected_year=year,
search_form=SearchByNameForm() if len(services) > 7 else None,
**{
f'total_{key}': sum(service[key] for service in services)
for key in ('emails_sent', 'sms_cost', 'letter_cost')