fix: with prettier
This commit is contained in:
@ -5,129 +5,125 @@
|
||||
<h2>{{ projectName }}</h2>
|
||||
<p>Projet mis le: {{ creationDate }}</p>
|
||||
</div>
|
||||
<div class="project-buttons">
|
||||
<button id="accept" @click="acceptProject">Accepter</button>
|
||||
<button id="refus" @click="refuseProject">Refuser</button>
|
||||
<div class="project-buttons">
|
||||
<button id="accept" @click="acceptProject">Accepter</button>
|
||||
<button id="refus" @click="refuseProject">Refuser</button>
|
||||
</div>
|
||||
</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;
|
||||
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);
|
||||
}
|
||||
);
|
||||
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, #f8f9fb, #ffffff);
|
||||
border: 1px solid #e0e0e0;
|
||||
border-radius: 16px;
|
||||
padding: 1.5rem;
|
||||
margin: 1.5rem 0;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
|
||||
font-family: Arial, sans-serif;
|
||||
transition: box-shadow 0.3s ease;
|
||||
background: linear-gradient(to right, #f8f9fb, #ffffff);
|
||||
border: 1px solid #e0e0e0;
|
||||
border-radius: 16px;
|
||||
padding: 1.5rem;
|
||||
margin: 1.5rem 0;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
|
||||
font-family: Arial, sans-serif;
|
||||
transition: box-shadow 0.3s ease;
|
||||
}
|
||||
|
||||
.project:hover {
|
||||
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
|
||||
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
.project-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 1rem;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.project-title {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.project-title h2 {
|
||||
font-size: 1.25rem;
|
||||
color: #222;
|
||||
margin: 0;
|
||||
font-weight: 600;
|
||||
font-size: 1.25rem;
|
||||
color: #222;
|
||||
margin: 0;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.project-title p {
|
||||
font-size: 0.9rem;
|
||||
color: #666;
|
||||
margin-top: 0.25rem;
|
||||
font-size: 0.9rem;
|
||||
color: #666;
|
||||
margin-top: 0.25rem;
|
||||
}
|
||||
|
||||
.project-buttons {
|
||||
display: flex;
|
||||
gap: 0.75rem;
|
||||
display: flex;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
button {
|
||||
padding: 0.5rem 1.1rem;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.2s ease, transform 0.2s ease;
|
||||
padding: 0.5rem 1.1rem;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition:
|
||||
background-color 0.2s ease,
|
||||
transform 0.2s ease;
|
||||
}
|
||||
|
||||
#accept {
|
||||
background-color: #4CAF50;
|
||||
background-color: #4caf50;
|
||||
}
|
||||
|
||||
#accept:hover {
|
||||
background-color: #3e8e41;
|
||||
transform: translateY(-2px);
|
||||
background-color: #3e8e41;
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
#refus {
|
||||
background-color: #e74c3c;
|
||||
background-color: #e74c3c;
|
||||
}
|
||||
|
||||
#refus:hover {
|
||||
background-color: #c0392b;
|
||||
transform: translateY(-2px);
|
||||
background-color: #c0392b;
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
</style>
|
||||
</style>
|
||||
|
Reference in New Issue
Block a user