From 012f5f147263085b97505d1ee1bc76a532b88ae4 Mon Sep 17 00:00:00 2001
From: Alex ORLUC <alex.orluc@maarch.org>
Date: Thu, 11 Apr 2019 11:44:29 +0200
Subject: [PATCH] add slide toggle notifications profile

---
 src/frontend/app/app-material.module.ts         |  9 ++++++---
 src/frontend/app/profile/profile.component.html | 10 ++++++++++
 src/frontend/app/profile/profile.component.scss |  5 +++++
 3 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/src/frontend/app/app-material.module.ts b/src/frontend/app/app-material.module.ts
index 4713c2ce52..eff14f4bc4 100755
--- a/src/frontend/app/app-material.module.ts
+++ b/src/frontend/app/app-material.module.ts
@@ -15,7 +15,8 @@ import {
   MatExpansionModule,
   MatTabsModule,
   MatSliderModule,
-  MatSelectModule
+  MatSelectModule,
+  MatSlideToggleModule
 } from '@angular/material';
 
 import { MatMenuModule } from '@angular/material/menu';
@@ -40,7 +41,8 @@ import {DragDropModule} from '@angular/cdk/drag-drop';
       MatMenuModule,
       MatTabsModule,
       MatSliderModule,
-      MatSelectModule
+      MatSelectModule,
+      MatSlideToggleModule
   ],
   exports: [
       MatSidenavModule,
@@ -59,7 +61,8 @@ import {DragDropModule} from '@angular/cdk/drag-drop';
       MatMenuModule,
       MatTabsModule,
       MatSliderModule,
-      MatSelectModule
+      MatSelectModule,
+      MatSlideToggleModule
   ]
 })
 export class AppMaterialModule { }
diff --git a/src/frontend/app/profile/profile.component.html b/src/frontend/app/profile/profile.component.html
index 3155808750..ee77049c0b 100644
--- a/src/frontend/app/profile/profile.component.html
+++ b/src/frontend/app/profile/profile.component.html
@@ -69,6 +69,16 @@
                 </mat-tab>
                 <mat-tab label="Préférences">
                     <div class="profile-content">
+                        <div class="input-row">
+                                <fieldset>
+                                    <legend align="left">Notifications</legend>
+                                    <div class="form-container">
+                                        <div class="form-col notification">
+                                            <mat-slide-toggle [checked]="this.profileInfo.preferences.notifications" (change)="this.profileInfo.preferences.notifications=!this.profileInfo.preferences.notifications" color="primary">Recevoir les notifications</mat-slide-toggle>
+                                        </div>
+                                    </div>
+                                </fieldset>
+                            </div>
                         <div class="input-row">
                             <fieldset>
                                 <legend align="left">Mode de l'annotation</legend>
diff --git a/src/frontend/app/profile/profile.component.scss b/src/frontend/app/profile/profile.component.scss
index e36319a3a0..65cceac4c6 100644
--- a/src/frontend/app/profile/profile.component.scss
+++ b/src/frontend/app/profile/profile.component.scss
@@ -151,4 +151,9 @@ legend {
 .form-col {
   display:table-cell;
   vertical-align:middle;
+}
+
+.notification {
+  text-align: left;
+  padding : 10px;
 }
\ No newline at end of file
-- 
GitLab