Skip to content

Commit c3995ba

Browse files
committed
choix de la homepage
1 parent b2666e7 commit c3995ba

File tree

3 files changed

+53
-15
lines changed

3 files changed

+53
-15
lines changed

.env.exemple

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ COLOR_DARK_PAGE='#121212',
88
COLOR_POSITIVE='#21BA45',
99
COLOR_NEGATIVE='#C10015',
1010
COLOR_INFO='#31CCEC',
11-
COLOR_WARNING='#F2C037'
11+
COLOR_WARNING='#F2C037'
12+
ACTION=menu
13+
USER_LABEL=Utilsateur (votre email de l'ecole)

nuxt.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ export default defineNuxtConfig({
2323
https,
2424
},
2525
srcDir: "src",
26+
appConfig: {
27+
action: process.env.ACTION || 'change',
28+
userLabel: process.env.USER_LABEL || 'Utilisateur'
29+
},
2630
proxy: {
2731
https: false,
2832
proxies: {

src/components/LoginMenu.vue

Lines changed: 46 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,47 @@
11
<template>
22

3-
<q-card class="shadow-24 row" style="max-width: 800px;">
3+
<q-card class="shadow-24 row q-py-auto" style="max-width: 800px;">
44
<q-toolbar class="bg-primary text-white">
55
<q-toolbar-title>Gestion de votre accès</q-toolbar-title>
66
</q-toolbar>
77
<q-card-section class="col-lg-4 flex items-center mobile-hide">
88
<q-img src="/img/logo.png" style="max-width: 100%;width:500px;"/>
99
</q-card-section>
10-
<q-card-section class="col-ms-8 column">
11-
<div class="q-pa-md row-md">
10+
<q-card-section class="col-lg-8 column">
11+
<div class="q-pa-md row-md" v-show="action !=='menu' && withMenu ===false">
1212
<q-btn-toggle
1313
v-model="action"
1414
@click="resetData()"
1515
spread
16+
push
17+
glossy
1618
no-caps
1719
rounded
1820
unelevated
1921
toggle-color="primary"
20-
color="white"
22+
color="blue-grey-1"
2123
text-color="primary"
2224
:options="[
2325
{label: 'Changer votre mot de passe', value: 'change'},
2426
{label: 'Reinitialiser votre mot de passe', value: 'reset'}
2527
]"
2628
/>
2729
</div>
30+
<div class="q-pa-md row-md " v-show="action ==='menu'">
31+
32+
<q-btn @click='onmenuChange()' class="q-py-sm fit glossy" color="primary">Changer mon mot de passe</q-btn>
33+
<q-separator class="q-mt-sm q-mb-sm" />
34+
<q-btn @click='onmenuReset()' class="q-py-sm fit glossy" color="primary">J'ai oublié mon mot de passe</q-btn>
35+
</div>
36+
37+
38+
39+
40+
41+
42+
2843
<div v-show="action == 'change'" class="row-md">
29-
<q-input v-model="username" label="Utilisateur" type="text"></q-input>
44+
<q-input v-model="username" :label="userLabel" type="text"></q-input>
3045
<q-input v-model="oldpassword" label="Mot de passe" type="password"></q-input>
3146
<input-new-password v-model="newpassword"
3247
:min="passwordPolicies.len"
@@ -48,6 +63,8 @@
4863
@click="actionResetRenit()"
4964
v-model="actionReset"
5065
spread
66+
push
67+
glossy
5168
no-caps
5269
rounded
5370
unelevated
@@ -57,11 +74,11 @@
5774
:options="optionsReset()"
5875
/>
5976
</div>
60-
<q-input v-model="username" label="Utilisateur" type="text"></q-input>
77+
<q-input v-model="username" :label="userLabel" type="text"></q-input>
6178
</div>
62-
<div v-show="action !== ''" class="row-md" style="margin-top: 30px;">
63-
64-
<q-btn @click="envoi" :loading="loading" color="primary" style="width:100%" :disabled="enableValidation">Validez
79+
<div v-show="action !== '' && action !== 'menu'" class="row-md" style="margin-top: 30px;">
80+
<q-btn v-show="withMenu===true" @click="action='menu'" color="negative" :style="getButtonsWidth()" >Abandonner</q-btn>
81+
<q-btn @click="envoi" :loading="loading" color="primary" :style="getButtonsWidth()" :disabled="enableValidation">Validez
6582
</q-btn>
6683
</div>
6784
</q-card-section>
@@ -109,7 +126,7 @@
109126
</input-new-password>
110127

111128
</q-card-section>
112-
<q-card-actions align="right" class="text-primary">
129+
<q-card-actions align="right" class="text-primary" >
113130
<q-btn @click="doReloadPage" flat label="Abandonner" v-close-popup/>
114131
<q-btn @click="actionSendReset" flat label="Valider" v-close-popup :disabled="enableValidationCode"/>
115132
</q-card-actions>
@@ -120,15 +137,16 @@
120137
<script setup>
121138
import {ref} from 'vue'
122139
import {computed, onMounted} from 'vue';
123-
124-
140+
const config = useAppConfig()
141+
const userLabel=ref(config.userLabel)
125142
const messageType = ref('bg-secondary')
126143
const messageText = ref('')
127144
const messageSms = ref(false)
128145
const messageAction = ref('reloadPage')
129146
const message = ref(false)
130147
const loading = ref(false)
131-
const action = ref('change')
148+
const action = ref(config.action)
149+
const withMenu=ref(false)
132150
const username = ref('')
133151
const oldpassword = ref('')
134152
const newpassword = ref('')
@@ -210,7 +228,21 @@ function resetData() {
210228
newpassword.value = ''
211229
212230
}
213-
231+
function getButtonsWidth(){
232+
if (withMenu.value === true){
233+
return "width: 50%;"
234+
}else{
235+
return "width: 100%;"
236+
}
237+
}
238+
function onmenuChange(){
239+
action.value='change'
240+
withMenu.value=true
241+
}
242+
function onmenuReset(){
243+
action.value='reset'
244+
withMenu.value=true
245+
}
214246
function envoi() {
215247
if (action.value === 'reset') {
216248
if (actionReset.value === 'mail') {

0 commit comments

Comments
 (0)