feat: added form to add project and pending project section for admin, i forgot to push them
This commit is contained in:
102
front/MyINPulse-front/src/components/AddProjectForm.vue
Normal file
102
front/MyINPulse-front/src/components/AddProjectForm.vue
Normal file
@ -0,0 +1,102 @@
|
||||
<template>
|
||||
<form class="add-project-form" @submit.prevent="submitProject">
|
||||
<h2>Ajouter un projet</h2>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="projectName">Nom du projet</label>
|
||||
<input
|
||||
id="projectName"
|
||||
v-model="project.projectName"
|
||||
type="text"
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="creationDate">Date de création</label>
|
||||
<input
|
||||
id="creationDate"
|
||||
v-model="project.creationDate"
|
||||
type="text"
|
||||
placeholder="JJ-MM-AAAA"
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="logo">Logo</label>
|
||||
<input
|
||||
id="logo"
|
||||
v-model="project.logo"
|
||||
type="text"
|
||||
placeholder="(à discuter)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<button type="submit">Ajouter</button>
|
||||
</form>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { postApi } from "@/services/api.ts";
|
||||
|
||||
const project = ref({
|
||||
idProject: 0,
|
||||
projectName: "",
|
||||
creationDate: "",
|
||||
logo: "to be discussed not yet fixed",
|
||||
});
|
||||
|
||||
function submitProject() {
|
||||
postApi("/admin/projects/add", project.value);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.add-project-form {
|
||||
max-width: 500px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
background: #fff;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin-bottom: 20px;
|
||||
font-size: 24px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 15px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
label {
|
||||
font-weight: bold;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
input {
|
||||
padding: 8px;
|
||||
border-radius: 5px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
button {
|
||||
background-color: #4caf50;
|
||||
color: white;
|
||||
padding: 10px 15px;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background-color: #45a049;
|
||||
}
|
||||
</style>
|
||||
|
Reference in New Issue
Block a user