{% extends "horizon/common/_modal_form.html" %}

{% load i18n %}

{% block form_name %}metadataForm{% endblock %}
{% block form_validation %}novalidate{% endblock %}
{% block ng_controller %}hzModalFormUpdateMetadataCtrl{% endblock %}

{% block modal-body %}
  <hz-metadata-tree available="available"
                    existing="existing"
                    model="tree"></hz-metadata-tree>
  <script type="text/javascript">
    var existing_metadata = {{ existing_metadata|safe }};
    var available_metadata = {{ available_metadata|safe }};
  </script>
{% endblock %}

{% block modal-footer %}
  <div>
    <input class="btn btn-primary pull-right"
           ng-disabled="metadataForm.$invalid"
           ng-click="saveMetadata()" type="submit"
           value="{% trans "Save" %}"/>
    <a class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
    <input type="hidden" name="metadata" ng-value="metadata"
           ng-model="metadata">
  </div>
{% endblock %}
