From 0cb2be96947b7568a5da838ea7b4d1bbac29a5fb Mon Sep 17 00:00:00 2001
From: Alex Orluc <alex.orluc@maarch.org>
Date: Mon, 29 Jan 2018 17:05:56 +0100
Subject: [PATCH] FEAT #28 add modal view for users

---
 ...ministration-redirect-modal.component.html | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 apps/maarch_entreprise/Views/users-administration-redirect-modal.component.html

diff --git a/apps/maarch_entreprise/Views/users-administration-redirect-modal.component.html b/apps/maarch_entreprise/Views/users-administration-redirect-modal.component.html
new file mode 100644
index 00000000000..637d47e8676
--- /dev/null
+++ b/apps/maarch_entreprise/Views/users-administration-redirect-modal.component.html
@@ -0,0 +1,38 @@
+<h2 mat-dialog-title>Changement de destinataire des modèles de liste de diffusion</h2>
+<mat-dialog-content>
+    <form #changeDiffListDestForm="ngForm">
+        <div class="modal-body">
+            <div class="alert alert-warning" role="alert">
+                <b>{{this.data.userDestRedirect.firstname}} {{this.data.userDestRedirect.lastname}}</b> est en
+                <b>destinataire</b> des modèles liste de difffusion suivante, veuillez choisir un utilisateur de
+                <b>remplacement</b> :
+            </div>
+            <div *ngFor="let userDestRedirectModel of data.userDestRedirectModels" id="{{userDestRedirectModel.object_id}}" class="form-group">
+
+                <mat-form-field class="example-full-width">
+                    <input [(ngModel)]="userDestRedirectModel.redirectUserId" type="text" placeholder="Nouveau destinataire pour : {{userDestRedirectModel.title}}"
+                        matInput [matAutocomplete]="auto" [formControl]="userCtrl" required>
+                    <mat-autocomplete #auto="matAutocomplete">
+                        <mat-option *ngFor="let user of filteredUsers | async" [value]="user.user_id">
+                            <div class="container-fluid">
+                                <div class="col-md-1">
+                                    <mat-icon class="fa fa-user fa-2x"></mat-icon>
+                                </div>
+                                <div class="col-md-11">
+                                    {{ user.firstname }} {{ user.lastname }}
+                                    <small>{{ user.user_id }}</small>
+                                </div>
+                            </div>
+                        </mat-option>
+                    </mat-autocomplete>
+                </mat-form-field>
+            </div>
+        </div>
+        <mat-dialog-actions>
+            <button mat-raised-button color="warn" *ngIf="data.userDestRedirect.mode == 'del'" type="button" class="btn btn-danger" (click)="dialogRef.close(this.data.userDestRedirectModels)"
+                [disabled]="!changeDiffListDestForm.form.valid">{{lang.delete}} {{lang.user}}</button>
+            <button mat-raised-button color="primary" *ngIf="data.userDestRedirect.mode == 'up'" type="button" (click)="dialogRef.close(this.data.userDestRedirectModels)"
+                [disabled]="!changeDiffListDestForm.form.valid">{{lang.suspend}} {{lang.user}}</button>
+        </mat-dialog-actions>
+    </form>
+</mat-dialog-content>
\ No newline at end of file
-- 
GitLab