Added organisations to users page
This commit is contained in:
104
templates/pages/user.html.twig
Normal file
104
templates/pages/user.html.twig
Normal file
@@ -0,0 +1,104 @@
|
||||
{% extends "@blockier-templates/pages/user.html.twig" %}
|
||||
|
||||
|
||||
{% 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 %}
|
||||
|
||||
|
||||
{% block user_box %}
|
||||
{{ parent() }}
|
||||
<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 hasRole('site-admin') or hasRole('organisations-admin') -%}
|
||||
<div class="col-xs-3">
|
||||
<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 hasRole('site-admin') or hasRole('organisations-admin') -%}
|
||||
<div class="col-xs-3">
|
||||
<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 %}
|
||||
Reference in New Issue
Block a user