<commit_before>{% extends 'layouts/content/members-area.html.twig' %}

{% block title %}{{ 'Users'|trans }} | {{ parent() }}{% endblock %}

{% block main %}
	<h1>
		{{ 'Users'|trans }}
		<a class="btn btn-primary btn-sm" href="{{ url('members-area.users.new') }}">
			{{ 'New'|trans }}
		</a>
	</h1>
	<ol class="breadcrumb">
		<li>
			<a href="{{ url('members-area') }}">
				{{ 'Home' | trans }}
			</a>
		</li>
		<li class="active">
			{{ 'Users' | trans }}
		</li>
	</ol>
	<div class="table-responsive">
		<table class="table table-striped table-condensed">
			<thead>
				<tr>
					<th>{{ paginator_sortable(pagination, 'Email', 'u.email') }}</th>
					<th>{{ paginator_sortable(pagination, 'Username', 'u.username') }}</th>
					<th width="150">
						{{ 'Profile' | trans }}
						(
							{{ paginator_sortable(pagination, 'First name', 'p.firstName') }},
							{{ paginator_sortable(pagination, 'Last name', 'p.lastName') }}
						)
					</th>
					<th width="140">
						{{ 'Statuses' | trans }}
						(
							{{ paginator_sortable(pagination, 'Enabled', 'u.enabled') }},
							{{ paginator_sortable(pagination, 'Locked', 'u.locked') }}
						)
					</th>
					<th width="200">{{ 'Roles' | trans }}</th>
					<th width="160">{{ paginator_sortable(pagination, 'Time created', 'u.timeCreated') }}</th>
					<th width="160">{{ paginator_sortable(pagination, 'Time last active', 'u.timeLastActive') }}</th>
					<th width="200">{{ 'Actions'|trans }}</th>
				</tr>
			</thead>
			<tbody>
				{% for user in pagination.getItems() %}
					<tr class="{{ user.isLocked() ? 'danger' : '' }}">
						<td>{{ user.getEmail() }}</td>
						<td>{{ user.getUsername() }}</td>
						<td>
							{% if user.getProfile() %}
								<div>
									<b>{{ 'First name'|trans }}:</b>
									{{ user.getProfile().getFirstName() }}
								</div>
								<div class="{{ user.getProfile().getLastName() == '' ? 'hidden' : '' }}">
									<b>{{ 'Last name'|trans }}:</b>
									{{ user.getProfile().getLastName() }}
								</div>
							{% endif %}
							{% if user.getProfile().getImageUrl() %}
								<div>
									<b>{{ 'Image'|trans }}:</b>
									<a href="{{ user.getProfile().getImageUrl() }}" target="_blank">
										<img src="{{ user.getProfile().getImageUrl() }}" alt="User image" style="max-width: 64px;" />
									</a>
								</div>
							{% endif %}
						</td>
						<td>
							<div>
								<b>{{ 'Enabled'|trans }}:</b>
								{{ user.isEnabled() ? 'Yes'|trans : 'No'|trans }}
							</div>
							<div>
								<b>{{ 'Locked'|trans }}:</b>
								{{ user.isLocked() ? 'Yes'|trans : 'No'|trans }}
							</div>
						</td>
						<td>{{ user.getRoles()|join(', ') }}</td>
						<td>{{ user.getTimeCreated() | date(app.dateTimeFormat) }}</td>
						<td>
							{% if user.getTimeLastActive() %}
								{{ user.getTimeLastActive() | date(app.dateTimeFormat) }}
							{% endif %}
						</td>
						<td>
							<a class="btn btn-sm btn-default"
								data-toggle="tooltip" title="{{ 'View'|trans }}"
								href="{{ url('members-area.users.detail', { id : user.getId() }) }}">
								<i class="fa fa-fw fa-info"></i>
							</a>
							<a class="btn btn-sm btn-default"
							 	data-toggle="tooltip" title="{{ 'Edit'|trans }}"
								href="{{ url('members-area.users.edit', { id : user.getId() }) }}">
								<i class="fa fa-fw fa-cog"></i>
							</a>
							{% if is_granted('ROLE_PREVIOUS_ADMIN') %}
									<a class="btn btn-sm btn-default"
										data-toggle="tooltip"
										title="{{ 'First you must switch back to your own account'|trans }}"
										href="#">
									<i class="fa fa-fw fa-refresh"></i>
								</a>
							{% elseif user.isEnabled() != true %}
								<a class="btn btn-sm btn-default"
									data-toggle="tooltip"
									title="{{ 'The user needs to be enabled to switch to his account'|trans }}"
									href="#">
									<i class="fa fa-fw fa-refresh"></i>
								</a>
							{% elseif user.isLocked() == true %}
								<a class="btn btn-sm btn-default"
									data-toggle="tooltip"
									title="{{ 'You can not switch to a locked user!'|trans }}"
									href="#">
									<i class="fa fa-fw fa-refresh"></i>
								</a>
							{% else %}
								<a class="btn btn-sm btn-default"
									data-toggle="tooltip" title="{{ 'Switch'|trans }}"
									href="?switch_user={{ user.getUsername() }}">
									<i class="fa fa-fw fa-refresh"></i>
								</a>
							{% endif %}
							<a class="btn btn-sm btn-default"
								data-toggle="tooltip" title="{{ 'Remove'|trans }}"
								href="{{ url('members-area.users.remove', { id : user.getId() }) }}">
								<i class="fa fa-fw fa-times"></i>
							</a>
						</td>
					</tr>
				{% else %}
					<tr>
						<td colspan="9">
							{{ 'No users found' | trans }}
						</td>
					</tr>
				{% endfor %}
			</tbody>
		</table>
		{{ paginator_render(pagination) }}
	</div>
{% endblock %}<commit_msg>Style change<commit_after>{% extends 'layouts/content/members-area.html.twig' %}

