parent
d7dec94beb
commit
0e9669bcd3
@ -214,6 +214,8 @@ class CalendarList:
|
||||
|
||||
self.calendar_days = None
|
||||
|
||||
def is_today(self):
|
||||
return self.firstdate == date.today()
|
||||
|
||||
def build_internal(self):
|
||||
# create a list of DayInCalendars
|
||||
@ -303,6 +305,9 @@ class CalendarList:
|
||||
def calendar_days_list(self):
|
||||
return list(self.get_calendar_days().values())
|
||||
|
||||
def nb_days(self):
|
||||
return (self.c_lastdate - self.c_firstdate).days + 1
|
||||
|
||||
def time_intervals_list(self, onlyfirst=False):
|
||||
ds = self.calendar_days_list()
|
||||
result = []
|
||||
|
@ -14,7 +14,7 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block navigation-menu %}
|
||||
{% cache 90000 navigation_links_upcoming user.is_authenticated calendar.firstdate filter.get_url category calendar.calendar_days_list|length %}
|
||||
{% cache 90000 navigation_links_upcoming user.is_authenticated calendar.firstdate filter.get_url category calendar.nb_days %}
|
||||
{% navigation_links filter category %}
|
||||
{% endcache %}
|
||||
{% endblock %}
|
||||
@ -26,23 +26,25 @@
|
||||
|
||||
|
||||
<article id="filters">
|
||||
{% cache 60000 upcoming_title user.is_authenticated calendar.firstdate filter.get_url category calendar.nb_days %}
|
||||
<header><h1 id="index-avenir">{% block title %}{% block og_title %}
|
||||
{% if category %}{{ category.name }}{% else %}Événements{% endif %}
|
||||
{% if calendar.calendar_days_list.0.is_today %}
|
||||
{% if calendar.is_today %}
|
||||
à venir
|
||||
{% else %}
|
||||
du {{ calendar.calendar_days_list.0.date| date:"l j F Y" }}
|
||||
{% if calendar.calendar_days_list|length > 1 %}
|
||||
du {{ calendar.firstdate | date:"l j F Y" }}
|
||||
{% if calendar.nb_days > 1 %}
|
||||
et suivants
|
||||
{% endif %}
|
||||
{% endif %}{% if filter.has_location %} à {{ filter.get_position }}{% endif %}
|
||||
{% endblock %}{% endblock %}</h1></header>
|
||||
{% endcache %}
|
||||
|
||||
|
||||
{% include "agenda_culturel/filter-inc.html" with filter=filter noarticle=1 %}
|
||||
|
||||
{% with cache_timeout=user.is_authenticated|yesno:"30,600" %}
|
||||
{% cache cache_timeout upcoming user.is_authenticated calendar.firstdate filter.get_url category calendar.calendar_days_list|length %}
|
||||
{% cache cache_timeout upcoming user.is_authenticated calendar.firstdate filter.get_url category calendar.nb_days %}
|
||||
|
||||
<footer>
|
||||
{% if category %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user