|
1 | 1 | <template> |
2 | 2 |
|
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;"> |
4 | 4 | <q-toolbar class="bg-primary text-white"> |
5 | 5 | <q-toolbar-title>Gestion de votre accès</q-toolbar-title> |
6 | 6 | </q-toolbar> |
7 | 7 | <q-card-section class="col-lg-4 flex items-center mobile-hide"> |
8 | 8 | <q-img src="/img/logo.png" style="max-width: 100%;width:500px;"/> |
9 | 9 | </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"> |
12 | 12 | <q-btn-toggle |
13 | 13 | v-model="action" |
14 | 14 | @click="resetData()" |
15 | 15 | spread |
| 16 | + push |
| 17 | + glossy |
16 | 18 | no-caps |
17 | 19 | rounded |
18 | 20 | unelevated |
19 | 21 | toggle-color="primary" |
20 | | - color="white" |
| 22 | + color="blue-grey-1" |
21 | 23 | text-color="primary" |
22 | 24 | :options="[ |
23 | 25 | {label: 'Changer votre mot de passe', value: 'change'}, |
24 | 26 | {label: 'Reinitialiser votre mot de passe', value: 'reset'} |
25 | 27 | ]" |
26 | 28 | /> |
27 | 29 | </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 | + |
28 | 43 | <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> |
30 | 45 | <q-input v-model="oldpassword" label="Mot de passe" type="password"></q-input> |
31 | 46 | <input-new-password v-model="newpassword" |
32 | 47 | :min="passwordPolicies.len" |
|
48 | 63 | @click="actionResetRenit()" |
49 | 64 | v-model="actionReset" |
50 | 65 | spread |
| 66 | + push |
| 67 | + glossy |
51 | 68 | no-caps |
52 | 69 | rounded |
53 | 70 | unelevated |
|
57 | 74 | :options="optionsReset()" |
58 | 75 | /> |
59 | 76 | </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> |
61 | 78 | </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 |
65 | 82 | </q-btn> |
66 | 83 | </div> |
67 | 84 | </q-card-section> |
|
109 | 126 | </input-new-password> |
110 | 127 |
|
111 | 128 | </q-card-section> |
112 | | - <q-card-actions align="right" class="text-primary"> |
| 129 | + <q-card-actions align="right" class="text-primary" > |
113 | 130 | <q-btn @click="doReloadPage" flat label="Abandonner" v-close-popup/> |
114 | 131 | <q-btn @click="actionSendReset" flat label="Valider" v-close-popup :disabled="enableValidationCode"/> |
115 | 132 | </q-card-actions> |
|
120 | 137 | <script setup> |
121 | 138 | import {ref} from 'vue' |
122 | 139 | import {computed, onMounted} from 'vue'; |
123 | | -
|
124 | | -
|
| 140 | +const config = useAppConfig() |
| 141 | +const userLabel=ref(config.userLabel) |
125 | 142 | const messageType = ref('bg-secondary') |
126 | 143 | const messageText = ref('') |
127 | 144 | const messageSms = ref(false) |
128 | 145 | const messageAction = ref('reloadPage') |
129 | 146 | const message = ref(false) |
130 | 147 | const loading = ref(false) |
131 | | -const action = ref('change') |
| 148 | +const action = ref(config.action) |
| 149 | +const withMenu=ref(false) |
132 | 150 | const username = ref('') |
133 | 151 | const oldpassword = ref('') |
134 | 152 | const newpassword = ref('') |
@@ -210,7 +228,21 @@ function resetData() { |
210 | 228 | newpassword.value = '' |
211 | 229 |
|
212 | 230 | } |
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 | +} |
214 | 246 | function envoi() { |
215 | 247 | if (action.value === 'reset') { |
216 | 248 | if (actionReset.value === 'mail') { |
|
0 commit comments