{% extends "SsoBackendBundle:Token:base.html.twig" %}
{% block title %}Token Show{% endblock %}

{% block body %}
    <h2>Token View</h2>
    <ul class="list-group">
        <li class="list-group-item">
            <strong>Token:</strong><br/>
            {{ entity.ServiceToken }}&nbsp;
        </li>
    </ul>
    <ul class="list-group">
        <li class="list-group-item">
            <strong>ServiceToken2Ip</strong>:<br/>
            {{ entity.ServiceToken2Ip }}&nbsp;
        </li>
    </ul>
    <ul class="list-group">
        <li class="list-group-item">
            <strong>AllowedCallsPerDay:</strong><br/>
            {{ entity.AllowedCallsPerDay }}&nbsp;
        </li>
    </ul>
    <ul class="list-group">
        <li class="list-group-item">
            <strong>ValidUntil:</strong><br/>
            {{ entity.ValidUntil|date('Y-m-d') }}&nbsp;
        </li>
    </ul>
    <ul class="list-group">
        <li class="list-group-item">
            <strong>Restricted Access:</strong><br/>
            {{ entity.accessRestricted ? 'Yes' : 'No' }}&nbsp;
        </li>
    </ul>
    <ul class="list-group">
        <li class="list-group-item">
            <strong>Description:</strong><br/>
            {{ entity.Description }}&nbsp;
        </li>
    </ul>
    <ul class="list-group">
        <li class="list-group-item">
            <strong>Connected Services:</strong><br/>
            <ul>
                {% for ServiceName in entity.ServiceNames %}
                    {% for Service in ServiceName.Services %}
                        <li>
                            {{ Service.ServiceController }}-{{ Service.ServiceAction }}
                        </li>
                    {% endfor %}
                {% endfor %}
            </ul>
        </li>
    </ul>
    <ul class="record_actions clearfix">
        <li>
            <a class="btn btn-success" href="{{ path('_admin_backend_token_list') }}">
                Back to the list
            </a>
        </li>
        <li>
            <a class="btn btn-primary"
               href="{{ path('_admin_backend_token_edit', { 'tokenId': entity.ServiceToken }) }}">
                Edit Token
            </a>
        </li>
        {#
        <li>
            {{ form(delete_form) }}
        </li>
        #}
    </ul>

{% endblock %}
