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

128 lines
3.2 KiB
Vue
Raw Normal View History

2024-03-08 11:54:10 +01:00
<script setup>
2024-03-17 23:19:36 +01:00
import i18n from "@/i18n.js"
2024-03-18 17:28:14 +01:00
import {ref} from 'vue'
2024-03-17 23:19:36 +01:00
import {validateRegister, getAllRegisters } from '@/rest/ServiceInscription.js'
import AboutRequest from "@/Apps/AboutRequest.vue";
2024-03-18 17:28:14 +01:00
const requests = ref(await getAllRegisters());
let targetId = "";
//0 = liste, 1 = détails, 2 = sure?
let windowsState = ref(0);
2024-03-18 17:28:14 +01:00
async function upPage(id,review){
await validateRegister(id,review);
requests.value = await getAllRegisters();
}
2024-03-08 11:54:10 +01:00
</script>
2024-03-17 23:19:36 +01:00
<template>
<div v-if="windowsState === 1">
<AboutRequest :target="targetId"></AboutRequest>
<button style="background-color:rgb(105,05,105);" @click="windowsState=0;">Retour</button>
2024-03-17 23:19:36 +01:00
</div>
<div v-if="windowsState === 0">
<div v-for="item of requests">
<div class="bodu" v-if="item.state === 'Pending'">
<div class="container">
<div class="id"><a>{{item.id}}</a></div>
<div class="surname"><a>{{item.lastName}}</a></div>
<div class="firstname"><a>{{item.firstName}}</a></div>
<div class="infos"><button style="background-color:rgb(105,05,105);" @click="targetId=item.id;windowsState=1;">{{i18n("request.moreInfos")}}</button></div>
<div class="accept"><button @click="windowsState=2;targetId=item.id;" style="background-color:rgb(0,105,50);">{{i18n("request.accept")}}</button></div>
<div class="refuse"><button @click="upPage(item.id,'Refused')" style="background-color:rgb(105,0,0);">{{i18n("request.refuse")}}</button></div>
</div>
</div>
</div>
2024-03-17 23:19:36 +01:00
</div>
<div v-if="windowsState === 2">
<p>Etes vous sur de vouloir accepter cette demande ?</p>
<button style="background-color:rgb(105,05,105);" @click="upPage(targetId,'Accepted');windowsState=0;">Valider</button>
<button style="background-color:rgb(105,05,105);" @click="windowsState=0;">Retour</button>
2024-03-17 23:19:36 +01:00
</div>
</template>
2024-03-17 23:19:36 +01:00
<style scoped>
.container{
color:white;
height:100px;
font-size:20px;
display:grid;
grid-template-columns:[firstCol-start]100px[firstCol-end secondCol-start]150px[secondCol-end thirdCol-start]200px[thirdCol-end fourthCol-start]150px[fourthCol-end]150px[fifthCol-end]150px[sixthCol-end]150px[endCol];
grid-template-areas:
"id type surname firstname infos accept refuse";
column-gap:10px;
}
.infos {
grid-area:infos;
align-self:center;
}
.accept{
grid-area:accept;
align-self:center;
}
.refuse{
grid-area:refuse;
align-self:center;
}
.titles {
grid-area:titles;
background-color:rgb(215,215,215);
}
.id{
grid-area:id;
margin-left:40px;
align-self:center;
}
.type{
grid-area:type;
align-self:center;
}
.surname{
grid-area:surname;
align-self:center;
white-space: nowrap;
overflow: hidden;
text-overflow:ellipsis;
}
.firstname{
grid-area:firstname;
align-self:center;
white-space: nowrap;
overflow: hidden;
text-overflow:ellipsis;
}
button{
font-size:15px;
height:50px;
width:100px;
border:none;
border-radius:20px;
}
.bodu {
width:100%;
margin-bottom:10px;
border:2px solid black;
border-radius:9px;
background-color:rgb(50,50,50);
}
</style>