{% extends './layout/default' %}

{% block breadcrumbs %}
    {{ Breadcrumbs.render(Route.getCurrentRoute.getName, user) }}
{% endblock %}
{% block content %}
    <div class="row">
        <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
            <div class="box box-primary">
                <div class="box-header with-border">
                    <h3 class="box-title">{{ 'user_information'|_ }}</h3>
                </div>
                <div class="box-body">
                    <table class="table table-striped table-bordered table-responsive">
                        <tbody>
                        <tr>
                            <td>{{ trans('list.id') }}</td>
                            <td>#{{ user.id }}</td>
                        </tr>
                        <tr>
                            <td>{{ trans('list.email') }}</td>
                            <td><a href="mailto:{{ user.email }}">{{ user.email }}</a>
                            <td>
                        </tr>
                        <tr>
                            <td>{{ trans('list.created_at') }}</td>
                            <td>
                                {{ user.created_at.isoFormat(monthAndDayFormat) }}
                                {{ user.created_at.format('H:i') }}</td>
                        </tr>
                        <tr>
                            <td>{{ trans('list.is_admin') }}</td>
                            <td>
                                {% if information.is_admin %}
                                    <small class="text-success"><span class="fa fa-fw fa-check"></span></small> {{ 'yes'|_ }}
                                {% else %}
                                    <small class="text-danger"><span class="fa fa-fw fa-times"></span></small> {{ 'no'|_ }}
                                {% endif %}
                            </td>
                        </tr>
                        <tr>
                            <td>{{ trans('list.has_two_factor') }}</td>
                            <td>
                                {% if information.has_2fa %}
                                    <small class="text-success"><span class="fa fa-fw fa-check"></span></small> {{ 'yes'|_ }}
                                {% else %}
                                    <small class="text-danger"><span class="fa fa-fw fa-times"></span></small> {{ 'no'|_ }}
                                {% endif %}
                            </td>
                        </tr>
                        <tr>
                            <td>{{ trans('list.is_blocked') }}</td>
                            <td>
                                {% if information.blocked %}
                                    <small class="text-danger"><span class="fa fa-fw fa-check" title="{{ 'yes'|_ }}"></span></small> {{ 'yes'|_ }}:

                                    {% if information.blocked_code == "" %}
                                        <em>~</em>
                                    {% else %}
                                        {{ information.blocked_code }}
                                    {% endif %}

                                {% else %}
                                    <small class="text-success"><span class="fa fa-fw fa-times" title="{{ 'no'|_ }}"></span></small> {{ 'no'|_ }}
                                {% endif %}
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
            <div class="box box-primary">
                <div class="box-header with-border">
                    <h3 class="box-title">{{ 'user_data_information'|_ }}</h3>
                </div>
                <div class="box-body">
                    <table class="table table-striped table-bordered table-responsive">
                        <tr>
                            <td>{{ trans('list.accounts_count') }}</td>
                            <td>{{ information.accounts }}</td>
                        </tr>
                        <tr>
                            <td>{{ trans('list.journals_count') }}</td>
                            <td>{{ information.journals }} ({{ information.transactions }} {{ trans('firefly.transactions') }})</td>
                        </tr>
                        <tr>
                            <td>{{ trans('list.attachments_count') }}</td>
                            <td>{{ information.attachments }} ({{ trans('firefly.total_size') }}: {{ information.attachments_size|filesize }})</td>
                        </tr>
                        <tr>
                            <td>{{ trans('list.bills_count') }}</td>
                            <td>{{ information.bills }}</td>
                        </tr>
                        <tr>
                            <td>{{ trans('list.categories_count') }}</td>
                            <td>{{ information.categories }}</td>
                        </tr>
                        <tr>
                            <td>{{ trans('list.budget_count') }}</td>
                            <td>{{ trans_choice('firefly.budget_or_budgets', information.budgets ) }},
                                {{ trans_choice('firefly.budgets_with_limits', information.budgets_with_limits ) }}</td>
                        </tr>
                        <tr>
                            <td>{{ trans('list.rule_and_groups_count') }}</td>
                            <td>
                                {{ trans('firefly.nr_of_rules_in_total_groups', {count_rules: information.rules, count_groups: information.rule_groups}) }}
                            </td>
                        </tr>
                        <tr>
                            <td>{{ trans('list.tags_count') }}</td>
                            <td>{{ trans_choice('firefly.tag_or_tags', information.tags ) }}</td>
                        </tr>

                    </table>
                </div>
            </div>
        </div>
    </div>
{% endblock %}
