feat: added form to add project and pending project section for admin, i forgot to push them
Some checks failed
Format / formatting (push) Successful in 5s
Build / build (push) Successful in 38s
CI / build (push) Failing after 8s
Format / formatting (pull_request) Successful in 5s

This commit is contained in:
Mohamed Maoulainine Maoulainine
2025-04-09 00:46:44 +02:00
parent b9647ce36e
commit 60290956ec
3 changed files with 282 additions and 10 deletions

View 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>