Link back and front all get #115

Merged
tonitch merged 40 commits from wal/front/listingUsers into master 2024-03-18 20:20:37 +01:00
4 changed files with 12 additions and 8 deletions
Showing only changes of commit a5807148e1 - Show all commits

View File

@ -49,7 +49,7 @@ public class MockController {
User herobrine = new User("brine","hero","admin@admin.com","in your WalLs","ShadowsLand",new Date(0), null,Role.Admin,passwordEncoder.encode("admin")); User herobrine = new User("brine","hero","admin@admin.com","in your WalLs","ShadowsLand",new Date(0), null,Role.Admin,passwordEncoder.encode("admin"));
User joe = new User("Mama","Joe","student@student.com","roundabout","DaWarudo",new Date(0), null,Role.Student,passwordEncoder.encode("student")); User joe = new User("Mama","Joe","student@student.com","roundabout","DaWarudo",new Date(0), null,Role.Student,passwordEncoder.encode("student"));
User meh = new User("Inspiration","lackOf","secretary@secretary.com","a Box","the street",new Date(0), null,Role.Teacher,passwordEncoder.encode("secretary")); User meh = new User("Inspiration","lackOf","secretary@secretary.com","a Box","the street",new Date(0), null,Role.Secretary,passwordEncoder.encode("secretary"));
User joke = new User("CthemBalls","Lemme","teacher@teacher.com","lab","faculty",new Date(0), null,Role.Teacher,passwordEncoder.encode("teacher")); User joke = new User("CthemBalls","Lemme","teacher@teacher.com","lab","faculty",new Date(0), null,Role.Teacher,passwordEncoder.encode("teacher"));
mockUsers = new ArrayList<>(Arrays.asList(herobrine,joe,meh,joke)); mockUsers = new ArrayList<>(Arrays.asList(herobrine,joe,meh,joke));

View File

@ -86,6 +86,7 @@ public class UserController {
toReturn.put("country",user.getCountry()); toReturn.put("country",user.getCountry());
toReturn.put("address",user.getAddress()); toReturn.put("address",user.getAddress());
toReturn.put("role",user.getRole()); toReturn.put("role",user.getRole());
toReturn.put("email",user.getEmail());
return toReturn; return toReturn;
} }

View File

@ -119,7 +119,10 @@
</div> </div>
<div class="page"> <div class="page">
<div style=" margin:50px;"> <div style=" margin:50px;">
<Suspense>
<component :is="currentView" /> <component :is="currentView" />
</Suspense>
</div> </div>
</div> </div>
</div> </div>

View File

@ -3,7 +3,8 @@
import {getSelf} from '../rest/Users.js' import {getSelf} from '../rest/Users.js'
import i18n from "@/i18n.js" import i18n from "@/i18n.js"
import { uploadProfilePicture } from '@/rest/uploads.js' import { uploadProfilePicture } from '@/rest/uploads.js'
const user = getSelf(); const user = await getSelf();
console.log(user)
console.log(user.role) console.log(user.role)
console.log("test") console.log("test")
/* /*
@ -62,17 +63,16 @@ function getPP(){
<div> <div>
E-mail: {{user.email}} E-mail: {{user.email}}
</div> </div>
<div v-if="user.role=='Student'"> <div v-if="user.role==='Student'">
{{user.option}} {{i18n(user.role)}} {{user.option}} {{i18n(user.role.toLowerCase())}}
</div> </div>
<div v-else> <div v-else>
{{i18n("faculty")}}: {{user.faculty}} Role: {{i18n((user.role).toLowerCase())}}
Role: {{i18n(user.role)}}
</div> </div>
<div> <div>
<button @click="modif=!modif"> {{i18n("profile.modify.data")}} </button> <button @click="modif=!modif"> {{i18n("profile.modify.data")}} </button>
</div> </div>
<div v-if="(user.role=='student')"> <div v-if="(user.role==='Student')">
<button @click="reg=!reg">{{i18n("profile.reRegister")}}</button> <button @click="reg=!reg">{{i18n("profile.reRegister")}}</button>
<button @click="unreg=!unreg" style="float:right;background-color:rgb(150,0,0);">{{i18n("profile.unRegister")}}</button> <button @click="unreg=!unreg" style="float:right;background-color:rgb(150,0,0);">{{i18n("profile.unRegister")}}</button>
<button @click="curric=!curric">{{i18n("profile.change.curriculum")}}</button> <button @click="curric=!curric">{{i18n("profile.change.curriculum")}}</button>
@ -108,7 +108,7 @@ function getPP(){
</div> </div>
<div v-if="modif==false"class="moreInfos"> <div v-if="modif==false"class="moreInfos">
<div v-if="(user.role=='student')"> <div v-if="(user.role==='Student')">
<div class="listTitle"> <div class="listTitle">
{{i18n("profile.course.list")}} {{i18n("profile.course.list")}}
</div> </div>