Highlight "All days" when selected

This commit is contained in:
Víðir Valberg Guðmundsson 2017-04-21 14:07:39 +02:00
parent 3122092326
commit 9fb372e114

View file

@ -5,12 +5,12 @@
<div class="row"> <div class="row">
<div class="schedule-days btn-group"> <div class="schedule-days btn-group">
<a href="{% url 'schedule_index' camp_slug=camp.slug %}" class="btn btn-default"> <a href="{% url 'schedule_index' camp_slug=camp.slug %}" class="btn btn-{% if request.resolver_match.url_name == 'schedule_index' %}primary{% else %}default{% endif %}">
<li>All days</li> <li>All days</li>
</a> </a>
{% for day in camp.camp_days %} {% for day in camp.camp_days %}
{% with month_padded=day.lower.date|date:"m" day_padded=day.lower.date|date:"d" %} {% with month_padded=day.lower.date|date:"m" day_padded=day.lower.date|date:"d" %}
<a href="{% url 'schedule_day' camp_slug=camp.slug year=day.lower.date.year month=day.lower.date|date:'m' day=day.lower.date|date:'d' %}" class="btn btn-{% if urlyear and urlyear|add:"0" == day.lower.date.year and urlmonth == month_padded and urlday == day_padded %}primary{% else %}default{% endif %}"> <a href="{% url 'schedule_day' camp_slug=camp.slug year=day.lower.date.year month=month_padded day=day_padded %}" class="btn btn-{% if urlyear and urlyear|add:"0" == day.lower.date.year and urlmonth == month_padded and urlday == day_padded %}primary{% else %}default{% endif %}">
{{ day.lower.date|date:"l" }} {{ day.lower.date|date:"l" }}
</a> </a>
{% endwith %} {% endwith %}