added avatars, show user teams in list, new team dashboard widgets (#1150)
This commit is contained in:
@@ -46,7 +46,7 @@
|
||||
|
||||
{% if user.id is not empty %}
|
||||
{% if is_granted('view', user) %}
|
||||
{% set actions = {'profile-stats': {'url': path('user_profile', {'username' : user.username})}} %}
|
||||
{% set actions = actions|merge({'profile-stats': {'url': path('user_profile', {'username' : user.username})}}) %}
|
||||
{% endif %}
|
||||
{% if is_granted('edit', user) %}
|
||||
{% set actions = actions|merge({'edit': path('user_profile_edit', {'username' : user.username})}) %}
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
{% set columns = {
|
||||
'alias': 'alwaysVisible',
|
||||
'username': 'hidden-xs',
|
||||
'email': 'hidden-xs hidden-sm',
|
||||
'title': 'hidden-xs',
|
||||
'email': 'hidden-xs hidden-md hidden-sm',
|
||||
'title': 'hidden-xs hidden-sm',
|
||||
} %}
|
||||
{% for pref in preferences %}
|
||||
{% set columns = columns|merge({
|
||||
@@ -16,7 +16,8 @@
|
||||
}) %}
|
||||
{% endfor %}
|
||||
{% set columns = columns|merge({
|
||||
'roles': {'class': 'hidden-xs', 'orderBy': false},
|
||||
'roles': {'class': 'hidden-xs hidden-sm', 'orderBy': false},
|
||||
'team': {'class': 'hidden-xs', 'orderBy': false},
|
||||
'active': {'class': '', 'orderBy': false},
|
||||
'actions': 'actions alwaysVisible',
|
||||
}) %}
|
||||
@@ -40,7 +41,7 @@
|
||||
|
||||
{% for entry in entries %}
|
||||
<tr{% if is_granted('edit', entry) %} class="open-edit alternative-link" data-href="{{ path('user_profile_edit', {'username': entry.username}) }}"{% endif %}>
|
||||
<td>{{ widgets.username(entry) }}</td>
|
||||
<td>{{ widgets.user_avatar(entry) }} {{ widgets.username(entry) }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'username') }}">{{ entry.username }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'email') }}">{{ entry.email }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'title') }}">{{ entry.title }}</td>
|
||||
@@ -53,12 +54,22 @@
|
||||
</td>
|
||||
{% endfor %}
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'roles') }}">
|
||||
{% set showUserRole = entry.roles|length == 1 %}
|
||||
{% for role in entry.roles %}
|
||||
{% if role != 'ROLE_USER' %}
|
||||
{% if showUserRole or role != 'ROLE_USER' %}
|
||||
{{ widgets.label_role(role) }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'team') }}">
|
||||
{% for team in entry.teams %}
|
||||
{% if entry.isTeamleadOf(team) %}
|
||||
{{ widgets.label_team(team, 'success') }}
|
||||
{% else %}
|
||||
{{ widgets.label_team(team) }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'active') }}">{{ widgets.label_visible(entry.enabled) }}</td>
|
||||
<td class="actions">
|
||||
{{ actions.user(entry, 'index') }}
|
||||
|
||||
@@ -48,10 +48,11 @@
|
||||
|
||||
<div class="box box-{{ admin_lte_context.widget.type }}">
|
||||
<div class="box-body box-profile">
|
||||
{{ macro.avatar(user.avatar, user.username, 'profile-user-img img-responsive img-circle') }}
|
||||
<h3 class="profile-username text-center">{{ widgets.username(user) }}</h3>
|
||||
|
||||
<p class="text-muted text-center">{{ user.title }}</p>
|
||||
<div class="text-center">
|
||||
{{ widgets.user_avatar(user) }}
|
||||
<h3 class="profile-username">{{ widgets.username(user) }}</h3>
|
||||
<p class="text-muted">{{ user.title }}</p>
|
||||
</div>
|
||||
|
||||
<ul class="list-group list-group-unbordered">
|
||||
|
||||
|
||||
54
templates/user/teams.html.twig
Normal file
54
templates/user/teams.html.twig
Normal file
@@ -0,0 +1,54 @@
|
||||
{% extends 'user/layout.html.twig' %}
|
||||
{% import "macros/widgets.html.twig" as widgets %}
|
||||
|
||||
{% block main %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="box box-{{ admin_lte_context.widget.type }} data_table">
|
||||
<div class="box-body no-padding">
|
||||
<div class="dataTables_wrapper form-inline dt-bootstrap">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<table class="table table-hover dataTable" role="grid">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ 'label.team'|trans }}</th>
|
||||
<th>{{ 'label.teamlead'|trans }}</th>
|
||||
<th>{{ 'label.user'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for team in user.teams %}
|
||||
<tr>
|
||||
<td>
|
||||
{{ team.name }}
|
||||
</td>
|
||||
<td>
|
||||
{{ widgets.user_avatar(team.teamlead) }}
|
||||
{#
|
||||
{{ widgets.label(team.teamlead.displayName, 'success', 'label.teamlead'|trans) }}
|
||||
#}
|
||||
</td>
|
||||
<td class="avatars">
|
||||
{% for user in team.users %}
|
||||
{{ widgets.user_avatar(user) }}
|
||||
{#
|
||||
{{ widgets.label_user(user) }}
|
||||
#}
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user