Skip to content

Commit 18a12d0

Browse files
committed
feat: add status in form and exercise details
1 parent 7afb5bb commit 18a12d0

File tree

3 files changed

+69
-1
lines changed

3 files changed

+69
-1
lines changed

assets/css/_exercise-gestion.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ h1 {
1919
}
2020
}
2121

22+
.status {
23+
line-height: 25px;
24+
svg {
25+
vertical-align: middle;
26+
width: 25px;
27+
margin-left: 5px;
28+
}
29+
30+
margin-bottom: 30px;
31+
}
32+
2233
.content {
2334
background-color: white;
2435
border-radius: 4px;

components/Gestion/ExerciseForm.vue

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,30 @@
33

44
<h1>{{title}}</h1>
55

6+
<h2 v-if="exercise" class="title--primary-color__light">Status actuel de la ressource</h2>
7+
8+
<div v-if="exercise" class="status">
9+
<template v-if="exercise.state === 'VALIDATED'">
10+
Valide <Icon type="check" theme="theme--green"/>
11+
</template>
12+
13+
<template v-else-if="exercise.state === 'NOT_VALIDATED'">
14+
Non valide <Icon type="close" theme="theme--red-light"/>
15+
</template>
16+
17+
<template v-else-if="exercise.state === 'PENDING'">
18+
En attente <Icon type="send" theme="theme--yellow"/>
19+
</template>
20+
21+
<template v-else-if="exercise.state === 'DRAFT'">
22+
Brouillon <Icon title="Créé" type="paper" theme="theme--primary-color-light"/>
23+
</template>
24+
25+
<template v-else-if="exercise.state === 'ARCHIVED'">
26+
Archivé <Icon type="archive" theme="theme--red-light"/>
27+
</template>
28+
</div>
29+
630
<ValidationObserver ref="observer1" tag="form" @submit.prevent="validateBeforeSubmit()">
731
<ValidationProvider tag="label"
832
name="titre"

pages/exercices/_id.vue

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,28 @@
2424
<section class="exercise">
2525
<h1>{{exercise.title}}</h1>
2626
<span>Créé le {{$moment(exercise.createdAt).format("DD/MM/YY à H:mm")}}</span> | <span>Mis à jour le {{$moment(exercise.updatedAt).format("DD/MM/YY à H:mm")}}</span>
27-
27+
<div class="status">
28+
<b>status</b> -
29+
<template v-if="exercise.state === 'VALIDATED'">
30+
Valide <Icon type="check" theme="theme--green"/>
31+
</template>
32+
33+
<template v-else-if="exercise.state === 'NOT_VALIDATED'">
34+
Non valide <Icon type="close" theme="theme--red-light"/>
35+
</template>
36+
37+
<template v-else-if="exercise.state === 'PENDING'">
38+
En attente <Icon type="send" theme="theme--yellow"/>
39+
</template>
40+
41+
<template v-else-if="exercise.state === 'DRAFT'">
42+
Brouillon <Icon title="Créé" type="paper" theme="theme--primary-color-light"/>
43+
</template>
44+
45+
<template v-else-if="exercise.state === 'ARCHIVED'">
46+
Archivé <Icon type="archive" theme="theme--red-light"/>
47+
</template>
48+
</div>
2849
<div class="score__info">
2950
<div v-if="$auth.loggedIn">
3051
<h4 class="title--primary-color__light">Votre note</h4>
@@ -221,6 +242,18 @@
221242
222243
#Exercise {
223244
245+
.status {
246+
font-weight: 300;
247+
line-height: 25px;
248+
margin-top: 5px;
249+
svg {
250+
vertical-align: middle;
251+
width: 25px;
252+
margin-left: 5px;
253+
}
254+
255+
}
256+
224257
.exercise {
225258
position: relative;
226259

0 commit comments

Comments
 (0)