{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}

{% block form_id %}add_l3policy_form{% endblock %}
{% block form_action %}{% url 'horizon:project:network_policy:addl3policy' %}{% endblock %}

{% block modal-header %}{% trans "Add L3Policy" %}{% endblock %}

{% block modal-body %}
<div class="left">
    <fieldset>
    {% include "horizon/common/_form_fields.html" %}
    </fieldset>
</div>
<div class="right">
    <h3>{% trans "Description:" %}</h3>
    <p>{% trans "Add L3 Policy." %}</p>
</div>
{% endblock %}


{% block modal-js %}
<script>
 $(function(){
   if($('#id_external_segments>option:selected').val() == ''){
       $('#id_segment_ip').parent().parent().hide();
   }
   $('#id_external_segments').on('change',function(){
   if($('#id_external_segments>option:selected').val() == ''){
       $('#id_segment_ip').parent().parent().hide();
   }else{
       $('#id_segment_ip').parent().parent().show();
   }
  });
});
</script>
{% endblock %}



{% block modal-footer %}
  <input class="btn btn-primary pull-right" type="submit" value="{% trans "Save Changes" %}" />
  <a href="{% url 'horizon:project:network_policy:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}    
