<metal:page define-macro="master">
  <metal:master use-macro="here/main_template/macros/master">
    <metal:content fill-slot="content">
      <div class="modal"
           id="content"
           tal:define="
             panel_size view/panel_size|nothing;
             panel_style view/panel_style|nothing;
             form_action view/form_action|nothing;
             form_data_pat_inject view/form_data_pat_inject|nothing;
             form_data_pat_validation view/form_data_pat_validation|nothing;
           "
      >
        <div class="pat-modal ${panel_size} ${panel_style}"
             id="document-content"
        >
          <h1>${view/title|nothing}</h1>
          <form class="pat-form wizard-box ${python:form_data_pat_inject and 'pat-inject' or ''} panel-class-${panel_size} ${python:form_data_pat_validation and 'pat-validation' or ''}"
                action="${form_action}"
                method="${view/form_method|string:post}"
                data-pat-inject="${form_data_pat_inject}"
                data-pat-validation="${form_data_pat_validation}"
                tal:omit-tag="not:form_action"
          >
            <div class="panel-body">
              <div class="${python: getattr(view, 'body_child_class', 'container')}">
                <metal:slot define-slot="body">
                </metal:slot>
              </div>
            </div>
            <div class="buttons button-bar pat-bumper"
                 tal:condition="python: getattr(view, 'show_button_bar', True)"
            >
              <div class="container">
                <metal:slot define-slot="buttons">
                </metal:slot>
                <button class="pat-button close-panel icon-cancel-circle ${python:form_data_pat_validation and 'validate-ignore'}"
                        type="button"
                        tal:condition="view/show_default_cancel_button|nothing"
                        i18n:translate=""
                >
                  Cancel
                </button>
                <tal:token tal:condition="form_action"
                           tal:replace="structure context/@@authenticator/authenticator"
                />
              </div>
            </div>
            <input name="in_calendar"
                   type="hidden"
                   tal:attributes="
                     value python:request.get('in_calendar') and 1 or None;
                   "
            />
          </form>
          <metal:slot define-slot="after-form">
          </metal:slot>
        </div>
      </div>
    </metal:content>
  </metal:master>
</metal:page>
