{% load i18n %}

    <div class="modal" id="attributes-delete-modal" tabindex="-1">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <h2 class="modal-title">
                        {% trans 'Delete attribute' %}
                    </h2>
                </div>

                <div class="modal-body">
                    <p>
                        {% blocktrans trimmed with object='{$ service.values.uri $}' %}
                        You are about to permanently delete the attribute <code>{{ object }}</code>.
                        {% endblocktrans %}
                    </p>

                    <p ng-show="service.values.children.length">
                        {% trans 'This will also delete the following attributes:' %}
                    </p>

                    <ul>
                        <li ng-repeat="attribute in service.values.children" ng-include src="'nested_attributes_delete.html'">
                    </ul>

                    <script type="text/ng-template" id="nested_attributes_delete.html">
                    <code>{$ attribute.uri $}</code>

                    <ul>
                        <li ng-repeat="attribute in attribute.children" ng-include src="'nested_attributes_delete.html'"></li>
                    </ul>
                    </script>

                    <p>
                        {% blocktrans trimmed with values_count='{$ service.values.values_count $}' projects_count='{$ service.values.projects_count $}' %}
                        This attribute is used for <b>{{ values_count }} values</b> in <b>{{ projects_count }} projects</b>.
                        {% endblocktrans %}
                        {% trans 'Furthermore, this attribute is used in the following elements:' %}
                    </p>

                    <ul>
                        <li><b>{$ service.values.conditions.length $} {% trans 'conditions' %}</b></li>
                        <li><b>{$ service.values.questionsets.length $} {% trans 'questionsets' %}</b></li>
                        <li><b>{$ service.values.questions.length $} {% trans 'questions' %}</b></li>
                        <li>
                            <b>
                                {$ service.values.tasks_as_start.length + service.values.tasks_as_end.length $}
                                {% trans 'tasks' %}
                            </b>
                        </li>
                    </ul>

                    <p ng-show="service.values.children.length">
                        <b>{% trans 'This does not include references from the attributes above. Please check carefully.' %}</b>
                    </p>

                    <p class="text-danger">
                        {% trans 'This action cannot be undone!' %}
                    </p>
                </div>

                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">
                        {% trans 'Close' %}
                    </button>
                    <button type="button" class="btn btn-danger"
                            ng-click="service.submitDeleteModal('attributes')">
                        {% trans 'Delete' %}
                    </button>
                </div>
            </div>
        </div>
    </div>
