Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 | <template> <div class="edit-user-container specific-breakpoint my-lg-0 me-lg-0 ms-lg-5 mb-4 d-flex flex-column align-items-end"> <p class="subtitle specific-breakpoint text-lg-end mb-5 mb-lg-2">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut, consectetur adipiscing elit</p> <form @submit.prevent="send" class="mt-2 w-100 d-flex flex-column"> <div class="row gx-3 specific-breakpoint field-container mb-lg-3"> <div class="col-lg-4 field specific-breakpoint mb-4 mb-lg-0"> <input type="text" class="p-2" name="Nume" v-model="userInfo['name']" placeholder="Nume"/> </div> <div class="col-lg-4 field specific-breakpoint mb-4 mb-lg-0"> <input type="text" class="p-2" name="Telefon contact 1" v-model="userInfo['phone']" placeholder="Telefon contact"/> </div> <div class="col-lg-4 field specific-breakpoint mb-4 mb-lg-0"> <input type="text" class="p-2" name="Adresa email" v-model="userInfo['email']" placeholder="Adresa email"/> </div> <!-- <div class="col-lg-4 field specific-breakpoint mb-4 mb-lg-0">--> <!-- <input type="text" class="p-2" name="Prenume" v-model="userInfo['prenume']" placeholder="Prenume"/>--> <!-- </div>--> <!-- <div class="col-lg-4 field specific-breakpoint mb-4 mb-lg-0">--> <!-- <input type="text" class="p-2" name="Adresa" v-model="userInfo['adresa']" placeholder="Adresa"/>--> <!-- </div>--> </div> <!-- <div class="row gx-3 field-container specific-breakpoint mb-lg-3">--> <!-- <div class="col-lg-4 field specific-breakpoint mb-4 mb-lg-0">--> <!-- <input type="text" class="p-2" name="Telefon contact 1" v-model="userInfo['telefon']" placeholder="Telefon contact"/>--> <!-- </div>--> <!-- <div class="col-lg-4 field specific-breakpoint mb-4 mb-lg-0">--> <!-- <input type="text" class="p-2" name="Telefon contact 2" v-model="userInfo['telefon2']" placeholder="Telefon contact 2"/>--> <!-- </div>--> <!-- <div class="col-lg-4 field specific-breakpoint mb-4 mb-lg-0">--> <!-- <input type="text" class="p-2" name="Adresa email" v-model="userInfo['email']" placeholder="Adresa email"/>--> <!-- </div>--> <!-- </div>--> <!-- <div class="row">--> <!-- <div class="col-lg-4 field specific-breakpoint mb-4 mb-lg-0">--> <!-- <custom-form-select--> <!-- @selected="(e) => userInfo['oras'] = e"--> <!-- :value="userInfo['oras'] /* current value */"--> <!-- :options="cities /* options array */"--> <!-- :default="'Alege Orasul' /* default option */"--> <!-- ></custom-form-select>--> <!-- </div>--> <!-- <div class="col-lg-4 field specific-breakpoint mb-4 mb-lg-0">--> <!-- <custom-form-select--> <!-- @selected="(e) => userInfo['judet'] = e"--> <!-- :value="userInfo['judet'] /* current value */"--> <!-- :options="judete /* options array */"--> <!-- :default="'Alege Judetul' /* default option */"--> <!-- ></custom-form-select>--> <!-- </div>--> <!-- <div class="col-lg-4 field specific-breakpoint">--> <!-- <custom-form-select--> <!-- @selected="(e) => userInfo['doze'] = e"--> <!-- :value="userInfo['doze'] /* current value */"--> <!-- :options="doze /* options array */"--> <!-- :default="'Cate doze ai facut?' /* default option */"--> <!-- ></custom-form-select>--> <!-- </div>--> <!-- </div>--> <p id="error" class="mt-2 align-self-end" v-if="getError">{{ getError }}</p> <input type="submit" :class="{'disabled': isDisabled}" class="submit-button specific-breakpoint my-5 p-1 p-sm-2 p-md-3 p-lg-2 align-self-end" value="Salveaza"> </form> </div> </template> <script> import customFormSelect from '../../../../components/utilities/form-utils/custom-form-select.vue'; import {mapActions, mapGetters, mapMutations} from "vuex"; export default { components: {customFormSelect}, data() { return { cities: [ 'Bucuresti', 'Pitesti', 'Curtea de Arges', 'Ouagadougou', 'Mbabane' ], judete: [ 'Arges', 'Ilfov', 'Valcea' ], doze: ['Toate', 0, 1, 2, 3, 15, 32, 321], userInfo: { 'name': this.$auth.user ? this.$auth.user.data.name : '', // 'prenume': '', // 'adresa': '', // 'telefon1': '', 'phone': this.$auth.user ? this.$auth.user.data.phone : '', 'email': this.$auth.user ? this.$auth.user.data.email : '', // 'oras': '', // 'judet': '', // 'doze': '' }, defaultValues: {} } }, computed: { ...mapGetters({getError: 'error', isEdited: 'isEdited'}), /** * Enables submit button only when all fields are filled in * @see isDisabled * @returns boolean */ isDisabled() { return JSON.stringify({...this.userInfo}) === JSON.stringify(this.defaultValues) || !Object.keys(this.defaultValues).length; } }, watch: { isEdited(val) { if (val) { this.defaultValues = {...this.userInfo}; } } }, methods: { ...mapActions(['sendEditAccount']), ...mapMutations(['changeError']), /** * Sends the request with the user info * @see send * @returns void */ async send() { this.changeError(''); await this.sendEditAccount({user: this.userInfo}); } }, /** * Sets the default user values * @see mounted * @returns void */ mounted() { this.defaultValues = {...this.userInfo} }, /** * Resets the error when the page is destroyed * @see destroyed * @return void */ destroyed() { this.changeError(''); } } </script> <style lang="scss" scoped> #error { color: red; font-size: 1rem; } .disabled { opacity: 0.5; pointer-events: none; } .subtitle { font-size: 0.9rem; color: rgb(0, 21, 44); width: 50%; } input { width: 100%; border: 0; outline: none; border-bottom: 1px solid rgba(154, 117, 63); font-size: 1rem; } input::placeholder { color: #a9a9a9; } input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, input:-webkit-autofill:active { -webkit-box-shadow: 0 0 0 30px white inset !important; } form { width: 100%; } .submit-button { margin-top: 2rem; font-size: 1rem; background-color: white; font-family: SoleilBold; border: 1px solid rgb(154, 117, 63); color: rgb(154, 117, 63); width: 40%; } @include media-breakpoint-up(lg) { .submit-button:hover { background-color: rgb(154, 117, 63); color: white; } } @media screen and #{$ipad-pro-landscape-breakpoint}, screen and #{$ipad-pro-portrait-breakpoint}, screen and #{$ipad-landscape-breakpoint} { #error { font-size: 1.5rem; } .specific-breakpoint.field { flex: 0 0 auto; width: 100%; margin-bottom: $spacer * 3 !important; } .specific-breakpoint.field-container { margin-bottom: 0 !important; } .specific-breakpoint.subtitle { font-size: 1.1rem; text-align: justify; width: 100%; margin-bottom: $spacer * 3 !important; } .edit-user-container.specific-breakpoint { margin-bottom: $spacer * 1.5 !important; margin-left: 0 !important; margin-right: 0 !important; } input { font-size: 1.1rem; } .submit-button { font-size: 1.5rem; width: 100%; } } @include media-breakpoint-down(lg) { #error { font-size: 1.4rem; } .subtitle { font-size: 1rem; text-align: justify; width: 100%; } input { font-size: 1rem; } .submit-button { font-size: 1.4rem; width: 100%; } } </style> |