commit
						a59417b8f5
					
				
					 6 changed files with 105 additions and 42 deletions
				
			
		|  | @ -14,6 +14,7 @@ | ||||||
|     const _router = useRouter(); // Zonder '_' gaf dit een linter error voor unused variable |     const _router = useRouter(); // Zonder '_' gaf dit een linter error voor unused variable | ||||||
| 
 | 
 | ||||||
|     const name: string = auth.authState.user!.profile.name!; |     const name: string = auth.authState.user!.profile.name!; | ||||||
|  |     const email = auth.authState.user!.profile.email; | ||||||
|     const initials: string = name |     const initials: string = name | ||||||
|         .split(" ") |         .split(" ") | ||||||
|         .map((n) => n[0]) |         .map((n) => n[0]) | ||||||
|  | @ -90,31 +91,34 @@ | ||||||
|             <!--            >--> |             <!--            >--> | ||||||
|             <!--                {{ t("discussions") }}--> |             <!--                {{ t("discussions") }}--> | ||||||
|             <!--            </v-btn>--> |             <!--            </v-btn>--> | ||||||
|             <v-menu open-on-hover> |  | ||||||
|                 <template v-slot:activator="{ props }"> |  | ||||||
|                     <v-btn |  | ||||||
|                         v-bind="props" |  | ||||||
|                         icon |  | ||||||
|                         variant="text" |  | ||||||
|                     > |  | ||||||
|                         <v-icon |  | ||||||
|                             icon="mdi-translate" |  | ||||||
|                             size="small" |  | ||||||
|                             color="#0e6942" |  | ||||||
|                         ></v-icon> |  | ||||||
|                     </v-btn> |  | ||||||
|                 </template> |  | ||||||
|                 <v-list> |  | ||||||
|                     <v-list-item |  | ||||||
|                         v-for="(language, index) in languages" |  | ||||||
|                         :key="index" |  | ||||||
|                         @click="changeLanguage(language.code)" |  | ||||||
|                     > |  | ||||||
|                         <v-list-item-title>{{ language.name }}</v-list-item-title> |  | ||||||
|                     </v-list-item> |  | ||||||
|                 </v-list> |  | ||||||
|             </v-menu> |  | ||||||
|         </v-toolbar-items> |         </v-toolbar-items> | ||||||
|  |         <v-menu | ||||||
|  |             open-on-hover | ||||||
|  |             open-on-click | ||||||
|  |         > | ||||||
|  |             <template v-slot:activator="{ props }"> | ||||||
|  |                 <v-btn | ||||||
|  |                     v-bind="props" | ||||||
|  |                     icon | ||||||
|  |                     variant="text" | ||||||
|  |                 > | ||||||
|  |                     <v-icon | ||||||
|  |                         icon="mdi-translate" | ||||||
|  |                         size="small" | ||||||
|  |                         color="#0e6942" | ||||||
|  |                     ></v-icon> | ||||||
|  |                 </v-btn> | ||||||
|  |             </template> | ||||||
|  |             <v-list> | ||||||
|  |                 <v-list-item | ||||||
|  |                     v-for="(language, index) in languages" | ||||||
|  |                     :key="index" | ||||||
|  |                     @click="changeLanguage(language.code)" | ||||||
|  |                 > | ||||||
|  |                     <v-list-item-title>{{ language.name }}</v-list-item-title> | ||||||
|  |                 </v-list-item> | ||||||
|  |             </v-list> | ||||||
|  |         </v-menu> | ||||||
|         <v-spacer></v-spacer> |         <v-spacer></v-spacer> | ||||||
|         <v-dialog max-width="500"> |         <v-dialog max-width="500"> | ||||||
|             <template v-slot:activator="{ props: activatorProps }"> |             <template v-slot:activator="{ props: activatorProps }"> | ||||||
|  | @ -158,12 +162,43 @@ | ||||||
|                 </v-card> |                 </v-card> | ||||||
|             </template> |             </template> | ||||||
|         </v-dialog> |         </v-dialog> | ||||||
|         <v-avatar |         <v-menu min-width="200px"> | ||||||
|             size="large" |             <template v-slot:activator="{ props }"> | ||||||
|             color="#0e6942" |                 <v-btn | ||||||
|             class="user-button" |                     icon | ||||||
|             >{{ initials }}</v-avatar |                     v-bind="props" | ||||||
|         > |                 > | ||||||
|  |                     <v-avatar | ||||||
|  |                         color="#0e6942" | ||||||
|  |                         size="large" | ||||||
|  |                         class="user-button" | ||||||
|  |                     > | ||||||
|  |                         <span>{{ initials }}</span> | ||||||
|  |                     </v-avatar> | ||||||
|  |                 </v-btn> | ||||||
|  |             </template> | ||||||
|  |             <v-card> | ||||||
|  |                 <v-card-text> | ||||||
|  |                     <div class="mx-auto text-center"> | ||||||
|  |                         <v-avatar color="#0e6942"> | ||||||
|  |                             <span class="text-h5">{{ initials }}</span> | ||||||
|  |                         </v-avatar> | ||||||
|  |                         <h3>{{ name }}</h3> | ||||||
|  |                         <p class="text-caption mt-1">{{ email }}</p> | ||||||
|  |                         <v-divider class="my-3"></v-divider> | ||||||
|  |                         <v-btn | ||||||
|  |                             variant="text" | ||||||
|  |                             rounded | ||||||
|  |                             append-icon="mdi-logout" | ||||||
|  |                             @click="performLogout" | ||||||
|  |                             to="/login" | ||||||
|  |                             >{{ t("logout") }}</v-btn | ||||||
|  |                         > | ||||||
|  |                         <v-divider class="my-3"></v-divider> | ||||||
|  |                     </div> | ||||||
|  |                 </v-card-text> | ||||||
|  |             </v-card> | ||||||
|  |         </v-menu> | ||||||
|     </v-app-bar> |     </v-app-bar> | ||||||
|     <v-navigation-drawer |     <v-navigation-drawer | ||||||
|         v-model="drawer" |         v-model="drawer" | ||||||
|  | @ -248,6 +283,12 @@ | ||||||
|         text-transform: none; |         text-transform: none; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     .translate-button { | ||||||
|  |         z-index: 1; | ||||||
|  |         position: relative; | ||||||
|  |         margin-left: 10px; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     @media (max-width: 700px) { |     @media (max-width: 700px) { | ||||||
|         .menu { |         .menu { | ||||||
|             display: none; |             display: none; | ||||||
|  |  | ||||||
|  | @ -84,7 +84,10 @@ | ||||||
|                 </div> |                 </div> | ||||||
|             </div> |             </div> | ||||||
|             <div class="container_right"> |             <div class="container_right"> | ||||||
|                 <v-menu open-on-hover> |                 <v-menu | ||||||
|  |                     open-on-hover | ||||||
|  |                     open-on-click | ||||||
|  |                 > | ||||||
|                     <template v-slot:activator="{ props }"> |                     <template v-slot:activator="{ props }"> | ||||||
|                         <v-btn |                         <v-btn | ||||||
|                             v-bind="props" |                             v-bind="props" | ||||||
|  |  | ||||||
|  | @ -1,6 +1,20 @@ | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
|  |     import { useRouter } from "vue-router"; | ||||||
|     import dwengoLogo from "../../../assets/img/dwengo-groen-zwart.svg"; |     import dwengoLogo from "../../../assets/img/dwengo-groen-zwart.svg"; | ||||||
|     import auth from "@/services/auth/auth-service.ts"; |     import auth from "@/services/auth/auth-service.ts"; | ||||||
|  |     import { watch } from "vue"; | ||||||
|  | 
 | ||||||
|  |     const router = useRouter(); | ||||||
|  | 
 | ||||||
|  |     watch( | ||||||
|  |         () => auth.isLoggedIn.value, | ||||||
|  |         async (newVal) => { | ||||||
|  |             if (newVal) { | ||||||
|  |                 await router.push("/user"); | ||||||
|  |             } | ||||||
|  |         }, | ||||||
|  |         { immediate: true }, | ||||||
|  |     ); | ||||||
| 
 | 
 | ||||||
|     async function loginAsStudent(): Promise<void> { |     async function loginAsStudent(): Promise<void> { | ||||||
|         await auth.loginAs("student"); |         await auth.loginAs("student"); | ||||||
|  | @ -9,10 +23,6 @@ | ||||||
|     async function loginAsTeacher(): Promise<void> { |     async function loginAsTeacher(): Promise<void> { | ||||||
|         await auth.loginAs("teacher"); |         await auth.loginAs("teacher"); | ||||||
|     } |     } | ||||||
| 
 |  | ||||||
|     async function performLogout(): Promise<void> { |  | ||||||
|         await auth.logout(); |  | ||||||
|     } |  | ||||||
| </script> | </script> | ||||||
| 
 | 
 | ||||||
| <template> | <template> | ||||||
|  | @ -65,13 +75,6 @@ | ||||||
|                 </div> |                 </div> | ||||||
|             </ul> |             </ul> | ||||||
|         </div> |         </div> | ||||||
|         <div v-if="auth.isLoggedIn.value"> |  | ||||||
|             <p> |  | ||||||
|                 You are currently logged in as {{ auth.authState.user!.profile.name }} ({{ auth.authState.activeRole }}) |  | ||||||
|             </p> |  | ||||||
|             <v-btn @click="performLogout">Logout</v-btn> |  | ||||||
|             <v-btn to="/user">home</v-btn> |  | ||||||
|         </div> |  | ||||||
|     </main> |     </main> | ||||||
| </template> | </template> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -143,6 +143,13 @@ | ||||||
|         box-sizing: border-box; |         box-sizing: border-box; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     h1 { | ||||||
|  |         color: #0e6942; | ||||||
|  |         text-transform: uppercase; | ||||||
|  |         font-weight: bolder; | ||||||
|  |         font-size: 50px; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     .center-btn { |     .center-btn { | ||||||
|         display: block; |         display: block; | ||||||
|         margin-left: auto; |         margin-left: auto; | ||||||
|  |  | ||||||
|  | @ -95,6 +95,13 @@ | ||||||
|         justify-content: center; |         justify-content: center; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     h1 { | ||||||
|  |         color: #0e6942; | ||||||
|  |         text-transform: uppercase; | ||||||
|  |         font-weight: bolder; | ||||||
|  |         font-size: 50px; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     .dropdowns { |     .dropdowns { | ||||||
|         display: flex; |         display: flex; | ||||||
|         justify-content: space-between; |         justify-content: space-between; | ||||||
|  |  | ||||||
|  | @ -287,6 +287,8 @@ | ||||||
|                     <template v-slot:default> |                     <template v-slot:default> | ||||||
|                         <v-btn |                         <v-btn | ||||||
|                             class="button-in-nav" |                             class="button-in-nav" | ||||||
|  |                             width="100%" | ||||||
|  |                             :color="COLORS.teacherExclusive" | ||||||
|                             @click="assign()" |                             @click="assign()" | ||||||
|                             >{{ t("assignLearningPath") }}</v-btn |                             >{{ t("assignLearningPath") }}</v-btn | ||||||
|                         > |                         > | ||||||
|  |  | ||||||
		Reference in a new issue
	
	 Laure Jablonski
						Laure Jablonski