This commit is contained in:
les
2020-07-29 02:18:46 +02:00
parent 2dc6e7adb3
commit 24a99d0eb0
8 changed files with 39 additions and 38 deletions

View File

@@ -1,5 +1,5 @@
<template lang='pug'>
el-card.mt-5
v-card.mt-5
h4(slot='header')
nuxt-link(to='/')
img(src='/favicon.ico')
@@ -13,9 +13,9 @@
br
br
a(:href='authorizeURL')
el-button.mr-1(plain type='success' icon='el-icon-check') {{$t('common.authorize')}}
v-btn.mr-1(plain color='success') {{$t('common.authorize')}}
a(href='/')
el-button.mt-1(plain type='danger') {{$t('common.cancel')}}
v-btn.mt-1(plain color='danger') {{$t('common.cancel')}}
</template>
<script>

View File

@@ -7,7 +7,7 @@
v-card-subtitle(v-text="$t('login.description')")
v-card-text
v-form
v-form(v-model='valid' ref='form')
v-text-field(v-model='email' type='email'
:rules='validators.email' autofocus
:placeholder='$t("common.email")'
@@ -18,9 +18,13 @@
type='password'
:placeholder='$t("common.password")')
v-card-actions
v-spacer
v-btn(text @click='forgot' small) {{$t('login.forgot_password')}}
v-card-actions
v-btn(color='success'
:disabled='disabled'
:disabled='!valid'
@click='submit') {{$t('common.login')}}
v-btn(v-if='settings.allow_registration'
@@ -28,7 +32,6 @@
text
color='orange') {{$t('login.not_registered')}}
v-btn(text @click='forgot') {{$t('login.forgot_password')}}
</template>
<script>
@@ -42,19 +45,17 @@ export default {
validators,
password: '',
email: '',
loading: false
loading: false,
valid: false
}
},
computed: {
...mapState(['settings']),
disabled () {
return !this.email || !this.password
}
...mapState(['settings'])
},
methods: {
async forgot () {
if (!this.email) {
this.$root.$message({ message: this.$t('login.insert_email'), color: 'error' })
// this.$root.$message({ message: this.$t('login.insert_email'), color: 'error' })
this.$refs.email.focus()
return
}
@@ -64,7 +65,6 @@ export default {
this.$root.$message({ message: this.$t('login.check_email'), color: 'success' })
},
async submit (e) {
if (this.disabled) { return false }
e.preventDefault()
try {
this.loading = true

View File

@@ -8,7 +8,7 @@
v-card-text
p(v-html="$t('register.description')")
v-form(ref='form')
v-form(ref='form' v-model='valid')
v-text-field(ref='email'
v-model='user.email' type='email'
:rules="validators.email"
@@ -23,7 +23,8 @@
:label="$t('common.description')")
v-card-actions
v-btn(@click='register' color='primary') {{$t('common.send')}}
v-spacer
v-btn(@click='register' :disabled='!valid' color='primary') {{$t('common.send')}}
v-icon mdi-chevron-right
</template>
@@ -38,7 +39,8 @@ export default {
return {
validators,
loading: false,
user: {}
user: {},
valid: false
}
},
// https://nuxtjs.org/api/pages-validate/

View File

@@ -64,11 +64,11 @@
v-btn(type='text' @click='showFollowMe=true') {{$t('event.interact_with_me')}}
span(v-if='settings.enable_resources && event.resources.length') - {{$tc('common.n_resources', event.resources.length)}}
v-dialog(:visible.sync='showFollowMe' destroy-on-close)
v-dialog(v-model='showFollowMe' destroy-on-close)
h4(slot='title') {{$t('common.follow_me_title')}}
FollowMe
v-dialog.showResource#resourceDialog(:visible.sync='showResources' fullscreen
v-dialog.showResource#resourceDialog(v-model='showResources' fullscreen
width='95vw'
destroy-on-close
@keydown.native.right='$refs.carousel.next()'
@@ -78,9 +78,9 @@
v-img(:src='attachment.url')
v-card.mb-1(v-if='settings.enable_resources' v-for='resource in event.resources' :key='resource.id' :class='{disabled: resource.hidden}')
span
el-dropdown.mr-2(v-if='$auth.user && $auth.user.is_admin')
el-button(circle icon='el-icon-more' size='mini')
el-dropdown-menu(slot='dropdown')
v-dropdown.mr-2(v-if='$auth.user && $auth.user.is_admin')
v-btn(circle icon='el-icon-more' size='mini')
v-menu(slot='dropdown')
el-dropdown-item(v-if='!resource.hidden' icon='el-icon-remove' @click.native='hideResource(resource, true)') {{$t('admin.hide_resource')}}
el-dropdown-item(v-else icon='el-icon-success' @click.native='hideResource(resource, false)') {{$t('admin.show_resource')}}
el-dropdown-item(icon='el-icon-delete' @click.native='deleteResource(resource)') {{$t('admin.delete_resource')}}

View File

@@ -1,5 +1,5 @@
<template lang="pug">
el-main
v-main
p {{$auth.user.email}}
//- el-form(action='/api/user' method='PUT' @submit.native.prevent='update_settings' inline label-width='200px')
@@ -7,9 +7,9 @@
//- el-input(v-model='password' type='password')
//- el-button(type='success' native-type='submit') {{$t('common.save')}}
el-divider {{$t('settings.danger_section')}}
p {{$t('settings.danger_section')}}
p {{$t('settings.remove_account')}}
el-button(type='danger' @click='remove_account') {{$t('common.remove')}}
v-btn(color='danger' @click='remove_account') {{$t('common.remove')}}
</template>
<script>
import { mapState } from 'vuex'