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

{% block title %}Administration{% endblock %}

{% block navigation %}{% include 'SsoBackendBundle:Layout:navigation.html.twig' %}{% endblock %}

{% block bodyhead %}
    <header class="page-header">
        <h2>Admin Frontend User Log - Show</h2>

        <div class="right-wrapper pull-right">
            <ol class="breadcrumbs">
                <li>
                    <a href="/">
                        <i class="fa fa-home"></i>
                    </a>
                </li>
                <li><span>Admin Frontend User Log - Show</span></li>
            </ol>
        </div>
    </header>
{% endblock %}

{% block body %}
    {% if userLogEntity %}
        <div class="row">
            <div class="col-xs-12">
                <div class="col-md-4 col-lg-3">

                    <section class="panel">
                        <div class="panel-body">
                            <div class="thumb-info mb-md">
                                <div class="thumb-info-title">
                                    <span class="thumb-info-inner">{{ userLogEntity.firstName }} {{ userLogEntity.lastName }}</span>
                                </div>
                            </div>
                            <hr class="dotted short">
                            <p>
                                <strong class="text-uppercase">Username</strong><br/>
                                {{ userLogEntity.userName }}
                            </p>
                            <p>
                                <strong class="text-uppercase">email</strong><br/>
                                {{ userLogEntity.userEmail }}
                            </p>
                            <p>
                                <strong class="text-uppercase">id</strong><br/>
                                {{ userLogEntity.id }}
                            </p>
                            <p>
                                <strong class="text-uppercase">guid</strong><br/>
                                {{ userLogEntity.userGuid }}
                            </p>
                            <p>
                                <strong class="text-uppercase">createdAt</strong><br/>
                                {% if userLogEntity.createdAt %}{{ userLogEntity.createdAt|date('Y-m-d H:i:s') }}{% endif %}
                            </p>
                            <p>
                                <strong class="text-uppercase">updatedAt</strong><br/>
                                {% if userLogEntity.updatedAt %}{{ userLogEntity.updatedAt|date('Y-m-d H:i:s') }}{% endif %}
                            </p>
                            <hr class="dotted short">
                        </div>
                    </section>
                    <a class="btn btn-info" href="{{ path('admin_saml_auth_user_log') }}">back to overview</a>
                </div>
                <div class="col-md-8 col-lg-9">
                    <div class="tabs">
                        <div class="tab-content">
                            <div id="activity" class="tab-pane active">
                                {{ render(url('admin_activitylog_list_by_user', {'userGuid': userLogEntity.id, 'page': app.request.query.get("page", 1)})) }}
                            </div>
                            <div id="timeline" class="tab-pane active">
                                <h4 class="mb-xlg">Login History</h4>
                                <div class="timeline timeline-simple mt-xlg mb-md">
                                    <div class="tm-body">
                                        {% for datestring,dateArray in userLoginHistory %}

                                            <div class="tm-title">
                                                <h3 class="h5 text-uppercase">{{ datestring }}</h3>
                                            </div>
                                            {% if dateArray is empty %}
                                                <ol class="tm-items"></ol>
                                            {% endif %}
                                            {% for login in dateArray %}
                                                <ol class="tm-items">
                                                    <li>
                                                        <div class="tm-box">
                                                            <p class="text-muted mb-none">{{ login.lastLoginAt|date('Y-m-d H:i:s') }}</p>
                                                            <p>
                                                                IDP User Identifier:
                                                                <span class="text-primary">{{ login.userIdentifier }}</span>
                                                            </p>
                                                        </div>
                                                    </li>
                                                </ol>
                                            {% endfor %}
                                        {% endfor %}
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    {% endif %}
{% endblock %}
