From 4068064d4db0e5a69d079131b78f9991e82ff65b Mon Sep 17 00:00:00 2001
From: Alex Orluc <alex.orluc@maarch.org>
Date: Thu, 15 Feb 2018 15:23:09 +0100
Subject: [PATCH] FEAT #92 move tab privileges with informations tab

---
 .../Views/group-administration.component.html | 100 +++++++++---------
 .../js/angular/lang/lang-en.js                |   1 +
 .../js/angular/lang/lang-en.ts                |   1 +
 .../js/angular/lang/lang-fr.js                |   1 +
 .../js/angular/lang/lang-fr.ts                |   1 +
 5 files changed, 55 insertions(+), 49 deletions(-)

diff --git a/apps/maarch_entreprise/Views/group-administration.component.html b/apps/maarch_entreprise/Views/group-administration.component.html
index 4028ea1e844..4e9319203c7 100644
--- a/apps/maarch_entreprise/Views/group-administration.component.html
+++ b/apps/maarch_entreprise/Views/group-administration.component.html
@@ -12,7 +12,7 @@
 <div *ngIf="!loading" class="container-fluid">
 
 
-    <div class="col-md-6">
+    <div class="col-md-6 col-md-offset-3">
         <mat-tab-group [(selectedIndex)]="selectedTabIndex_1">
             <mat-tab label="{{lang.informations}}">
                 <form class="form-horizontal" (ngSubmit)="onSubmit()" #groupForm="ngForm">
@@ -73,7 +73,7 @@
                         </ng-container>
                         <ng-container matColumnDef="actions">
                             <mat-header-cell *matHeaderCellDef mat-sort-header></mat-header-cell>
-                            <mat-cell *matCellDef="let element">
+                            <mat-cell *matCellDef="let element" style="text-align:right;">
                                 <button mat-icon-button color="primary" matTooltip="{{lang.view}}" routerLink="/administration/users/{{element.id}}">
                                     <mat-icon class="fa fa-eye" aria-hidden="true"></mat-icon>
                                 </button>
@@ -84,6 +84,55 @@
                     </mat-table>
                 </div>
             </mat-tab>
+            <mat-tab label="{{lang.privileges}}" *ngIf="!creationMode">
+                <mat-tab-group [(selectedIndex)]="selectedTabIndex_2" *ngIf="!creationMode">
+                    <mat-tab label="{{lang.menus}}">
+                        <mat-expansion-panel *ngFor="let upperService of group.services.menu; let i = index">
+                            <mat-expansion-panel-header>
+                                <mat-panel-title>
+                                    {{lang[upperService[0]['location']]}}
+                                </mat-panel-title>
+                            </mat-expansion-panel-header>
+                            <mat-list>
+                                <mat-list-item *ngFor="let service of upperService">
+                                    <mat-slide-toggle color="primary" name="{{service.name}}" [checked]="service.checked" [(ngModel)]="service.checked" (change)="updateService(service)"
+                                        matTooltip="{{service.comment}}">{{service.name}}</mat-slide-toggle>
+                                </mat-list-item>
+                            </mat-list>
+                        </mat-expansion-panel>
+                    </mat-tab>
+                    <mat-tab label="{{lang.administrationServices}}">
+                        <mat-expansion-panel *ngFor="let upperService of group.services.administration; let i = index">
+                            <mat-expansion-panel-header>
+                                <mat-panel-title>
+                                    {{lang[upperService[0]['location']]}}
+                                </mat-panel-title>
+                            </mat-expansion-panel-header>
+                            <mat-list>
+                                <mat-list-item *ngFor="let service of upperService">
+                                    <mat-slide-toggle color="primary" name="{{service.name}}" [checked]="service.checked" [(ngModel)]="service.checked" (change)="updateService(service)"
+                                        matTooltip="{{service.comment}}">{{service.name}}</mat-slide-toggle>
+                                </mat-list-item>
+                            </mat-list>
+                        </mat-expansion-panel>
+                    </mat-tab>
+                    <mat-tab label="{{lang.functionnalities}}">
+                        <mat-expansion-panel *ngFor="let upperService of group.services.use; let i = index">
+                            <mat-expansion-panel-header>
+                                <mat-panel-title>
+                                    {{lang[upperService[0]['location']]}}
+                                </mat-panel-title>
+                            </mat-expansion-panel-header>
+                            <mat-list>
+                                <mat-list-item *ngFor="let service of upperService">
+                                    <mat-slide-toggle color="primary" name="{{service.name}}" [checked]="service.checked" [(ngModel)]="service.checked" (change)="updateService(service)"
+                                        matTooltip="{{service.comment}}">{{service.name}}</mat-slide-toggle>
+                                </mat-list-item>
+                            </mat-list>
+                        </mat-expansion-panel>
+                    </mat-tab>
+                </mat-tab-group>
+            </mat-tab>
         </mat-tab-group>
     </div>
     <div class="col-md-6">
@@ -144,52 +193,5 @@
                 </div>
             </mat-card-content>
         </mat-card>
