<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">
    <t t-name="eurooffice_odoo_templates.TemplateDialog" owl="1">
    <div>
      <Dialog
        t-if="state.isOpen"
        title="dialogTitle"
        contentClass="'o-spreadsheet-templates-dialog'"
        footer="true"
        modalRef="modalRef"
      >
        <div class="o-pager">
          <Pager
            t-if="state.totalTemplates"
            total="state.totalTemplates"
            offset="state.currentOffset"
            limit="limit"
            isEditable="false"
            onUpdate.bind="onPagerChange"
          />
        </div>
        <div
          class="o_kanban_renderer o_renderer d-flex o_kanban_ungrouped align-content-start flex-wrap justify-content-start"
        >
          <t t-foreach="state.templates" t-as="template" t-key="template.id">
            <div
              class="o_kanban_record d-flex flex-grow-1 flex-md-shrink-1 flex-shrink-0"
              tabindex="0"
              t-att-class="isSelected(template.id) ? 'o_eurooffice_kanban_record_selected': ''"
              t-on-focus="() => this.selectTemplate(template.id)"
              t-on-dblclick="fillTemplate"
            >
              <div class="oe_kanban_global_area oe_kanban_global_click o_kanban_attachment">
                <div class="o_kanban_image">
                  <div class="o_kanban_image_wrapper">
                    <div class="o_image o_image_thumbnail" t-att-data-mimetype="template.mimetype" />
                  </div>
                </div>

                <div class="o_kanban_details">
                  <div class="o_kanban_details_wrapper">
                    <div class="o_kanban_record_title" t-att-title="template.name">
                      <span class="o_text_overflow" t-esc="template.name" />
                    </div>

                    <div class="o_kanban_record_body">
                      <samp class="text-muted" />
                    </div>

                    <div class="o_kanban_record_bottom">
                      <time class="oe_kanban_bottom_left">
                        <div name="create_date" class="o_field_widget o_readonly_modifier o_field_date">
                          <span t-esc="template.create_date" />
                        </div>
                      </time>
                      <div class="oe_kanban_bottom_right">
                        <div
                          name="create_uid"
                          class="o_field_widget o_readonly_modifier o_field_many2one_avatar_user o_field_many2one_avatar"
                        >
                          <div class="d-flex" t-att-data-tooltip="template.create_uid[1]">
                            <span class="o_m2o_avatar">
                              <img t-att-src="'/web/image/res.users/' + template.create_uid[0] + '/avatar_128'" />
                            </span>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </t>
        </div>
        <t t-set-slot="footer">
          <button class="btn btn-primary o-template-fill" t-att-disabled="isButtonDisabled()" t-on-click="fillTemplate">
            <t>Print</t>
          </button>
          <button class="btn btn-secondary" t-att-disabled="isButtonDisabled()" t-on-click="previewTemplate">
            <t>Preview</t>
          </button>
          <button class="btn btn-secondary" t-on-click="data.close">
            <t>Cancel</t>
          </button>
        </t>
      </Dialog>
    </div>
  </t>
</templates>
