<div class="pat-calendar"
     id="calendar-app"
     tal:define="
                  default_view request/default_view|string:month;
                  ws view/workspace;
                  in_workspace python:ws is not None;
                  app python:request.get('app') and 'app=%s&'%request.get('app') or '';
                  new_event_url string:${here/absolute_url}/add_event?${app}in_calendar=1#document-content;
                "
     data-pat-calendar="url: ${view/calendar_url};
                        default-view: ${default_view};
                        start-date: ${view/get_start_date};
                        first-hour: 8;
                        first-day: ${view/first_day};
                        time-format: H:mm;
                        height: auto;
                        title-day: dddd, D MMM YYYY;
                        column-week: ddd D MMM;
                        category-controls: .cal-categories;
                        drag-and-drop: true;
                        drop-external-events: true;
                        external-event-selector: .cal-event;
                        pat-inject-target: #document-body;
                        pat-inject-source: #document-body;
                        pat-switch-selector: #application-body;
                        pat-switch-remove: focus-*;
                        pat-switch-add: focus-document;
                        store: local"
     data-pat-calendar-tooltip="height: max; source: ajax;closing: close-button; url: ${new_event_url}; class: event wizard;"
     i18n:domain="ploneintranet">

    <h1 class="cal-title" tal:content="view/today">saturday, 10 sept 2016</h1>
    <div class="canvas-toolbar">
        <fieldset class="cal-nav cal-controls button-cluster">
            <button class="jump-prev" title="Back" type="button" i18n:attributes="title">&lt;</button>
            <button class="jump-today active" title="Today" type="button" i18n:translate="" i18n:attributes="title">Today</button>
            <button class="jump-next" title="Forward" type="button" i18n:attributes="title">&gt;</button>
        </fieldset>
        <form class="pat-form cal-controls cal-categories">
            <fieldset class="button-cluster float-before">
                <button class="view-month" type="button" i18n:translate="">Month</button>
                <button class="view-week active" type="button" i18n:translate="">Week</button>
                <button class="view-day" type="button" i18n:translate="">Day</button>
                <button class="view-listMonth" type="button" i18n:translate="">List</button>
            </fieldset>
            <tal:if tal:condition="in_workspace">
                <label class="pat-checklist toggle alien-calendars cal-cat-alien float-before unchecked">
                    <input type="checkbox"
                           id="cal-cat-alien"
                           name="all_calendars"
                           checked="${python:'checked' if request.get('all_calendars') else None}"
                           autocomplete="off"
                    > <tal:t i18n:translate="">All calendars</tal:t>
                </label>
                <input id="${python:view.id2class(ws.getId())}"
                       type="checkbox"
                       name="workspaces:list"
                       value="${context/UID}"
                       checked
                       hidden
                       autocomplete="off"
                >
            </tal:if>
            <label class="pat-select timezone float-after">
              <select name="timezone" class="timezone" tal:define="
                  tz request/timezone|nothing;
                  my_zone view/get_user_timezone | tz | string:Europe/Berlin">
                <tal:timezone repeat="zone view/get_timezone_data" >
                  <option data-timezone-id="${zone/id}" gmt-adjustment="${zone/offset}" data-use-daylight-time="${zone/daylight_saving}" value="${zone/zone}"
                    tal:attributes="selected python:my_zone == zone['zone'] and 'selected' or None">${zone/name}</option>
                </tal:timezone>
              </select>
            </label>
        </form>
    </div>
</div>
