{% extends 'base/two.column.6-6.html.twig' %}

{% set title = app.user.name %}

{% block column2 %}
    <h5>Change profile</h5>
    {{ form(form) }}
{% endblock %}

{% block column1 %}
    <h5>Api</h5>
    <div class="input-group mb-3">
        <span class="input-group-text" id="api-key">Api Key</span>
        <input type="text" class="form-control" aria-label="Username" aria-describedby="api-key"
               value="{{ app.user.apiKey }}" readonly>
        <a type="button" class="btn btn-outline-secondary" href="{{ path('user_apikey_generate') }}">Regenerate</a> <br/>
    </div>
    {% if is_granted('ROLE_ADMIN') %}
        <h5>Latest release stats</h5>
        <table class="table table-bordered table-hover">
            <thead>
            <tr>
                <th>Property</th>
                <th>Value</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td>Branch</td>
                <td>{{ release.branch }}</td>
            </tr>
            <tr>
                <td>Date</td>
                <td>{{ release.date }}</td>
            </tr>
            <tr>
                <td>Hash short</td>
                <td>{{ release.commitHashShort }}</td>
            </tr>
            <tr>
                <td>Hash long</td>
                <td>{{ release.commitHashLong }}</td>
            </tr>
            <tr>
                <td>Commit date</td>
                <td>{{ release.commitDate }}</td>
            </tr>
            </tbody>
        </table>
    {% endif %}
{% endblock %}