{% block title %}{{ 'Users'|trans }} | {{ parent() }}{% endblock %}

{% block main %}
	<h1>
		{{ 'Users'|trans }}
		<a class="btn btn-primary btn-sm" href="{{ url('members-area.users.new') }}">
			{{ 'New'|trans }}
		</a>
	</h1>
	<ol class="breadcrumb">
		<li>
			<a href="{{ url('members-area') }}">
				{{ 'Home' | trans }}
			</a>
		</li>
		<li class="active">
			{{ 'Users' | trans }}
		</li>
	</ol>
	<div class="table-responsive">
		<table class="table table-striped table-condensed">
			<thead>
				<tr>
					<th>{{ paginator_sortable(pagination, 'Email', 'u.email') }}</th>
					<th>{{ paginator_sortable(pagination, 'Username', 'u.username') }}</th>
					<th width="150">
						{{ 'Profile' | trans }}
						(
							{{ paginator_sortable(pagination, 'First name', 'p.firstName') }},
							{{ paginator_sortable(pagination, 'Last name', 'p.lastName') }}
						)
					</th>
					<th width="140">
						{{ 'Statuses' | trans }}
						(
							{{ paginator_sortable(pagination, 'Enabled', 'u.enabled') }},
							{{ paginator_sortable(pagination, 'Locked', 'u.locked') }}
						)
					</th>
					<th width="200">{{ 'Roles' | trans }}</th>
					<th width="160">{{ paginator_sortable(pagination, 'Time created', 'u.timeCreated') }}</th>
					<th width="160">{{ paginator_sortable(pagination, 'Time last active', 'u.timeLastActive') }}</th>
					<th width="200">{{ 'Actions'|trans }}</th>
				</tr>
			</thead>
			<tbody>
				{% for user in pagination.getItems() %}
					<tr class="{{ user.isLocked() ? 'danger' : '' }}">
						<td>{{ user.getEmail() }}</td>
						<td>{{ user.getUsername() }}</td>
						<td>
							{% if user.getProfile() %}
								<div>
									<b>{{ 'First name'|trans }}:</b>
									{{ user.getProfile().getFirstName() }}
								</div>
								<div class="{{ user.getProfile().getLastName() == '' ? 'hidden' : '' }}">
									<b>{{ 'Last name'|trans }}:</b>
									{{ user.getProfile().getLastName() }}
								</div>
							{% endif %}
							{% if user.getProfile().getImageUrl() %}
								<div>
									<b>{{ 'Image'|trans }}:</b>
									<a href="{{ user.getProfile().getImageUrl() }}" target="_blank">
										<img src="{{ user.getProfile().getImageUrl() }}" alt="User image" style="max-width: 64px;" />
									</a>
								</div>
							{% endif %}
						</td>
						<td>
							<div>
								<b>{{ 'Enabled'|trans }}:</b>
								{{ user.isEnabled() ? 'Yes'|trans : 'No'|trans }}
							</div>
							<div>
								<b>{{ 'Locked'|trans }}:</b>
								{{ user.isLocked() ? 'Yes'|trans : 'No'|trans }}
							</div>
						</td>
						<td>{{ user.getRoles()|join(', ') }}</td>
						<td>{{ user.getTimeCreated() | date(app.dateTimeFormat) }}</td>
						<td>
							{% if user.getTimeLastActive() %}
								{{ user.getTimeLastActive() | date(app.dateTimeFormat) }}
							{% endif %}
						</td>
						<td>
							<a class="btn btn-sm btn-default"
								data-toggle="tooltip" title="{{ 'View'|trans }}"
								href="{{ url('members-area.users.detail', { id : user.getId() }) }}">
								<i class="fa fa-fw fa-info"></i>
							</a>
							<a class="btn btn-sm btn-default"
							 	data-toggle="tooltip" title="{{ 'Edit'|trans }}"
								href="{{ url('members-area.users.edit', { id : user.getId() }) }}">
								<i class="fa fa-fw fa-cog"></i>
							</a>
							{% if is_granted('ROLE_PREVIOUS_ADMIN') %}
									<a class="btn btn-sm btn-default"
										data-toggle="tooltip"
										title="{{ 'First you must switch back to your own account'|trans }}"
										href="#">
									<i class="fa fa-fw fa-refresh"></i>
								</a>
							{% elseif user.isEnabled() != true %}
								<a class="btn btn-sm btn-default"
									data-toggle="tooltip"
									title="{{ 'The user needs to be enabled to switch to his account'|trans }}"
									href="#">
									<i class="fa fa-fw fa-refresh"></i>
								</a>
							{% elseif user.isLocked() == true %}
								<a class="btn btn-sm btn-default"
									data-toggle="tooltip"
									title="{{ 'You can not switch to a locked user!'|trans }}"
									href="#">
									<i class="fa fa-fw fa-refresh"></i>
								</a>
							{% else %}
								<a class="btn btn-sm btn-default"
									data-toggle="tooltip" title="{{ 'Switch'|trans }}"
									href="?switch_user={{ user.getUsername() }}">
									<i class="fa fa-fw fa-refresh"></i>
								</a>
							{% endif %}
							<a class="btn btn-sm btn-danger"
								data-toggle="tooltip" title="{{ 'Remove'|trans }}"
								href="{{ url('members-area.users.remove', { id : user.getId() }) }}">
								<i class="fa fa-fw fa-times"></i>
							</a>
						</td>
					</tr>
				{% else %}
					<tr>
						<td colspan="9">
							{{ 'No users found' | trans }}
						</td>
					</tr>
				{% endfor %}
			</tbody>
		</table>
		{{ paginator_render(pagination) }}
	</div>
{% endblock %}
{'fraction_non_alphanumeric': 0.2282410225197809, 'fraction_numerical': 0.004666260904848854, 'mean_word_length': 2.2516490765171504, 'pattern_counts': {'":': 0, '<': 225, '<?xml version=': 0, '>': 225, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1560251', 'n_tokens_mistral': 4967, 'n_tokens_neox': 3349, 'n_words': 699}