1
0
forked from PGL/Clyde
Clyde/frontend/src/Apps/AboutStudent.vue

182 lines
4.4 KiB
Vue
Raw Normal View History

<script setup>
2024-03-23 18:04:36 +01:00
import i18n from "@/i18n.js"
import {getUser} from '../rest/Users.js'
import {getSomeonesCurriculumList} from "@/rest/curriculum.js";
2024-03-23 18:04:36 +01:00
const props = defineProps(['target']);
let user = await getUser(props.target);
let UserCurriculum = await getSomeonesCurriculumList(props.target);
2024-03-23 18:04:36 +01:00
function getPP(){
if(user.profilePictureUrl === null){
2024-03-23 18:04:36 +01:00
return "/Clyde.png"
}
return user.profilePictureUrl
}
//Cette function renvoie l'année académique concernée si on est dans l'année 2023-2024 elle renvoie 2023
//car dans la db l'année scolaire 2023-2024 est representée juste par 2023 (le même système s'applique pour chaque années on prend la borne inférieure
function getYear(){
let date = new Date();
if (date.getMonth() <= 6){
return date.getFullYear()-1
}
return date.getFullYear()
}
</script>
<template>
2024-03-23 18:04:36 +01:00
<div class="body">
<div class="container">
<div class="profilPic">
<img class="subContainter" :src=getPP()>
</div>
<div class = "globalInfos">
<div class="infosContainer">
<div>
FirstName/Name : {{user.firstName}} {{user.lastName}}
2024-03-23 18:04:36 +01:00
</div>
<div>
E-mail: {{user.email}}
</div>
<div>
Adresse : {{user.address}}
</div>
<div>
Pays : {{user.country}}
</div>
<div>
Date de naissance : {{user.birthDate}}
</div>
</div>
</div>
<div class="moreInfos">
<div class = "oldcursus">
<div class="listTitle">
Anciens Cursus
</div>
<div class="listElement">
<div class=" containerElement" v-for="item in UserCurriculum.curriculumList">
<div class="year" v-if="parseInt(item.dateyear) !== getYear()">Bac {{item.year}}</div>
<div class="option" v-if="parseInt(item.dateyear) !== getYear()">{{item.option}}</div>
<div class="dateyear" v-if="parseInt(item.dateyear) !== getYear()">Année {{item.dateyear}}-{{item.dateyear+1}}</div>
</div>
</div>
</div>
<div class="newcursus" >
<div class="listTitle">
Cursus Actuel
</div>
<div class="listElement">
<div class=" containerElement" v-for="item in UserCurriculum.curriculumList" >
<div class="year" v-if="parseInt(item.dateyear) === getYear()">Bac {{item.year}}</div>
<div class="option" v-if="parseInt(item.dateyear) === getYear()">{{item.option}}</div>
<div class="dateyear" v-if="parseInt(item.dateyear) === getYear()">Année {{item.dateyear}}-{{item.dateyear+1}}</div>
</div>
</div>
2024-03-23 18:04:36 +01:00
</div>
</div>
</div>
</div>
2024-03-23 18:04:36 +01:00
</template>
2024-03-23 18:04:36 +01:00
<style scoped>
2024-03-23 18:04:36 +01:00
.container{
2024-04-01 11:43:42 +02:00
min-width:675px;
2024-03-23 18:04:36 +01:00
display:grid;
2024-04-01 11:43:42 +02:00
grid-template-columns:10vw 50vw;
2024-03-23 18:04:36 +01:00
grid-template-rows:200px auto;
2024-04-01 11:43:42 +02:00
column-gap:2.7%;
2024-03-23 18:04:36 +01:00
row-gap:45px;
grid-template-areas:
"profilPic globalInfos"
"minfos minfos";
}
.profilPic{
grid-area:profilPic;
}
.globalInfos {
grid-area:globalInfos;
align-self :center;
}
.body {
2024-04-01 11:43:42 +02:00
min-width:960px;
2024-03-23 18:04:36 +01:00
width:100%;
2024-04-01 11:43:42 +02:00
display:flex;
align-items:center;
justify-content:center;
margin-top:5%;
2024-03-23 18:04:36 +01:00
}
.subContainter{
width:100%;
background-color:rgb(50,50,50);
border-radius:20px;
border:4px solid black;
}
2024-03-23 18:04:36 +01:00
.infosContainer {
padding-bottom:50px;
border:2px solid black;
font-size:25px;
color:white;
padding:20px;
background-color:rgb(50,50,50);
border-radius:20px;
}
.moreInfos {
display:grid;
grid-template-rows:200px auto;
column-gap:50px;
row-gap:45px;
grid-template-areas:
"minfos minfos";
grid-template-columns:600px 600px;
2024-04-01 11:43:42 +02:00
align-items:center;
justify-content:center;
margin-left: 320%;
}
.listTitle{
display: flex;
justify-content: center;
align-items: center;
width:250px;
margin-left:auto;
margin-right:auto;
border:2px solid black;
font-size:25px;
color:white;
padding:20px;
background-color:rgb(50,50,50);
border-radius:20px;margin-bottom:10px;
}
.listElement{
border:2px solid black;
font-size:25px;
color:white;
padding:20px;
background-color:rgb(50,50,50);
border-radius:20px;
margin-bottom:10px;
}
.containerElement{
justify-content:center;
display:grid;
grid-template-columns:100px 100px 300px;
grid-template-areas:
"year option dateyear";
column-gap:40px;
padding-left: 25px;
}
</style>