You are here

calendar-day-overlap.html.twig in Calendar 8

Template to display a view as a calendar day, grouped by time with overlapping items

rows: The rendered data for this day. rows['date'] - the date for this day, formatted as YYYY-MM-DD. rows['datebox'] - the formatted datebox for this day. rows['empty'] - empty text for this day, if no items were found. rows['all_day'] - an array of formatted all day items. rows['items'] - an array of timed items for the day. rows['items'][time_period]['hour'] - the formatted hour for a time period. rows['items'][time_period]['ampm'] - the formatted ampm value, if any for a time period. rows['items'][time_period][$column]['values'] - An array of formatted items for a time period and field column.

view: The view. columns: an array of column names. min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS. max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.

The width of the columns is dynamically set using <col></col> based on the number of columns presented. The values passed in will work to set the 'hour' column to 10% and split the remaining columns evenly over the remaining 90% of the table.

See also

template_preprocess_calendar_day.

File

templates/calendar-day-overlap.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Template to display a view as a calendar day, grouped by time with overlapping items
  5. *
  6. * @see template_preprocess_calendar_day.
  7. *
  8. * rows: The rendered data for this day.
  9. * rows['date'] - the date for this day, formatted as YYYY-MM-DD.
  10. * rows['datebox'] - the formatted datebox for this day.
  11. * rows['empty'] - empty text for this day, if no items were found.
  12. * rows['all_day'] - an array of formatted all day items.
  13. * rows['items'] - an array of timed items for the day.
  14. * rows['items'][time_period]['hour'] - the formatted hour for a time period.
  15. * rows['items'][time_period]['ampm'] - the formatted ampm value, if any for a time period.
  16. * rows['items'][time_period][$column]['values'] - An array of formatted
  17. * items for a time period and field column.
  18. *
  19. * view: The view.
  20. * columns: an array of column names.
  21. * min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
  22. * max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
  23. *
  24. * The width of the columns is dynamically set using <col></col>
  25. * based on the number of columns presented. The values passed in will
  26. * work to set the 'hour' column to 10% and split the remaining columns
  27. * evenly over the remaining 90% of the table.
  28. *
  29. * @ingroup themeable
  30. */
  31. #}
  32. <div class="calendar-calendar"><div class="day-view">
  33. {# // Multi-day and all day events are not supported because Dates don't have end values
  34. <div id="multi-day-container">
  35. <table class="full">
  36. <tbody>
  37. <tr class="holder">
  38. <td class="calendar-time-holder"></td>
  39. <td class="calendar-day-holder"></td>
  40. </tr>
  41. <tr>
  42. <td class="{{ agenda_hour_class }} first">
  43. <span class="calendar-hour">{% trans %}All day{% endtrans %}</span>
  44. </td>
  45. <td class="calendar-agenda-items multi-day last">
  46. {% for column in columns %}
  47. <div class="calendar">
  48. <div class="inner">
  49. {% if rows['all_day'] is not empty and rows['all_day'][column] is not empty %}
  50. {{ rows['all_day'][column] }}
  51. {% else %}
  52. &nbsp;
  53. {% endif %}
  54. </div>
  55. </div>
  56. {% endfor %}
  57. </td>
  58. </tr>
  59. </tbody>
  60. </table>
  61. </div>
  62. <div class="header-body-divider">&nbsp;</div>
  63. #}
  64. <div id="single-day-container">
  65. <table class="full">
  66. <tbody>
  67. <tr class="holder">
  68. <td class="calendar-time-holder"></td>
  69. <td class="calendar-day-holder"></td>
  70. </tr>
  71. <tr>
  72. <td class="first">
  73. {% set is_first = true %}
  74. {% for time_cnt, hour in rows['items'] %}
  75. {% if time_cnt == 0 %}
  76. {% set class = 'first' %}
  77. {% elseif time_cnt == start_times|length - 1 %}
  78. {% set class = 'last' %}
  79. {% else %}
  80. {% set class = '' %}
  81. {% endif %}
  82. <div class="{{ class }} calendar-agenda-hour">
  83. <span class="calendar-hour">{{ hour.hour }}</span><span class="calendar-ampm">{{ hour.ampm }}</span>
  84. </div>
  85. {% endfor %}
  86. </td>
  87. <td class="last">
  88. {% for time_cnt, hour in rows['items'] %}
  89. {% if time_cnt == 0 %}
  90. {% set class = 'first' %}
  91. {% elseif time_cnt == start_times|length - 1 %}
  92. {% set class = 'last' %}
  93. {% else %}
  94. {% set class = '' %}
  95. {% endif %}
  96. {% for column in columns %}
  97. <div class="{{ class }} calendar-agenda-items single-day">
  98. <div class="half-hour">&nbsp;</div>
  99. {% if is_first and hour['values'][column] %}
  100. <div class="calendar item-wrapper first_item">
  101. {% set is_first = true %}
  102. {% else %}
  103. <div class="calendar item-wrapper">
  104. {% endif %}
  105. <div class="inner">
  106. {% if hour['values'] is not empty and hour['values'][column] is not empty %}
  107. {% for item in hour['values'][column] %}
  108. {{ item }}
  109. {% endfor %}
  110. {% else %}
  111. &nbsp;
  112. {% endif %}
  113. </div>
  114. </div>
  115. </div>
  116. {% endfor %}
  117. {% endfor %}
  118. </td>
  119. </tr>
  120. </tbody>
  121. </table>
  122. </div>
  123. <div class="single-day-footer">&nbsp;</div>
  124. </div></div>