215 lines
14 KiB
Twig
215 lines
14 KiB
Twig
{% extends "@admin/pages/user.html.twig" %}
|
|
|
|
|
|
{% block body_matter %}
|
|
{% block group_box %}
|
|
{% endblock %}
|
|
<div class="row">
|
|
<div class="col-lg-4">
|
|
<div id="view-user">
|
|
{% block user_box %}
|
|
<div class="box box-primary">
|
|
<div class="box-header with-border">
|
|
<h3 class="box-title">{{translate('USER.SUMMARY')}}</h3>
|
|
{% if 'tools' not in tools.hidden %}
|
|
<div class="box-tools pull-right">
|
|
<div class="btn-group">
|
|
<button type="button" class="btn btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
<i class="fas fa-cog"></i> <span class="caret"></span>
|
|
</button>
|
|
<ul class="dropdown-menu box-tool-menu">
|
|
{% block tools %}
|
|
<li>
|
|
<a href="#" class="js-user-edit" data-user_name="{{user.user_name}}">
|
|
<i class="fas fa-edit fa-fw"></i> {{translate('EDIT')}}
|
|
</a>
|
|
</li>
|
|
{% if 'password' not in tools.hidden %}
|
|
<li>
|
|
<a href="#" class="js-user-password" data-user_name="{{user.user_name}}">
|
|
<i class="fas fa-lock fa-fw"></i> {{translate('PASSWORD')}}
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
{% if 'roles' not in tools.hidden %}
|
|
<li>
|
|
<a href="#" class="js-user-roles" data-user_name="{{user.user_name}}">
|
|
<i class="fas fa-id-card fa-fw"></i> {{translate('ROLE', 2)}}
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
{% if 'organisations' not in tools.hidden %}
|
|
<li>
|
|
<a href="#" class="js-user-organisations" data-user_name="{{user.user_name}}">
|
|
<i class="fas fa-sitemap fa-fw"></i> {{translate('ORGANISATION', 2)}}
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
{% if 'activate' not in tools.hidden and user.flag_verified == "0" %}
|
|
<li>
|
|
<a href="#" class="js-user-activate" data-user_name="{{user.user_name}}">
|
|
<i class="fas fa-bolt fa-fw"></i> {{translate('ACTIVATE')}}
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
{% if 'enable' not in tools.hidden %}
|
|
{% if user.flag_enabled == "1" %}
|
|
<li>
|
|
<a href="#" class="js-user-disable" data-user_name="{{user.user_name}}">
|
|
<i class="fas fa-minus-circle fa-fw"></i> {{translate('DISABLE')}}
|
|
</a>
|
|
</li>
|
|
{% else %}
|
|
<li>
|
|
<a href="#" class="js-user-enable" data-user_name="{{user.user_name}}">
|
|
<i class="fas fa-plus-circle fa-fw"></i> {{translate('ENABLE')}}
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
{% endif %}
|
|
{% if 'delete' not in tools.hidden %}
|
|
<li>
|
|
<a href="#" class="js-user-delete" data-user_name="{{user.user_name}}">
|
|
<i class="fas fa-trash-alt fa-fw"></i> {{translate('DELETE')}}
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
{% endblock %}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
<div class="box-body box-profile">
|
|
<img class="profile-user-img img-responsive img-circle" src="{{user.avatar}}" alt="{{user.user_name}}">
|
|
|
|
<h3 class="profile-username text-center">{{user.full_name}}</h3>
|
|
<div class="text-center">
|
|
{% if user.flag_enabled == 0 %}
|
|
<i class="fas fa-fw fa-minus-circle fa-lg text-red" title="{{translate('DISABLED')}}"></i>
|
|
{% endif %}
|
|
{% if user.flag_verified == 0 %}
|
|
<i class="fas fa-fw fa-bolt fa-lg text-yellow" title="{{translate('UNACTIVATED')}}"></i>
|
|
{% endif %}
|
|
</div>
|
|
<h4 class="text-muted text-center">{{user.user_name}}{% if 'group' not in fields.hidden and user.group.name is not null %} • {{user.group.name}}{% endif %}</h4>
|
|
|
|
{% if 'email' not in fields.hidden %}
|
|
<hr>
|
|
<strong><i class="fas fa-envelope margin-r-5"></i> {{translate("EMAIL")}}</strong>
|
|
<p class="text-muted box-profile-property js-copy-container">
|
|
<i class="fas fa-copy uf-copy-trigger js-copy-trigger"></i>
|
|
<span class="js-copy-target">{{user.email}}</span>
|
|
</p>
|
|
{% endif %}
|
|
|
|
{% if 'locale' not in fields.hidden %}
|
|
<hr>
|
|
<strong><i class="fas fa-language margin-r-5"></i> {{translate("LOCALE")}}</strong>
|
|
<p class="text-muted box-profile-property">
|
|
{{locales[user.locale]}}
|
|
</p>
|
|
{% endif %}
|
|
|
|
{% block user_profile %}{% endblock %}
|
|
|
|
{% if 'roles' not in fields.hidden %}
|
|
<hr>
|
|
<strong><i class="fas fa-id-card margin-r-5"></i> {{translate("ROLE", 2)}}</strong>
|
|
<p class="box-profile-property">
|
|
{% for role in user.roles %}
|
|
<span class="label label-primary" title="{{role.description}}">{{role.name}}</span>
|
|
{% endfor %}
|
|
</p>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
{% block organisations_box %}
|
|
<div class="box box-primary">
|
|
<div class="box-header with-border">
|
|
<h3 class="box-title"><i class="fas fa-sitemap"></i> {{translate('USER.ORGANISATIONS')}}</h3>
|
|
</div>
|
|
<div class="box-body">
|
|
<p class="box-profile-property">
|
|
{% for organisation in user.organisations %}
|
|
<div class="row">
|
|
<div class="col-xs-9">
|
|
<a href="{{site.uri.public}}/organisations/o/{{organisation.slug}}" class="label bg-primary {% if organisation.flag_approved != 1 %}organisation-pending{% endif %} {% if organisation.pivot.flag_admin %}organisation-admin{% endif %}" title="{{organisation.description}}" data-text="{{organisation.name}}" style="font-size: 100%;">{{organisation.name}}</a>
|
|
<br>
|
|
<small class="user-organisation-description">{{organisation.description}}</small>
|
|
</div>
|
|
{% if checkAccess('update_user_field', { 'user' : user, 'fields' : ['organisations'] }) or hasRole('organisations-admin') -%}
|
|
<div class="col-xs-3" style="margin-top: -5px;">
|
|
<button type="button" data-slug="{{organisation.slug}}" data-user_name="{{user.user_name}}" class="btn btn-danger js-member-remove margin-r-5" style="min-width: 70px">{{translate("REMOVE")}}</button>
|
|
</div>
|
|
{% endif -%}
|
|
</div>
|
|
<hr class="row-divider">
|
|
{% endfor %}
|
|
{% for organisation in user.pendingOrganisations %}
|
|
<div class="row">
|
|
<div class="col-xs-9">
|
|
<a href="{{site.uri.public}}/organisations/o/{{organisation.slug}}" class="label bg-primary {% if organisation.flag_approved != 1 %}organisation-pending{% endif %} {% if organisation.pivot.flag_admin %}organisation-admin{% endif %}" title="{{organisation.description}}" data-text="{{organisation.name}}" style="font-size: 100%;">{{organisation.name}}</a>
|
|
<br>
|
|
<small class="user-organisation-description">{{organisation.description}}</small>
|
|
</div>
|
|
{% if checkAccess('update_user_field', { 'user' : user, 'fields' : ['organisations'] }) or hasRole('organisations-admin') -%}
|
|
<div class="col-xs-3" style="margin-top: -5px;">
|
|
<button type="button" data-slug="{{organisation.slug}}" data-user_name="{{user.user_name}}" class="btn btn-danger js-member-remove margin-r-5" style="min-width: 70px">{{translate("REMOVE")}}</button>
|
|
</div>
|
|
{% endif -%}
|
|
</div>
|
|
<hr class="row-divider">
|
|
{% endfor %}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
</div>
|
|
</div>
|
|
{% if checkAccess('view_user_field', { 'user': user, 'property': 'activities' }) %}
|
|
{% if 'activities' not in widgets.hidden %}
|
|
<div class="col-lg-8">
|
|
{% block activity_box %}
|
|
<div id="widget-user-activities" class="box box-primary">
|
|
<div class="box-header">
|
|
<h3 class="box-title"><i class="fas fa-fw fa-tasks"></i> {{translate('ACTIVITY', 2)}}</h3>
|
|
{% include "tables/table-tool-menu.html.twig" %}
|
|
</div>
|
|
<div class="box-body">
|
|
{% include "tables/activities.html.twig" with {
|
|
"table" : {
|
|
"id" : "table-user-activities"
|
|
}
|
|
}
|
|
%}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
</div>
|
|
{% endif %}
|
|
{% endif %}
|
|
</div>
|
|
{% if 'permissions' not in widgets.hidden %}
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div id="widget-permissions" class="box box-primary">
|
|
<div class="box-header">
|
|
<h3 class="box-title pull-left"><i class="fas fa-key fa-fw"></i> {{translate('PERMISSION', 2)}}</h3>
|
|
{% include "tables/table-tool-menu.html.twig" %}
|
|
</div>
|
|
<div class="box-body">
|
|
{% include "tables/permissions.html.twig" with {
|
|
"table" : {
|
|
"id" : "table-permissions",
|
|
"columns" : ["via_roles"]
|
|
}
|
|
}
|
|
%}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% endblock %} |