You are here

views-view-fullcalendar.html.twig in Fullcalendar View 6.x

{#
/**
 * Default theme implementation for Views to output a Fullcalendar View.
 *
 * Available variables:
 * - options: View plugin style options:
 *   - classes: CSS classes.
 *   - defaultDate: Default date of the calendar
 *   - start: Field name of start date
 *   - end: Field name of end date
 *   - languageSelector: Flag for the language dropdown box
 * - view_index: View index
 * - showAddEvent: Show add event button
 * - entity_id: The Entity type machine name
 *
 * @see template_preprocess_views_view_fullcalendar()
 *
 * @ingroup themeable
 */
#}
{%
  set classes = [
    options.classes
  ]
%}
<div{{ attributes.addClass(classes) }}>
  <div class="js-drupal-fullcalendar" calendar-view-index="{{ view_index }}" calendar-view-name="{{ view_id }}" calendar-display="{{ display_id }}"></div>
  <div class="bottom-buttons fc-button-group">
    {% if showAddEvent %}
    <div class="fullcalendar-bottom-btn add-event-btn">
        <a id="calendar-add-event"  href="fullcalendar-view-event-add?entity={{ entity_id }}&bundle={{ options.bundle_type }}&start_field={{ options.start }}&end_field={{ options.end }}&destination={{ path('<current>') }}" class="use-ajax" data-dialog-type="dialog" data-dialog-renderer="off_canvas" 
   data-dialog-options="{&quot;width&quot;:400}">{{ 'Add event'|t }}</a>
    </div>
    {% endif %}
    {% if options.languageSelector == 1 %}
    <div class="fullcalendar-bottom-btn locale-selector">
      <label for="locale-selector">{{ 'Select Language:'|t }}</label>
      <select id='locale-selector-{{ view_index }}' calendar-view-index="{{ view_index }}"></select>
    </div>
    {% endif %}
  </div>
</div>

File

templates/views-view-fullcalendar.html.twig
View source
  1. {#
  2. /**
  3. * Default theme implementation for Views to output a Fullcalendar View.
  4. *
  5. * Available variables:
  6. * - options: View plugin style options:
  7. * - classes: CSS classes.
  8. * - defaultDate: Default date of the calendar
  9. * - start: Field name of start date
  10. * - end: Field name of end date
  11. * - languageSelector: Flag for the language dropdown box
  12. * - view_index: View index
  13. * - showAddEvent: Show add event button
  14. * - entity_id: The Entity type machine name
  15. *
  16. * @see template_preprocess_views_view_fullcalendar()
  17. *
  18. * @ingroup themeable
  19. */
  20. #}
  21. {%
  22. set classes = [
  23. options.classes
  24. ]
  25. %}
  26. <div{{ attributes.addClass(classes) }}>
  27. <div class="js-drupal-fullcalendar" calendar-view-index="{{ view_index }}" calendar-view-name="{{ view_id }}" calendar-display="{{ display_id }}"></div>
  28. <div class="bottom-buttons fc-button-group">
  29. {% if showAddEvent %}
  30. <div class="fullcalendar-bottom-btn add-event-btn">
  31. <a id="calendar-add-event" href="fullcalendar-view-event-add?entity={{ entity_id }}&bundle={{ options.bundle_type }}&start_field={{ options.start }}&end_field={{ options.end }}&destination={{ path('<current>') }}" class="use-ajax" data-dialog-type="dialog" data-dialog-renderer="off_canvas"
  32. data-dialog-options="{&quot;width&quot;:400}">{{ 'Add event'|t }}</a>
  33. </div>
  34. {% endif %}
  35. {% if options.languageSelector == 1 %}
  36. <div class="fullcalendar-bottom-btn locale-selector">
  37. <label for="locale-selector">{{ 'Select Language:'|t }}</label>
  38. <select id='locale-selector-{{ view_index }}' calendar-view-index="{{ view_index }}"></select>
  39. </div>
  40. {% endif %}
  41. </div>
  42. </div>