Show a message when the calendar has no events #35

Merged
westfarn merged 1 commits from feat/calendar-empty-state into master 2026-10-10 04:14:37 -07:00
2 changed files with 21 additions and 2 deletions
Showing only changes of commit 427693fb9f - Show all commits

No files matched your search

+12 -2
View File
@@ -136,6 +136,12 @@
</div>
</div>
{% empty %}
<div class="col-12">
<div class="alert alert-light border text-center mb-0" role="status">
There are no upcoming events to display.
</div>
</div>
{% endfor %}
</div>
</div>
@@ -179,9 +185,13 @@
</div>
</div>
</div>
{% empty %}
<div class="col-12">
<div class="alert alert-light border text-center mb-0" role="status">
There are no past events to display.
</div>
</div>
{% endfor %}
</div>
</div>
</div>
+9
View File
@@ -66,6 +66,13 @@ class PublicPageTests(TestCase):
response = self.client.get(reverse("calendar2"))
self.assertEqual(response.status_code, 200)
def test_calendar_shows_empty_state_when_no_events(self):
response = self.client.get(reverse("calendar2"))
self.assertEqual(response.status_code, 200)
self.assertContains(response, "There are no upcoming events to display.")
self.assertContains(response, "There are no past events to display.")
def test_newsletters_renders(self):
response = self.client.get(reverse("newsletters2"))
self.assertEqual(response.status_code, 200)
@@ -414,6 +421,8 @@ class CalendarEventTests(TestCase):
self.assertNotIn("Ongoing Event", past_html)
self.assertIn("Archived Picnic", past_html)
self.assertNotIn("Archived Picnic", upcoming_html)
self.assertNotIn("There are no upcoming events to display.", upcoming_html)
self.assertNotIn("There are no past events to display.", past_html)
@override_settings(