-        <mat-tab-group [(selectedIndex)]="selectedTabIndex_2" *ngIf="!creationMode">
-            <mat-tab label="{{lang.menus}}">
-                <mat-expansion-panel *ngFor="let upperService of group.services.menu; let i = index">
-                    <mat-expansion-panel-header>
-                        <mat-panel-title>
-                            {{lang[upperService[0]['location']]}}
-                        </mat-panel-title>
-                    </mat-expansion-panel-header>
-                    <mat-list>
-                        <mat-list-item *ngFor="let service of upperService">
-                            <mat-slide-toggle color="primary" name="{{service.name}}" [checked]="service.checked" [(ngModel)]="service.checked" (change)="updateService(service)"
-                                matTooltip="{{service.comment}}">{{service.name}}</mat-slide-toggle>
-                        </mat-list-item>
-                    </mat-list>
-                </mat-expansion-panel>
-            </mat-tab>
-            <mat-tab label="{{lang.administrationServices}}">
-                <mat-expansion-panel *ngFor="let upperService of group.services.administration; let i = index">
-                    <mat-expansion-panel-header>
-                        <mat-panel-title>
-                            {{lang[upperService[0]['location']]}}
-                        </mat-panel-title>
-                    </mat-expansion-panel-header>
-                    <mat-list>
-                        <mat-list-item *ngFor="let service of upperService">
-                            <mat-slide-toggle color="primary" name="{{service.name}}" [checked]="service.checked" [(ngModel)]="service.checked" (change)="updateService(service)"
-                                matTooltip="{{service.comment}}">{{service.name}}</mat-slide-toggle>
-                        </mat-list-item>
-                    </mat-list>
-                </mat-expansion-panel>
-            </mat-tab>
-            <mat-tab label="{{lang.functionnalities}}">
-                <mat-expansion-panel *ngFor="let upperService of group.services.use; let i = index">
-                    <mat-expansion-panel-header>
-                        <mat-panel-title>
-                            {{lang[upperService[0]['location']]}}
-                        </mat-panel-title>
-                    </mat-expansion-panel-header>
-                    <mat-list>
-                        <mat-list-item *ngFor="let service of upperService">
-                            <mat-slide-toggle color="primary" name="{{service.name}}" [checked]="service.checked" [(ngModel)]="service.checked" (change)="updateService(service)"
-                                matTooltip="{{service.comment}}">{{service.name}}</mat-slide-toggle>
-                        </mat-list-item>
-                    </mat-list>
-                </mat-expansion-panel>
-            </mat-tab>
-        </mat-tab-group>
     </div>
 </div>
\ No newline at end of file
diff --git a/apps/maarch_entreprise/js/angular/lang/lang-en.js b/apps/maarch_entreprise/js/angular/lang/lang-en.js
index e254e5f431b..910151e082e 100755
--- a/apps/maarch_entreprise/js/angular/lang/lang-en.js
+++ b/apps/maarch_entreprise/js/angular/lang/lang-en.js
@@ -171,6 +171,7 @@ exports.LANG_EN = {
     "priorityDeleted": "Priority deleted",
     "priorityModification": "Priority modification",
     "priorityUpdated": "Priority updated",
+    "privileges": "Privileges",
     "processAction": "Process action(s)",
     "processDelay": "Process delay",
     "processDelayDoctype": "doctype delay is used",
diff --git a/apps/maarch_entreprise/js/angular/lang/lang-en.ts b/apps/maarch_entreprise/js/angular/lang/lang-en.ts
index e8695655a65..7101c0a74c9 100755
--- a/apps/maarch_entreprise/js/angular/lang/lang-en.ts
+++ b/apps/maarch_entreprise/js/angular/lang/lang-en.ts
@@ -169,6 +169,7 @@ export const LANG_EN = {
     "priorityDeleted"           : "Priority deleted",
     "priorityModification"      : "Priority modification",
     "priorityUpdated"           : "Priority updated",
+    "privileges"                : "Privileges",
     "processAction"             : "Process action(s)",
     "processDelay"              : "Process delay",
     "processDelayDoctype"       : "doctype delay is used",
diff --git a/apps/maarch_entreprise/js/angular/lang/lang-fr.js b/apps/maarch_entreprise/js/angular/lang/lang-fr.js
index a9f946cd334..2cfec80b874 100755
--- a/apps/maarch_entreprise/js/angular/lang/lang-fr.js
+++ b/apps/maarch_entreprise/js/angular/lang/lang-fr.js
@@ -191,6 +191,7 @@ exports.LANG_FR = {
     "priorityDeleted": "Priorité supprimée",
     "priorityModification": "Modification d'une priorité",
     "priorityUpdated": "Priorité modifiée",
+    "privileges": "Privilèges",
     "processAction": "Action(s) de traitement",
     "processDelay": "Délai de traitement",
     "processDelayDoctype": "utilise le délai selon le type de document",
diff --git a/apps/maarch_entreprise/js/angular/lang/lang-fr.ts b/apps/maarch_entreprise/js/angular/lang/lang-fr.ts
index dc01c96013d..1dc598b8329 100755
--- a/apps/maarch_entreprise/js/angular/lang/lang-fr.ts
+++ b/apps/maarch_entreprise/js/angular/lang/lang-fr.ts
@@ -189,6 +189,7 @@ export const LANG_FR = {
     "priorityDeleted"               : "Priorité supprimée",
     "priorityModification"          : "Modification d'une priorité",
     "priorityUpdated"               : "Priorité modifiée",
+    "privileges"                    : "Privilèges",
     "processAction"                 : "Action(s) de traitement",
     "processDelay"                  : "Délai de traitement",
     "processDelayDoctype"           : "utilise le délai selon le type de document",
-- 
GitLab