{% load i18n %}
{% load bootstrap_icons %}
{% if request.user.is_superuser %}
    <button class="btn btn-success float-end" type="button" data-bs-toggle="modal" data-bs-target="#AddNWFilterRule">
        <span aria-hidden="true">{% bs_icon 'plus' %} </span>
    </button>

    <!-- Modal Secret -->
    <div class="modal fade" id="AddNWFilterRule" tabindex="-1" role="dialog" aria-labelledby="AddNWFilterRule" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title">{% trans "Add New NWFilter Rule" %}</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body">
                    <form method="post" role="form" aria-label="Add new NWFilter rule form">{% csrf_token %}
                         <div class="row">
                            <div class="col-12" id="xmlheight">
                                <input type="hidden" name="nwfilterrule_xml"/>
                                <textarea id="rule_editor"></textarea>
                            </div>
                            <p class="text-muted">{% trans 'If there is a rule which has same attributes it replaces that rule' %}...</p>
                         </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{% trans "Close" %}</button>
                            <button type="submit" class="btn btn-primary" name="add_nwfilter_rule">{% trans "Add" %}</button>
                        </div>
                    </form>
                </div> <!-- /.modal-content -->
            </div>
        </div> <!-- /.modal-dialog -->
    </div><!-- /.modal -->
{% endif %}