|
|
|
@ -3,10 +3,14 @@
|
|
|
|
|
import {ref} from 'vue'
|
|
|
|
|
import {validateRegister, getAllRegisters } from '@/rest/ServiceInscription.js'
|
|
|
|
|
import AboutRequest from "@/Apps/AboutRequest.vue";
|
|
|
|
|
import {getAllExemptionsRequest, getAllScholarShipsRequest} from "@/rest/requests.js";
|
|
|
|
|
|
|
|
|
|
const requests = ref(await getAllRegisters());
|
|
|
|
|
let targetId = "";
|
|
|
|
|
|
|
|
|
|
const requestType = ref("inscription");
|
|
|
|
|
const filterType = ref("None");
|
|
|
|
|
|
|
|
|
|
//0 = liste, 1 = détails, 2 = sure?
|
|
|
|
|
let windowsState = ref(0);
|
|
|
|
|
|
|
|
|
@ -17,6 +21,18 @@
|
|
|
|
|
}
|
|
|
|
|
requests.value = await getAllRegisters();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function loadRequests(){
|
|
|
|
|
if (requestType.value === "inscription"){
|
|
|
|
|
requests.value = await getAllRegisters();
|
|
|
|
|
}
|
|
|
|
|
if (requestType.value === "scholarship"){
|
|
|
|
|
requests.value = await getAllScholarShipsRequest();
|
|
|
|
|
}
|
|
|
|
|
if(requestType.value === "exemption"){
|
|
|
|
|
requests.value = await getAllExemptionsRequest();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -27,18 +43,55 @@
|
|
|
|
|
<button style="background-color:rgb(105,05,105);margin-left: 30%" @click="windowsState=0;">Retour</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="windowsState === 0">
|
|
|
|
|
<div style="margin-top: 2%;margin-left: 2%">
|
|
|
|
|
<span>Request type : </span>
|
|
|
|
|
<select v-model="requestType" @change="loadRequests()">
|
|
|
|
|
<option>inscription</option>
|
|
|
|
|
<option>scholarship</option>
|
|
|
|
|
<option>exemption</option>
|
|
|
|
|
</select>
|
|
|
|
|
<span style="margin-left: 5%">
|
|
|
|
|
Filter :
|
|
|
|
|
<select v-model="filterType">
|
|
|
|
|
<option>None</option>
|
|
|
|
|
<option>Pending</option>
|
|
|
|
|
<option>Accepted</option>
|
|
|
|
|
<option>Refused</option>
|
|
|
|
|
</select>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div style='display:flex; justify-content:center; min-width:1140px;' v-for="item of requests">
|
|
|
|
|
<div class="bodu">
|
|
|
|
|
<div class="container">
|
|
|
|
|
<div class="date">{{item.submissionDate.slice(0, 10)}}</div>
|
|
|
|
|
<div class="state">{{item.state}}</div>
|
|
|
|
|
<div class="surname">{{item.lastName}}</div>
|
|
|
|
|
<div class="firstname">{{item.firstName}}</div>
|
|
|
|
|
<div class="accept" v-if="item.state === 'Pending'"><button @click="windowsState=2;targetId=item.id;" style="background-color:rgb(0,105,50);">{{i18n("request.accept")}}</button></div>
|
|
|
|
|
<div class="refuse" v-if="item.state === 'Pending'"><button @click="upPage(item.id,'Refused')" style="background-color:rgb(105,0,0);">{{i18n("request.refuse")}}</button></div>
|
|
|
|
|
<div class="infos"><button style="background-color:rgb(105,05,105);" @click="targetId=item.id;windowsState=1;">{{i18n("request.moreInfos")}}</button></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="bodu" v-if="filterType == 'None' || filterType == item.state">
|
|
|
|
|
<div class="container" style="grid-template-columns:15% 15% 10% 14.2% 14.2% 14.2% 14.2%;grid-template-areas:'date state surname firstname accept refuse infos';" v-if="requestType === 'inscription'">
|
|
|
|
|
<!--
|
|
|
|
|
The condition below avoids an error occuring because loadRequests() finishes after the vue refresh
|
|
|
|
|
then submissionDate is undefined an it triggers an error in the console despite the fact that it is working
|
|
|
|
|
properly at the end.
|
|
|
|
|
-->
|
|
|
|
|
<div class="date" v-if="item.submissionDate !== undefined">{{item.submissionDate.slice(0, 10)}}</div>
|
|
|
|
|
<div class="state">{{item.state}}</div>
|
|
|
|
|
<div class="surname">{{item.lastName}}</div>
|
|
|
|
|
<div class="firstname">{{item.firstName}}</div>
|
|
|
|
|
<div class="accept" v-if="item.state === 'Pending'"><button @click="windowsState=2;targetId=item.id;" style="background-color:rgb(0,105,50);">{{i18n("request.accept")}}</button></div>
|
|
|
|
|
<div class="refuse" v-if="item.state === 'Pending'"><button @click="upPage(item.id,'Refused')" style="background-color:rgb(105,0,0);">{{i18n("request.refuse")}}</button></div>
|
|
|
|
|
<div class="infos"><button style="background-color:rgb(105,05,105);" @click="targetId=item.id;windowsState=1;">{{i18n("request.moreInfos")}}</button></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="container" style="grid-template-columns:25% 15% 15% 25% 14.2%;grid-template-areas:'date reqState studentfirstname studentlastname infos';" v-if="requestType === 'scholarship'">
|
|
|
|
|
<div class="date" v-if="item.date !== undefined"> {{item.date.slice(0,10)}}</div>
|
|
|
|
|
<div class="studentfirstname">{{item.user.firstName}}</div>
|
|
|
|
|
<div class="studentlastname">{{item.user.lastName}}</div>
|
|
|
|
|
<div class="reqState">{{item.state}}</div>
|
|
|
|
|
<div class="infos"><button>More infos</button></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="container" style="grid-template-columns:17% 15% 12% 15% 25%;grid-template-areas:'date reqState studentfirstname studentlastname course infos';"v-if="requestType === 'exemption'">
|
|
|
|
|
<div class="date" v-if="item.date != undefined">{{item.date.slice(0,10)}}</div>
|
|
|
|
|
<div class="studentfirstname">{{item.user.firstName}}</div>
|
|
|
|
|
<div class="studentlastname">{{item.user.lastName}}</div>
|
|
|
|
|
<div class="course">{{item.course.title}}</div>
|
|
|
|
|
<div class="reqState">{{item.state}}</div>
|
|
|
|
|
<div class="infos"><button>More infos</button></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div style='display:flex; justify-content:center; min-width:1140px;margin-top: 10%' v-if="windowsState === 2">
|
|
|
|
@ -54,12 +107,27 @@
|
|
|
|
|
height:100px;
|
|
|
|
|
font-size:20px;
|
|
|
|
|
display:grid;
|
|
|
|
|
grid-template-columns:15% 15% 10% 14.2% 14.2% 14.2% 14.2%;
|
|
|
|
|
grid-template-areas:
|
|
|
|
|
"date state surname firstname accept refuse infos";
|
|
|
|
|
column-gap:10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.studentfirstname{
|
|
|
|
|
grid-area: studentfirstname;
|
|
|
|
|
align-self: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.studentlastname{
|
|
|
|
|
grid-area: studentlastname;
|
|
|
|
|
align-self: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.course{
|
|
|
|
|
grid-area: course;
|
|
|
|
|
align-self: center;
|
|
|
|
|
}
|
|
|
|
|
.reqState{
|
|
|
|
|
grid-area: reqState;
|
|
|
|
|
align-self: center;
|
|
|
|
|
}
|
|
|
|
|
.infos {
|
|
|
|
|
grid-area:infos;
|
|
|
|
|
align-self:center;
|
|
|
|
|