{% load i18n bootstrap3 %}

{% if object %}
    {% url 'devapp:edit_port' gid did object.pk as frm_url %}
    {% trans 'Edit' as modal_title %}
{% else %}
    {% url 'devapp:add_port' gid did as frm_url %}
    {% trans 'Add' as modal_title %}
{% endif %}

<form role="form" action="{{ frm_url }}" method="post">{% csrf_token %}
    <input type="hidden" value="yes" name="confirm">

    <div class="modal-header primary">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title"><span class="glyphicon glyphicon-exclamation-sign"></span>{{ modal_title }}</h4>
    </div>

    <div class="modal-body">
        {% bootstrap_form form %}
        {% bootstrap_button _('Save') button_type="submit" button_class="btn-primary" icon="save" size='sm' %}
    </div>

</form>
