1
0
forked from PGL/Clyde

Final commit of the extension

This commit is contained in:
2024-04-21 18:24:58 +02:00
parent 43f3d66eb9
commit 9a5115f7fe
21 changed files with 162 additions and 183 deletions

View File

@ -2,7 +2,7 @@
import {reactive, ref } from 'vue'
import i18n from '@/i18n.js'
import {login, register, disconnect, isLogged} from '@/rest/Users.js'
import {getAllCurriculums, getcurriculum} from '@/rest/curriculum.js'
import {getAllCurriculums} from '@/rest/curriculum.js'
import {uploadFile, uploadProfilePicture} from '@/rest/uploads.js'
import {toast} from 'vue3-toastify'
import 'vue3-toastify/dist/index.css';
@ -31,8 +31,9 @@
const passwordConfirm=ref("")
const imageSaved = ref(false)
let ppData = ""
const ppData = ref({})
const idcardfile = ref({})
const justifcardfile = ref({})
@ -58,11 +59,6 @@
disconnect();
window.location.reload();}
async function uploadPP(arg){
const data = await uploadProfilePicture(arg);
ppData = data.url;
}
//This functions makes the distinction between a master cursus (year 4 or more) and a bachelor cursus (year 3 or less)
function getCursusDisplay(cursus){
if (cursus.year <= 3){
@ -77,6 +73,7 @@
//We upload the two files and we get their paths on the server
const identityCardFile = await uploadFile(idcardfile.value, "IdentityCard")
const justifFile = ref(null)
const profilepic = await uploadProfilePicture(ppData.value)
if (curricula[outputs.curriculum-1].requireCertificate){
justifFile.value = await uploadFile(justifcardfile.value, "JustificationDocument")
@ -89,7 +86,7 @@
justif = null
}
const val = await register(outputs.firstname, outputs.surname, outputs.birthday, outputs.password, outputs.email, outputs.address, outputs.country, outputs.curriculum, ppData, identityCardFile.url, new Date(), outputs.equivalenceState, justif);
const val = await register(outputs.firstname, outputs.surname, outputs.birthday, outputs.password, outputs.email, outputs.address, outputs.country, outputs.curriculum, profilepic.url, identityCardFile.url, new Date(), outputs.equivalenceState, justif);
for (let item in externalCurrTab.value){
const temp = await uploadFile(externalCurrTab.value[item].justifdocUrl, "JustificationDocument")
@ -178,10 +175,10 @@
</form>
<label class="browser">
{{i18n("login.guest.browse")}}
<input type="file" :disabled="imageSaved" @change="ppData = uploadProfilePicture($event.target.files); imageSaved = true;" accept="image/*">
<input type="file" :disabled="imageSaved" @change="ppData = $event.target.files; imageSaved = true;" accept="image/*">
</label>
<form novalidate enctype="multipart/form-data" class="inputBox">
<input type="file" @change="uploadPP($event.target.files); imageSaved = true;" accept="image/*">
<input type="file" @change="imageSaved = true;" accept="image/*">
</form>
<div class="inputBox">
<p>{{i18n("Curriculum").toUpperCase()}}</p>
@ -221,15 +218,17 @@
</div>
</div>
<button @click="page++;" style="margin-top: 10%">{{i18n("login.guest.nextpage")}}</button>
</div>
<div v-if="page === 3">
<p style="color:rgb(239,60,168);margin-bottom: 5%">
{{i18n("login.guest.formationdisclaimer")}}
</p>
<button @click="page++">{{i18n("login.guest.managecareer")}}</button>
<button @click="postRegisterReq();">{{ i18n("login.guest.sendRegReq") }}</button>
<button @click="postRegisterReq();page+=2">{{ i18n("login.guest.sendRegReq") }}</button>
</div>
<div v-if="page===5" style="margin-left: 7%">
<p style="color: rgb(239,60,168);">{{i18n("reqsent")}}</p>
</div>
</form>
</div>
</div>
@ -297,13 +296,7 @@
cursor: pointer;
}
.bodu {
margin-top:2%;
width:50%;
border:2px solid black;
border-radius:9px;
background-color:rgb(50,50,50);
}
.switchpage{
width:100px;
@ -342,22 +335,8 @@ input[type=file]{
background:#FFFFFF;
}
.container{
margin-top: 2%;
color:white;
height:60px;
font-size:30px;
display:grid;
grid-template-columns:30% 30% 20% 20%;
grid-template-areas:
"school formation completion edit remove";
column-gap:10px;
}
button:active ,.switchpage:active{
opacity:0.8;
}
</style>