{% extends 'base.html' %}
{% load i18n static django_bootstrap5 %}


{% block content_title %}<h2>{{ title }}</h2>{% endblock %}

{% block content %}

  {% include 'xform_howto.html' %}

  {% if uploaded_file_url %}
      <p>{% trans "Currently" %} <a href="{{ uploaded_file_url }}">{{ uploaded_file_url }}</a></p>
  {% endif %}

  <form method="post" enctype="multipart/form-data">
      {% csrf_token %}
      <input type="file" name="xml_template_file" accept=".xml" class="form-control">
      <div class="form-text">{% blocktrans %}XML form generated by {% endblocktrans %}<a href="https://getodk.org/xlsform/" target="_blank">https://getodk.org/xlsform/</a></div>
      <div class="mt-2">
        {% if pk %}
          <a class="btn btn-secondary" href="{% url 'odk:xform_detail' pk %}" role="button"><i class="fas fa-arrow-circle-left me-2"></i>{% trans "Back" %}</a>
        {% else %}
          <a class="btn btn-secondary" href="{% url 'odk:xform_list' %}" role="button"><i class="fas fa-arrow-circle-left me-2"></i>{% trans "Back" %}</a>
        {% endif %}
        <button type="submit" class="btn btn-primary"><i class="far fa-save me-2"></i>{% trans "Save" %}</button>
      </div>
  </form>

    

{% endblock %}

<!-- Load js -->
{% block js %}
    {{ block.super }}
    <script src="{% static 'js/enableajaxindjango.js' %}"></script>
    <script src="{% static 'js/required_fields.js' %}"></script>
{% endblock js %}
