calendar-month.html.twig in Calendar 8.2
Same filename and directory in other branches
Template to display a view as a calendar month.
Available variables:
- rows: An array of data for each day of the week.
File
templates/calendar-month.html.twigView source
- {#
- /**
- * @file
- * Template to display a view as a calendar month.
- *
- * Available variables:
- * - rows: An array of data for each day of the week.
- *
- * @ingroup themeable
- */
- #}
- {{ attach_library('calendar/calendar') }}
- <div class="calendar month">
- {% for row in rows %}
- {% if loop.first %}
- {% set dayheader = TRUE %}
- {% else %}
- {% set dayheader = FALSE %}
- {% endif %}
- <div class="data">
- <div class="weekno">
- {% if row.linkdata.show_week %}
- {% if row.linkdata.week_route %}
- <a href="{{ path(row.linkdata.week_route, {'arg_0': row.linkdata.year ~ row.linkdata.week }) }}">{{ row.linkdata.week }}</a>
- {% else %}
- {{ row.linkdata.week }}
- {% endif %}
- {% endif %}
- </div>
- <div class="headings">
- {% for key,value in row.weekdays %}
- <div class="day {{ key }} {{ value.class }}">
- {% if dayheader %}
- <div class="header">{{ value.header }}</div>
- {% endif %}
- {% if row.linkdata.day_route %}
- <div class="date"><a href="{{ path(row.linkdata.day_route, {'arg_0': row.linkdata.year ~ row.linkdata.month ~ value.date }) }}">{{ value.date }}</a></div>
- {% else %}
- {{ value.date }}
- {% endif %}
- </div>
- {% endfor %}
- </div>
- <div class="multidays">
- {% for day in row.weekdays %}
- {% for event in day.multiday %}
- {# {% if event.offset.h > 0 %}#}
- {# {% set offset = (event.offset.d + 1) * 100 / 7 %}#}
- {# {% else %}#}
- {% set offset = event.offset.d * 100 / 7 %}
- {# {% endif %}#}
- {% if event.length.h > 0 %}
- {% set length = (event.length.d + 1) * 100 / 7 %}
- {% else %}
- {% set length = event.length.d * 100 / 7 %}
- {% endif %}
- {% if length is same as(0) %}
- <div class="multiday" style="margin-left: {{ offset }}%; width: auto;"><div class="inner">{{- event.label -}}</div></div>
- {% else %}
- <div class="multiday" style="margin-left: {{ offset }}%; width: {{ length }}%;"><div class="inner">{{- event.label -}}</div></div>
- {% endif %}
- {% endfor %}
- {% endfor %}
- </div>
- <div class="otherdays">
- {% for key,value in row.weekdays %}
- <div class="day {{ key }} {{ value.class }}">
- <div class="alldays">
- {% for event in value.allday %}
- {% set offset = event.offset.d * 100 / 7 %}
- <div class ="allday">
- <div class="inner">
- {{- event.label -}}
- </div>
- </div>
- {% endfor %}
- </div>
- <div class="events">
- {% for event in value.other %}
- <div class="hour">
- <div class="inner" style="background-color: {{ event.color }}">{{- event.row -}}</div>
- </div>
- {% endfor %}
- </div>
- </div>
- {% endfor %}
- </div>
- </div>
- {% endfor %}
- </div>