diff --git a/templates/calendar.html.twig b/templates/calendar.html.twig new file mode 100644 index 0000000..6b319c6 --- /dev/null +++ b/templates/calendar.html.twig @@ -0,0 +1,163 @@ +{% extends 'partials/base.html.twig' %} + +{% if page.header.show_breadcrumbs is defined %} + {% set show_breadcrumbs = page.header.show_breadcrumbs %} +{% else %} + {% set show_breadcrumbs = true %} +{% endif %} + +{% block menu %} + {% include 'partials/sidebar_right.html.twig' %} +{% endblock %} + +{% block content %} + {% if show_breadcrumbs and config.plugins.breadcrumbs.enabled %} + {% include 'partials/breadcrumbs.html.twig' %} + {% endif %} + +
+
+
+

{{ page.header.title }}

+ {% if page.header.subtitle %} +

{{ page.header.subtitle }}

+ {% endif %} +
+
+ {{ page.content|raw }} + +{% set prevYearUrl = page.url ~ '/year:' ~ calendar.prevYear|date('Y') ~ '/month:' ~ calendar.prevYear|date('m') %} +{% set nextYearUrl = page.url ~ '/year:' ~ calendar.nextYear|date('Y') ~ '/month:' ~ calendar.nextYear|date('m') %} +{% set prevMonthUrl = page.url ~ '/year:' ~ calendar.prev.date|date('Y') ~ '/month:' ~ calendar.prev.date|date('m') %} +{% set nextMonthUrl = page.url ~ '/year:' ~ calendar.next.date|date('Y') ~ '/month:' ~ calendar.next.date|date('m') %} +{% set currMonthUrl = page.url ~ '/year:' ~ now|date('Y') ~ '/month:' ~ now|date('m') %} + +{% set prevYearTitle = calendar.prevYear|dateTranslate(config.plugins.events.calendar.header) %} +{% set nextYearTitle = calendar.nextYear|dateTranslate(config.plugins.events.calendar.header) %} +{% set prevMonthTitle = calendar.prev.date|dateTranslate(config.plugins.events.calendar.header) %} +{% set nextMonthTitle = calendar.next.date|dateTranslate(config.plugins.events.calendar.header) %} + +
+
+ + + + + + + + + + + {% set fdowOffset = config.plugins.events.calendar.first_dow %} + {% set dayChar = config.plugins.events.calendar.day_char %} + {% if dayChar == 0 %} + {% set dayChar = 1000 %} + {% endif %} + {% for day in range(0,6) %} + + {% endfor %} + + + + + + {% set startDow = (calendar.date|date('w') +6-fdowOffset) % 7 %} + {% set dow = startDow %} + {% set month = "now"|date("F") %} + {% set year = "now"|date("Y") %} + {% for day in range(1,calendar.daysInMonth) %} + {% if loop.first and startDow != 0 %} + + {% endif %} + + {% if loop.last and dow != 6 %} + + {% endif %} + {% if dow == 6 %} + {% set dow = 0 %} + + + {% else %} + {% set dow = dow + 1 %} + {% endif %} + {% endfor %} + + +
+ « + + + + + {{ calendar.date|dateTranslate(config.plugins.events.calendar.header) }} + + + + + » +
{{ 'GRAV.DAYS_OF_THE_WEEK'|ta((fdowOffset+day) % 7)|slice(0, dayChar) }}
+
+ {% if calendar.events[calendar.year][calendar.month][day] != null %} + {% set title_date = calendar.month ~ '/' ~ day ~ '/' ~ calendar.year %} + + {% else %} +
+ {{ day }} +
+ {% endif %} + +
+ {% set title_date = calendar.month ~ '/' ~ day ~ '/' ~ calendar.year %} +

{{ title_date|dateTranslate(config.plugins.events.calendar.details.title) }}

+
    + {% for event in calendar.events[calendar.year][calendar.month][day] %} + {% if event.title %} +
  • + {% include 'partials/event_calendar_item.html.twig' with { 'event': event } %} +
  • + {% endif %} + {% endfor %} +
+
+
+
 
+
+ +
+
+ {% set day = "now"|date("j") %} + {% set month = "now"|date("n") %} + {% set year = "now"|date("Y") %} +

{{ "now"|dateTranslate(config.plugins.events.calendar.details.title) }}

+
    + {% if calendar.events[year][month][day] == null %} +
  • {{ "PLUGIN_EVENTS.CALENDAR.NO_EVENTS"|t }}
  • + {% else %} + {% for event in calendar.events[year][month][day] %} + {% if event.title %} +
  • + {% include 'partials/event_calendar_item.html.twig' with { 'event': event } %} +
  • + {% endif %} + {% endfor %} + {% endif %} +
+
+ +

