<form method="post">
    {% csrf_token %}

    <div class="modal-header">
        <h5 class="modal-title">
            {% if not is_edit %}
            Add a domain
            {% else %}
            Edit a domain
            {% endif %}
        </h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
        </button>
    </div>
    <div class="modal-body">
        <table style="width: 100%">
        {{ form.as_table }}
        </table>
    </div>
    <div class="modal-footer">
        {% if is_edit %}
        <input type="hidden" id="hdnDomainId" name="hdnDomainId" value="{{ form.instance.id }}">
        {% endif %}
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
        <button type="submit" name="btnSaveDomain" class="btn btn-primary">Accept</button>
    </div>

</form>