{% extends "SsoBackendBundle:Token:base.html.twig" %}

{% block title %}{{ parent() }} - Delete{% endblock %}

{% block body %}
    <br/><br/>
    {% if isDeleted %}
        <strong>The operation has been executed!</strong>
        <br/><br/>
        <a class=""
           href="{{ path('_admin_backend_index', {'ServiceNameId': serviceName.ServiceNameId}) }}">Back
            to overview</a>
    {% else %}
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">Delete Service Group</h3>
            </div>
            <div class="panel-body">
                {{ form_start(form) }}
                You are about to remove the Service Group &quot;<strong>{{ serviceName.serviceName }}</strong>&quot;
                from the system!
                <br/><br/>
                A Service Group should only be deleted if there are no tokens and/or services associated with it
                anymore,
                so
                make sure you removed all tokens and services from this group before removing it itself.
                <br/><br/>
                {% if countTokens > 0 %}
                    {% set singuplur = 's are' %}{% if countTokens == 1 %}{% set singuplur = ' is' %}{% endif %}
                    <strong>Warning: {{ countTokens }} token{{ singuplur }} still assigned to this group!</strong>
                    <br/>
                    All associations will be removed as well!
                    <br/><br/>
                {% endif %}
                {% if countServices > 0 %}
                    {% set singuplur = 's are' %}{% if countServices == 1 %}{% set singuplur = ' is' %}{% endif %}
                    <strong>Warning: {{ countServices }} service{{ singuplur }} still assigned to this group!</strong>
                    <br/>
                    All associations will be removed as well!
                    <br/><br/>
                {% endif %}
                {{ form_widget(form.servicenameid) }}
                <ul class="record_actions pull-left">
                    <li>
                        <a href="{{ path('_admin_backend_servicetoken_index') }}"
                           class="btn btn-default">Cancel</a></li>
                    <li>{{ form_widget(form.submit) }}</li>
                </ul>
                {{ form_end(form) }}
            </div>
        </div>
    {% endif %}
{% endblock %}
