diff --git a/district/templates/district/district_center_page.html b/district/templates/district/district_center_page.html index 488d677872f4295cf5e8d4f4ca8acd1cb9d2004e..b647958d011f030be1a869d96036e422752432a5 100644 --- a/district/templates/district/district_center_page.html +++ b/district/templates/district/district_center_page.html @@ -28,7 +28,10 @@ {% include_block block %} {% endfor %} </div> - {% include "shared/small_calendar_snippet.html" %} + + {% if page.has_calendar %} + {% include "shared/small_calendar_snippet.html" with events=page.calendar.current_events %} + {% endif %} </div> <div class="pt-8 lg:w-2/5 xl:w-1/3 lg:pt-0 space-y-4"> diff --git a/region/templates/region/region_center_page.html b/region/templates/region/region_center_page.html index 74d3c2e028bf30625067f00ab014a341baa26aa9..621de92974a81128e6b4fa6c689d38d69c6d9b9a 100644 --- a/region/templates/region/region_center_page.html +++ b/region/templates/region/region_center_page.html @@ -28,7 +28,10 @@ {% include_block block %} {% endfor %} </div> - {% include "shared/small_calendar_snippet.html" %} + + {% if page.has_calendar %} + {% include "shared/small_calendar_snippet.html" with events=page.calendar.current_events %} + {% endif %} </div> <div class="pt-8 lg:w-2/5 xl:w-1/3 lg:pt-0 space-y-4"> diff --git a/shared/templates/shared/small_calendar_snippet.html b/shared/templates/shared/small_calendar_snippet.html index 60757687447fc4b979148a97c6909974910f9742..ab10f212df0194626df0da7a3eb078d372b5b7c6 100644 --- a/shared/templates/shared/small_calendar_snippet.html +++ b/shared/templates/shared/small_calendar_snippet.html @@ -2,8 +2,9 @@ <h2 class="head-heavy-sm mb-4 mt-4"> Kalendář akcí </h2> + <div class="mb-4"> - {% for event in page.root_page.calendar.current_events %} + {% for event in events|default:page.root_page.calendar.current_events %} <div class="grid grid-cols-12 items-center calendar-table-row calendar-table-row--standalone"> <div class="col-span-2 text-orange-300 head-alt-md calendar-table-row__col"> <span>{{ event.begin|date:"j." }}</span>