Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/User/Profile.vue
<template> | <template> | ||||
<div class="container"> | <div class="container"> | ||||
<div class="card" id="user-profile"> | <div class="card" id="user-profile"> | ||||
<div class="card-body"> | <div class="card-body"> | ||||
<div class="card-title"> | <div class="card-title"> | ||||
{{ $t('user.profile-title') }} | {{ $t('user.profile-title') }} | ||||
<router-link | <router-link | ||||
v-if="$root.isController(wallet_id)" | v-if="$root.isController(wallet.id)" | ||||
class="btn btn-outline-danger button-delete float-end" | class="btn btn-outline-danger button-delete float-end" | ||||
to="/profile/delete" tag="button" | to="/profile/delete" tag="button" | ||||
> | > | ||||
<svg-icon icon="trash-alt"></svg-icon> {{ $t('user.profile-delete') }} | <svg-icon icon="trash-alt"></svg-icon> {{ $t('user.profile-delete') }} | ||||
</router-link> | </router-link> | ||||
</div> | </div> | ||||
<div class="card-text"> | <div class="card-text"> | ||||
<form @submit.prevent="submit"> | <form @submit.prevent="submit"> | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | <div class="container"> | ||||
<select class="form-select" id="country" v-model="profile.country"> | <select class="form-select" id="country" v-model="profile.country"> | ||||
<option value="">-</option> | <option value="">-</option> | ||||
<option v-for="(item, code) in countries" :value="code" :key="code">{{ item[1] }}</option> | <option v-for="(item, code) in countries" :value="code" :key="code">{{ item[1] }}</option> | ||||
</select> | </select> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="row mb-3"> | <div class="row mb-3"> | ||||
<label for="password" class="col-sm-4 col-form-label">{{ $t('form.password') }}</label> | <label for="password" class="col-sm-4 col-form-label">{{ $t('form.password') }}</label> | ||||
<div class="col-sm-8"> | <password-input class="col-sm-8" v-model="profile"></password-input> | ||||
<input type="password" class="form-control" id="password" | |||||
v-model="profile.password" | |||||
:placeholder="$t('form.password')" | |||||
> | |||||
<input type="password" class="form-control mt-2" id="password_confirmation" | |||||
v-model="profile.password_confirmation" | |||||
:placeholder="$t('form.password-confirm')" | |||||
> | |||||
</div> | |||||
</div> | </div> | ||||
<button class="btn btn-primary button-submit mt-2" type="submit"><svg-icon icon="check"></svg-icon> {{ $t('btn.submit') }}</button> | <button class="btn btn-primary button-submit mt-2" type="submit"><svg-icon icon="check"></svg-icon> {{ $t('btn.submit') }}</button> | ||||
</form> | </form> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</template> | </template> | ||||
<script> | <script> | ||||
import PasswordInput from '../Widgets/PasswordInput' | |||||
export default { | export default { | ||||
components: { | |||||
PasswordInput | |||||
}, | |||||
data() { | data() { | ||||
return { | return { | ||||
profile: {}, | profile: {}, | ||||
user_id: null, | user_id: null, | ||||
wallet_id: null, | wallet: {}, | ||||
countries: window.config.countries | countries: window.config.countries | ||||
} | } | ||||
}, | }, | ||||
created() { | created() { | ||||
this.wallet_id = this.$store.state.authInfo.wallet.id | this.wallet = this.$store.state.authInfo.wallet | ||||
this.profile = this.$store.state.authInfo.settings | this.profile = this.$store.state.authInfo.settings | ||||
this.user_id = this.$store.state.authInfo.id | this.user_id = this.$store.state.authInfo.id | ||||
}, | }, | ||||
mounted() { | mounted() { | ||||
$('#first_name').focus() | $('#first_name').focus() | ||||
}, | }, | ||||
methods: { | methods: { | ||||
submit() { | submit() { | ||||
Show All 14 Lines |