{% extends "horizon/common/_modal_form.html" %}
{% load i18n horizon humanize %}

{% block form_id %}{% endblock %}
{% block form_action %}{% url 'horizon:project:dns_domains:create_record' domain.id %}{% endblock %}

{% block modal_id %}create_record_modal{% endblock %}
{% block modal-header %}{% trans "Create Record for" %} {{ domain.name }}{% endblock %}

{% block modal-body %}

   <div id="scoped-content">
   {% include 'project/dns_domains/prefix_field_style.html' %}
     <fieldset>
     {% include "horizon/common/_form_fields.html" %}
     </fieldset>
   </div>

  {% blocktrans trimmed %}
  <p>
    <strong>TTL</strong>
    The TTL is the time-to-live for the record, in seconds.
  </p>
  <p>
    See <a href="http://en.wikipedia.org/wiki/List_of_DNS_record_types" target="_designate_record_defs">more info</a> on record types.
  </p>
  {% endblocktrans %}
  <script type="text/javascript">
    // Empty hidden form fields when the record type is switched
    // https://bugs.launchpad.net/designate/+bug/1525199
    $("select#id_type.form-control.switchable").eq(0).change(function() {
      $(this).closest('fieldset')
        .find("input[type=text], textarea").filter(":hidden")
        .val("");
    })
  </script>
{% endblock %}
