Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a9574a8

Browse files
authoredApr 5, 2017
Merge pull request parti-renaissance#762 from EnMarche/feat-admin-adherents-privileges
[Admin] adherents list show all privileges of a user account.
2 parents abe89ea + 10ace06 commit a9574a8

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed
 

‎app/Resources/views/admin/adherent_status.html.twig

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
{% extends 'SonataAdminBundle:CRUD:base_list_field.html.twig' %}
22

33
{% block field %}
4-
{% if object.isReferent %}
5-
<span class="label label-primary">Référent</span>
6-
{% elseif object.isProcurationManager %}
7-
<span class="label label-primary">Procuration</span>
8-
{% elseif object.isHost %}
9-
<span class="label label-primary" style="background-color: #90ade6 !important;">Animateur</span>
4+
{% if object.hasAdvancedPrivileges %}
5+
{% if object.isReferent %}
6+
<span class="label label-primary" style="padding: 2px;">Référent</span><br/>
7+
{% endif %}
8+
9+
{% if object.isProcurationManager %}
10+
<span class="label label-primary" style="padding: 2px;">Procuration</span><br/>
11+
{% endif %}
12+
13+
{% if object.isHost %}
14+
<span class="label label-primary" style="background-color: #90ade6 !important; padding: 2px;">Animateur</span><br/>
15+
{% endif %}
16+
1017
{% else %}
1118
<span class="label label-default">Adhérent</span>
1219
{% endif %}

‎src/AppBundle/Entity/Adherent.php

+5
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,11 @@ public function getType(): string
202202
return 'ADHERENT';
203203
}
204204

205+
public function hasAdvancedPrivileges(): bool
206+
{
207+
return $this->isReferent() || $this->isProcurationManager() || $this->isHost();
208+
}
209+
205210
public function getPassword(): string
206211
{
207212
return !$this->password ? $this->oldPassword : $this->password;

0 commit comments

Comments
 (0)
Please sign in to comment.