feat: added form to add project and pending project section for admin, i forgot to push them
This commit is contained in:
149
front/MyINPulse-front/src/components/PendingProjectComponent.vue
Normal file
149
front/MyINPulse-front/src/components/PendingProjectComponent.vue
Normal file
@ -0,0 +1,149 @@
|
||||
<template>
|
||||
<div class="project">
|
||||
<div class="project-header">
|
||||
<div class="project-title">
|
||||
<h2>{{ projectName }}</h2>
|
||||
<p>projet mis le: {{ creationDate }}</p>
|
||||
</div>
|
||||
<div class="project-button">
|
||||
<button id="accept" @click="acceptProject">Accepter</button>
|
||||
<button id="refus" @click="refuseProject">Refuser</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
<script setup lang="ts">
|
||||
import { defineProps } from "vue";
|
||||
import { postApi } from "@/services/api";
|
||||
import { addNewMessage, color } from "@/services/popupDisplayer";
|
||||
|
||||
const props = defineProps<{
|
||||
projectName: string;
|
||||
creationDate: string;
|
||||
}>();
|
||||
|
||||
const URI = "/admin/projects/pending/decision";
|
||||
|
||||
const sendDecision = (decision: "true" | "false") => {
|
||||
postApi(
|
||||
URI,
|
||||
{
|
||||
projectName: props.projectName,
|
||||
decision,
|
||||
},
|
||||
() => {
|
||||
addNewMessage(
|
||||
`Projet ${props.projectName} ${decision === "true" ? "accepté" : "refusé"}`,
|
||||
color.Green
|
||||
);
|
||||
},
|
||||
(err) => {
|
||||
addNewMessage(`Erreur lors de la décision`, color.Red);
|
||||
console.error(err);
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
const acceptProject = () => sendDecision("true");
|
||||
const refuseProject = () => sendDecision("false");
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<style scoped>
|
||||
.project {
|
||||
background: linear-gradient(to right, #f4f4f4, #ffffff);
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 10px;
|
||||
padding: 20px;
|
||||
margin: 20px 0;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
|
||||
/* Header Styling */
|
||||
.project-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.project-title {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.project-title h2 {
|
||||
font-size: 20px;
|
||||
color: #333;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.project-title p {
|
||||
font-size: 14px;
|
||||
color: #777;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
/* Button Container */
|
||||
.project-buttons {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
#accept {
|
||||
background-color: #45a049;
|
||||
}
|
||||
|
||||
#refus {
|
||||
background-color: red;
|
||||
}
|
||||
|
||||
button {
|
||||
padding: 10px 15px;
|
||||
color: white;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
#accept:hover {
|
||||
background-color: #3e8e41;
|
||||
}
|
||||
|
||||
#refus:hover {
|
||||
background-color: darkred;
|
||||
}
|
||||
|
||||
/* Project Body (unchanged) */
|
||||
.project-body {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.project-body p {
|
||||
font-size: 16px;
|
||||
color: #555;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.project-body ul {
|
||||
list-style-type: disc;
|
||||
margin: 0;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
.project-body ul li {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
</style>
|
Reference in New Issue
Block a user