From 2e9d55d8258e348aaa3c0efeae96df30bb556f68 Mon Sep 17 00:00:00 2001
From: Lukas Kimpel <lukas.kimpel@mni.thm.de>
Date: Thu, 15 Mar 2018 19:32:49 +0100
Subject: [PATCH] Reorder routes Add route to question carousel for participant

---
 src/app/app-routing.module.ts | 58 +++++++++++++++++++++--------------
 1 file changed, 35 insertions(+), 23 deletions(-)

diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts
index 43b4abaa1..23b61440d 100644
--- a/src/app/app-routing.module.ts
+++ b/src/app/app-routing.module.ts
@@ -17,33 +17,24 @@ import { AddContentComponent } from './add-content/add-content.component';
 import { ParticipantContentCarouselPageComponent } from './participant-content-carousel-page/participant-content-carousel-page.component';
 
 const routes: Routes = [
-  { path: '', redirectTo: '/home', pathMatch: 'full' },
-  { path: 'home', component: LoginScreenComponent },
   {
-    path: 'creator',
-    component: CreatorHomeScreenComponent,
-    canActivate: [AuthenticationGuard],
-    data: { roles: [UserRole.CREATOR] }
+    path: '',
+    redirectTo: '/home',
+    pathMatch: 'full'
   },
   {
-    path: 'participant',
-    component: ParticipantHomeScreenComponent,
-    canActivate: [AuthenticationGuard],
-    data: { roles: [UserRole.PARTICIPANT] }
+    path: 'home',
+    component: LoginScreenComponent
   },
   {
-    path: 'creator/room/:roomId',
-    component: CreatorRoomComponent,
-    canActivate: [AuthenticationGuard]
+    path: 'creator',
+    component: CreatorHomeScreenComponent,
+    canActivate: [AuthenticationGuard],
+    data: { roles: [UserRole.CREATOR] }
   },
   {
     path: 'creator/room/:roomId',
     component: CreatorRoomComponent,
-    canActivate: [AuthenticationGuard]
-  },
-  {
-    path: 'creator/room/:roomId/comments',
-    component: CommentListComponent,
     canActivate: [AuthenticationGuard],
     data: { roles: [UserRole.CREATOR] }
   },
@@ -60,20 +51,26 @@ const routes: Routes = [
     data: { roles: [UserRole.CREATOR] }
   },
   {
-    path: 'creator/room/:roomId/content-list',
+    path: 'creator/room/:roomId/comments',
+    component: CommentListComponent,
+    canActivate: [AuthenticationGuard],
+    data: { roles: [UserRole.CREATOR] }
+  },
+  {
+    path: 'creator/room/:roomId/content',
     component: ContentListComponent,
     canActivate: [AuthenticationGuard],
     data: { roles: [UserRole.CREATOR] }
   },
   {
-    path: 'creator/room/:roomId/:contentId',
+    path: 'creator/room/:roomId/content/:contentId',
     component: ContentDetailComponent,
     canActivate: [AuthenticationGuard],
     data: { roles: [UserRole.CREATOR] }
   },
   {
-    path: 'participant/room/:roomId/create-comment',
-    component: CreateCommentComponent,
+    path: 'participant',
+    component: ParticipantHomeScreenComponent,
     canActivate: [AuthenticationGuard],
     data: { roles: [UserRole.PARTICIPANT] }
   },
@@ -83,7 +80,22 @@ const routes: Routes = [
     canActivate: [AuthenticationGuard],
     data: { roles: [UserRole.PARTICIPANT] }
   },
-  { path: '**', component: PageNotFoundComponent }
+  {
+    path: 'participant/room/:roomId/create-comment',
+    component: CreateCommentComponent,
+    canActivate: [AuthenticationGuard],
+    data: { roles: [UserRole.PARTICIPANT] }
+  },
+  {
+    path: 'participant/room/:roomId/questions',
+    component: ParticipantContentCarouselPageComponent,
+    canActivate: [AuthenticationGuard],
+    data: { roles: [UserRole.PARTICIPANT] }
+  },
+  {
+    path: '**',
+    component: PageNotFoundComponent
+  }
 ];
 
 
-- 
GitLab