Fix navigation semaines au changement d'année
This commit is contained in:
parent
0526854d6b
commit
5ef9358b28
@ -37,7 +37,7 @@
|
|||||||
<div>
|
<div>
|
||||||
{% if calendar.firstdate|shift_day:-1|not_before_first %}
|
{% if calendar.firstdate|shift_day:-1|not_before_first %}
|
||||||
{% if calendar.lastdate|not_after_last %}
|
{% if calendar.lastdate|not_after_last %}
|
||||||
<a role="button" href="{% url 'week_view' calendar.previous_week.year calendar.previous_week|week %}?{{ filter.get_url }}">
|
<a role="button" href="{% url 'week_view' calendar.previous_week|weekyear calendar.previous_week|week %}?{{ filter.get_url }}">
|
||||||
{% picto_from_name "chevron-left" %} précédente</a>
|
{% picto_from_name "chevron-left" %} précédente</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -45,7 +45,7 @@
|
|||||||
{% if calendar.lastdate|shift_day:+1|not_after_last %}
|
{% if calendar.lastdate|shift_day:+1|not_after_last %}
|
||||||
{% if calendar.lastdate|not_before_first %}
|
{% if calendar.lastdate|not_before_first %}
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<a role="button" href="{% url 'week_view' calendar.next_week.year calendar.next_week|week %}?{{ filter.get_url }}">suivante
|
<a role="button" href="{% url 'week_view' calendar.next_week|weekyear calendar.next_week|week %}?{{ filter.get_url }}">suivante
|
||||||
{% picto_from_name "chevron-right" %}
|
{% picto_from_name "chevron-right" %}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@ -57,7 +57,7 @@
|
|||||||
<div class="slider-button slider-button-inside button-left hidden">{% picto_from_name "arrow-left" %}</div>
|
<div class="slider-button slider-button-inside button-left hidden">{% picto_from_name "arrow-left" %}</div>
|
||||||
{% if calendar.firstdate|shift_day:-1|not_before_first %}
|
{% if calendar.firstdate|shift_day:-1|not_before_first %}
|
||||||
{% if calendar.lastdate|not_after_last %}
|
{% if calendar.lastdate|not_after_last %}
|
||||||
<div class="slider-button slider-button-page button-left hidden"><a href="{% url 'week_view' calendar.previous_week.year calendar.previous_week|week %}?{{ filter.get_url }}">{% picto_from_name "chevrons-left" %}</a></div>
|
<div class="slider-button slider-button-page button-left hidden"><a href="{% url 'week_view' calendar.previous_week|weekyear calendar.previous_week|week %}?{{ filter.get_url }}">{% picto_from_name "chevrons-left" %}</a></div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
@ -166,7 +166,7 @@
|
|||||||
<div class="slider-button slider-button-inside button-right hidden">{% picto_from_name "arrow-right" %}</div>
|
<div class="slider-button slider-button-inside button-right hidden">{% picto_from_name "arrow-right" %}</div>
|
||||||
{% if calendar.lastdate|shift_day:+1|not_after_last %}
|
{% if calendar.lastdate|shift_day:+1|not_after_last %}
|
||||||
{% if calendar.lastdate|not_before_first %}
|
{% if calendar.lastdate|not_before_first %}
|
||||||
<div class="slider-button slider-button-page button-right hidden"><a href="{% url 'week_view' calendar.next_week.year calendar.next_week|week %}?{{ filter.get_url }}">{% picto_from_name "chevrons-right" %}</a></div>
|
<div class="slider-button slider-button-page button-right hidden"><a href="{% url 'week_view' calendar.next_week|weekyear calendar.next_week|week %}?{{ filter.get_url }}">{% picto_from_name "chevrons-right" %}</a></div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
@ -29,6 +29,9 @@ def add_de(txt):
|
|||||||
def week(d):
|
def week(d):
|
||||||
return d.isocalendar()[1]
|
return d.isocalendar()[1]
|
||||||
|
|
||||||
|
@register.filter
|
||||||
|
def weekyear(d):
|
||||||
|
return d.isocalendar()[0]
|
||||||
|
|
||||||
@register.filter
|
@register.filter
|
||||||
def not_before_first(d):
|
def not_before_first(d):
|
||||||
|
Loading…
Reference in New Issue
Block a user