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

{% block breadcrumbs %}
    {{ Breadcrumbs.renderIfExists(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-responsive">
                    <table class="table table-striped table-bordered">
                        <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.formatLocalized(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"><i class="fa fa-fw fa-check"></i></small> Yes
                                {% else %}
                                    <small class="text-danger"><i class="fa fa-fw fa-times"></i></small> No
                                {% endif %}
                            </td>
                        </tr>
                        <tr>
                            <td>{{ trans('list.has_two_factor') }}</td>
                            <td>
                                {% if information.has_2fa %}
                                    <small class="text-success"><i class="fa fa-fw fa-check"></i></small> Yes
                                {% else %}
                                    <small class="text-danger"><i class="fa fa-fw fa-times"></i></small> No
                                {% endif %}
                            </td>
                        </tr>
                        <tr>
                            <td>{{ trans('list.is_blocked') }}</td>
                            <td>
                                {% if information.blocked %}
                                    <small class="text-danger"><i class="fa fa-fw fa-check" title="{{ 'yes'|_ }}"></i></small> Yes:

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

                                {% else %}
                                    <small class="text-success"><i class="fa fa-fw fa-times" title="{{ 'no'|_ }}"></i></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-responsive">
                    <table class="table table-striped table-bordered">
                        <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.export_jobs_count') }}</td>
                            <td>{{ information.export_jobs }}, {{ trans('firefly.successful_count', {count: information.export_jobs_success}) }}
                                <!-- of which x successful --></td>
                        </tr>
                        <tr>
                            <td>{{ trans('list.import_jobs_count') }}</td>
                            <td>{{ information.import_jobs }}, {{ trans('firefly.successful_count', {count: information.import_jobs_success}) }}
                                <!-- of which x successful --></td>
                        </tr>
                        <tr>
                            <td>{{ trans('list.budget_count') }}</td>
                            <td>{{ information.budgets }} {{ trans('firefly.budget_or_budgets') }},
                                {{ information.budgets_with_limits }} {{ trans('firefly.budgets_with_limits') }}</td>
                        </tr>
                        <tr>
                            <td>{{ trans('list.rule_and_groups_count') }}</td>
                            <td>
                                {{ information.rules }} {{ 'rule_or_rules'|_ }} {{ 'in'|_ }} {{ information.rule_groups }}

                                {{ 'rulegroup_or_groups'|_ }}
                            </td>
                        </tr>
                        <tr>
                            <td>{{ trans('list.tags_count') }}</td>
                            <td>{{ information.tags }} tags</td>
                        </tr>

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