combo/combo/apps/family/templates/family/weekly_agenda.html

52 lines
1.6 KiB
HTML

{% load i18n %}
{% block cell-content %}
{% if json.data %}
{% if cell.title %}
<h2>
{{ cell.title }}
</h2>
{% endif %}
<div class="weeklyagenda-cell weeklyagenda-cell-{{ cell.pk }}" data-cell-id="{{ cell.pk }}">
{% with first_monday=json.data.0.date|date|adjust_to_week_monday last_item=json.data|last %}
{% with last_day=last_item.date|date|adjust_to_week_monday|add_days:6 %}
{% now 'Y-m-d' as now %}
{% spaceless %}
<button class="previous-week"></button>
<ul>
{% for day in first_monday|iterate_days_until:last_day %}
{% if day.weekday == 0 %}
{% with sunday=day|add_days:6 %}
<li class="week"><span class="week-title">{% blocktrans with day_date=day|date:"d/m" sunday_date=sunday|date:"d/m" %}Semaine<br class="weekbreak"> du {{ day_date }} au {{ sunday_date }}{% endblocktrans %}</span><ul>
{% endwith %}
{% endif %}
<li class="day-title {% if now == day|date:"Y-m-d" %}current{% endif %}" data-weekday="{{ day.weekday }}"><strong>{{ day|date:"l d/m" }}</strong></li>
{% with day_str=day|date:"Y-m-d" %}
{% for item in json.data %}
{% if item.date == day_str %}
<li class="activity {% if item.disabled %}disabled{% endif %}"
{% if item.booked_for_external_user %}data-status="green"{% endif %}
><span><span>{{ item.label }}</span></span>
</li>
{% endif %}
{% endfor %}
{% endwith %}
{% if day.weekday == 6 %}
</ul>
<p class="no-activity">{% trans "No activity this week" %}</p>
</li>
{% endif %}
{% endfor %}
</ul>
<button class="next-week"></button>
{% endspaceless %}
{% endwith %}
{% endwith %}
</div>
{% endif %}
{% endblock %}