Skip to content
Snippets Groups Projects

AKDashboard: Handle long lists of events better & show event place and date

Merged Benjamin Hättasch requested to merge feature-long-event-list into main
Files
3
+ 2
1
@@ -25,7 +25,8 @@ class DashboardView(TemplateView):
# Load events and split between active and current/featured events and those that should show smaller below
context["active_and_current_events"] = []
context["old_events"] = []
for event in Event.objects.filter(public=True).order_by("-active", "-pk").prefetch_related('dashboardbutton_set'):
events = Event.objects.filter(public=True).order_by("-active", "-pk").prefetch_related('dashboardbutton_set')
for event in events:
if event.active or len(context["active_and_current_events"]) < settings.DASHBOARD_MAX_FEATURED_EVENTS:
context["active_and_current_events"].append(event)
else:
Loading