{% extends 'tekir_base.html' %}

{% from 'tekir_macros.html' import render_field %}

{% block body %}
<form id="content-edit-form" action="." method="POST">
  {% for field in record.datamodel.fields %}
    {{ render_field(record, field, prefix='') }}
  {% endfor %}

  <button id="save-content"
      hx-post="{{ url_for('tekir_admin.api.save_content', path=record.path) }}"
      hx-target="#save-dialog">
    {% include 'icons/document-save.svg' %} <span>{{ _('Save') }}</span>
  </button>
  <button
      hx-post="{{ url_for('tekir_admin.api.check_changes', path=record.path) }}"
      hx-target="#changes-dialog">
    {% include 'icons/document-close.svg' %} <span>{{ _('Close') }}</span>
  </button>
</form>

<dialog id="save-dialog">
</dialog>

<dialog id="changes-dialog">
</dialog>

<dialog id="navigate-dialog">
</dialog>
{% endblock %}