+ {{ "PLUGIN_EVENTS.CALENDAR.VIEW_ALL_EVENTS"|t }} +

+
+
+
+ + +{% endblock %} diff --git a/templates/event.html.twig b/templates/event.html.twig new file mode 100644 index 0000000..08eb215 --- /dev/null +++ b/templates/event.html.twig @@ -0,0 +1,40 @@ +{% extends 'partials/base.html.twig' %} + +{% if page.header.show_breadcrumbs is defined %} + {% set show_breadcrumbs = page.header.show_breadcrumbs %} +{% else %} + {% set show_breadcrumbs = true %} +{% endif %} + +{% block menu %} + {% include 'partials/sidebar_right.html.twig' %} +{% endblock %} + +{% block content %} + {% if show_breadcrumbs and config.plugins.breadcrumbs.enabled %} + {% include 'partials/breadcrumbs.html.twig' %} + {% endif %} + +
+
+
+

{{ page.header.title }}

+ {% if page.header.subtitle %} +

{{ page.header.subtitle }}

+ {% endif %} +
+
+ +
+
+ {% include 'partials/event_item.html.twig' with { 'event': page.parent, 'single': true } %} +
+ {% include 'partials/events_sidebar.html.twig' with { 'page': page.parent } %} +
+ +
+ + +{% endblock %} diff --git a/templates/events.html.twig b/templates/events.html.twig new file mode 100644 index 0000000..4110e81 --- /dev/null +++ b/templates/events.html.twig @@ -0,0 +1,51 @@ +{% extends 'partials/base.html.twig' %} + +{% set collection = page.collection() %} +{% if page.header.show_breadcrumbs is defined %} + {% set show_breadcrumbs = page.header.show_breadcrumbs %} +{% else %} + {% set show_breadcrumbs = true %} +{% endif %} + +{% block menu %} + {% include 'partials/sidebar_right.html.twig' %} +{% endblock %} + +{% block content %} + {% if show_breadcrumbs and config.plugins.breadcrumbs.enabled %} + {% include 'partials/breadcrumbs.html.twig' %} + {% endif %} + +
+
+
+

{{ page.header.title }}

+ {% if page.header.subtitle %} +

{{ page.header.subtitle }}

+ {% endif %} +
+
+ {{ page.content|raw }} + +
+
+ {% if collection|length != 0 %} + {% for event in collection %} + {% include 'partials/event_item.html.twig' with { 'page': event, 'single': false } %} + {% endfor %} + {% else %} +

{{ "PLUGIN_EVENTS.EVENTS.NO_EVENTS_TITLE"|t }}

+

{{ ("PLUGIN_EVENTS.EVENTS.NO_EVENTS_CONTENT"|t(uri.param('category')))|markdown }}

+ {% endif %} +
+
+
+ + {% if show_pagination and config.plugins.pagination.enabled and collection.params.pagination %} + {% include 'partials/pagination.html.twig' with {base_url: page.url, pagination: collection.params.pagination} %} + {% endif %} + + +{% endblock %} diff --git a/templates/partials/event_item.html.twig b/templates/partials/event_item.html.twig new file mode 100644 index 0000000..8a9976f --- /dev/null +++ b/templates/partials/event_item.html.twig @@ -0,0 +1,62 @@ +
+
+ {% set image = page.media.images|first %} + {% if image != null %} + {{ image.cropZoom(960,280).html }} + {% endif %} +
+ +
+
{# date and time #} + {% if single == true %} {# individual content page #} + {% else %} {# main listing page #} + + {% endif %} +
+ +
{# title and content #} + {% if single == true %} {# individual content page #} + {% if (config.plugins.events.event_meta.display_location) and (page.header.event.location is not empty) %} +

{{ page.header.event.location }}

+ {% endif %} + {% if page.content %} +
{{ page.content|raw }}
+ {% else %} + {{ "PLUGIN_EVENTS.EVENTS.NO_MORE_INFORMATION"|t }} + {% endif %} + {% include 'partials/event_meta.html.twig' with { 'page': page } %} + + {% else %} {# main listing page #} +{# {% if page.content %} #} +

{{ page.title }}

+{#} {% else %} +

{{ page.title }}

+ {% endif %} #} + {% if (config.plugins.events.event_meta.display_location) and (page.header.event.location is not empty) %} +

{{ page.header.event.location }}

+ {% endif %} + {% if page.content %} + {{ "PLUGIN_EVENTS.EVENTS.MORE_INFORMATION"|t }} + {% endif %} + {% endif %} + + {% if page.taxonomy.category and config.plugins.events.event_sidebar.enable_categories %} +
+ + {% for category in page.taxonomy.category %} + {{ category }} + {% endfor %} + +
+ {% endif %} +
+
+
+