.
This commit is contained in:
@@ -26,10 +26,9 @@
|
||||
filterable allow-create
|
||||
default-first-option
|
||||
)
|
||||
el-option(v-for='place in places_name' :label='place' :value='place' :key='place.id')
|
||||
br
|
||||
br
|
||||
div {{$t("common.address")}} {{event.place.name}}
|
||||
el-option(v-for='place in places' :label='place.name' :value='place.name' :key='place.id')
|
||||
span {{place.name}} - {{place.weigth}}
|
||||
div {{$t("common.address")}}
|
||||
el-input.mb-3(ref='address' v-model='event.place.address'
|
||||
:disabled='places_name.indexOf(event.place.name)>-1'
|
||||
@keydown.native.enter='next')
|
||||
@@ -89,9 +88,9 @@
|
||||
:on-change='uploadedFile'
|
||||
:multiple='false'
|
||||
:file-list="fileList"
|
||||
)
|
||||
i.el-icon-upload
|
||||
div.el-upload__text {{$t('event.media_description')}}
|
||||
)
|
||||
i.el-icon-upload
|
||||
div.el-upload__text {{$t('event.media_description')}}
|
||||
el-button.float-right(@click='done' :disabled='!couldProceed') {{edit?$t('common.edit'):$t('common.send')}}
|
||||
|
||||
</template>
|
||||
@@ -153,7 +152,7 @@ export default {
|
||||
computed: {
|
||||
...mapState({
|
||||
tags: state => state.tags.map(t => t.tag ),
|
||||
places_name: state => state.places.map(p => p.name ),
|
||||
places_name: state => state.places.map(p => p.name ).sort((a, b) => b.weigth-a.weigth),
|
||||
places: state => state.places,
|
||||
user: state => state.user,
|
||||
events: state => state.events
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
template(slot='label')
|
||||
v-icon(name='map-marker-alt')
|
||||
span.ml-1 {{$t('common.places')}}
|
||||
p {{$t('admin.place_description')}}
|
||||
p(v-html="$t('admin.place_description')")
|
||||
el-form.mb-2(:inline='true' label-width='120px')
|
||||
el-form-item(:label="$t('common.name')")
|
||||
el-input.mr-1(:placeholder='$t("common.name")' v-model='place.name')
|
||||
@@ -201,7 +201,7 @@ export default {
|
||||
await this.$axios.$get(`/event/confirm/${id}`)
|
||||
this.loading = false
|
||||
Message({
|
||||
message: this.$t('common.event_confirmed'),
|
||||
message: this.$t('event.confirmed'),
|
||||
type: 'success'
|
||||
})
|
||||
this.events = this.events.filter(e => e.id !== id)
|
||||
|
||||
@@ -12,15 +12,18 @@ export default {
|
||||
components: { List },
|
||||
async asyncData ({ $axios, req, res }) {
|
||||
const title = req.query.title || SHARED_CONF.title
|
||||
const show_tags = req.query.showtags
|
||||
const tags = req.query.tags
|
||||
const places = req.query.places
|
||||
const now = new Date()
|
||||
|
||||
// TODO: filter future events based on tags/places/userid
|
||||
const events = await $axios.$get(`/event/${now.getMonth()}/${now.getFullYear()}`)
|
||||
let params = []
|
||||
if (places) params.push(`places=${places}`)
|
||||
if (tags) params.push(`tags=${tags}`)
|
||||
|
||||
return { show_tags, events, title }
|
||||
params = params.length ? `?${params.join('&')}` : ''
|
||||
const events = await $axios.$get(`/export/json${params}`)
|
||||
|
||||
return { events, title }
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
h5.text-center {{event.title}}
|
||||
div.nextprev
|
||||
nuxt-link(v-if='prev' :to='`/event/${prev.id}`')
|
||||
el-button(icon='el-icon-arrow-left' round size='small' type='success' plain)
|
||||
el-button(icon='el-icon-arrow-left' round type='success')
|
||||
nuxt-link.float-right(v-if='next' :to='`/event/${next.id}`')
|
||||
el-button(icon='el-icon-arrow-right' round size='small' plain type='success')
|
||||
el-button(icon='el-icon-arrow-right' round type='success')
|
||||
|
||||
//- image
|
||||
img(:src='imgPath' v-if='event.image_path')
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<template lang="pug">
|
||||
el-dialog(:title='$t("common.export")' visible :before-close='close')
|
||||
p {{$t('export.intro')}}
|
||||
|
||||
li(v-if='filters.tags.length') {{$t('common.tags')}}:
|
||||
el-tag.ml-1(size='mini' v-for='tag in filters.tags' :key='tag.tag') {{tag}}
|
||||
li(v-if='filters.places.length') {{$t('common.places')}}:
|
||||
el-tag.ml-1(size='mini' v-for='place in filters.places' :key='place.id') {{place}}
|
||||
Search
|
||||
//- li(v-if='filters.tags.length') {{$t('common.tags')}}:
|
||||
//- el-tag.ml-1(size='mini' v-for='tag in filters.tags' :key='tag.tag') {{tag}}
|
||||
//- li(v-if='filters.places.length') {{$t('common.places')}}:
|
||||
//- el-tag.ml-1(size='mini' v-for='place in filters.places' :key='place.id') {{place}}
|
||||
el-tabs.mt-2(v-model='type')
|
||||
|
||||
el-tab-pane.pt-1(label='email' name='email')
|
||||
@@ -55,13 +55,15 @@ import { mapState, mapGetters } from 'vuex'
|
||||
import path from 'path'
|
||||
import Calendar from '@/components/Calendar'
|
||||
import List from '@/components/List'
|
||||
import Search from '@/components/Search'
|
||||
|
||||
import {intersection} from 'lodash'
|
||||
import { Message } from 'element-ui'
|
||||
const { SHARED_CONF } = require('@/config')
|
||||
|
||||
export default {
|
||||
name: 'Export',
|
||||
components: { List },
|
||||
components: { List, Search },
|
||||
data () {
|
||||
return {
|
||||
type: 'email',
|
||||
@@ -96,6 +98,11 @@ export default {
|
||||
if (this.list.title) {
|
||||
params.push(`title=${this.list.title}`)
|
||||
}
|
||||
|
||||
if (this.filters.places) {
|
||||
params.push(`places=${this.filters.places}`)
|
||||
}
|
||||
|
||||
return `<iframe src="${SHARED_CONF.baseurl}/embed/list?${params.join('&')}"></iframe>`
|
||||
},
|
||||
link () {
|
||||
|
||||
52
pages/recover/_code.vue
Normal file
52
pages/recover/_code.vue
Normal file
@@ -0,0 +1,52 @@
|
||||
<template lang="pug">
|
||||
el-dialog(visible)
|
||||
template(slot='title')
|
||||
h5 <img src='/favicon.ico'/> {{$t('common.recover_password')}}
|
||||
div(v-if='valid')
|
||||
el-form
|
||||
el-form-item {{$t('common.new_password')}}
|
||||
el-input(type='password', v-model='new_password')
|
||||
el-button(plain type="success" icon='el-icon-send', @click='change_password') {{$t('common.send')}}
|
||||
|
||||
div(v-else) {{$t('recover.not_valid_code')}}
|
||||
|
||||
|
||||
</template>
|
||||
<script>
|
||||
import { Message } from 'element-ui'
|
||||
|
||||
export default {
|
||||
name: 'Recover',
|
||||
data () {
|
||||
return { new_password: '' }
|
||||
},
|
||||
async asyncData({ params, $axios }) {
|
||||
const code = params.code
|
||||
try {
|
||||
const valid = await $axios.$post('/user/check_recover_code', { recover_code: code })
|
||||
return { valid, code }
|
||||
}
|
||||
catch (e) {
|
||||
return { valid: false }
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async change_password () {
|
||||
try {
|
||||
const res = await this.$axios.$post('/user/recover_password', { recover_code: this.code, password: this.new_password })
|
||||
Message({
|
||||
type: 'success',
|
||||
message: this.$t('Password changed!')
|
||||
})
|
||||
} catch(e) {
|
||||
Message({
|
||||
type: 'warning',
|
||||
message: e
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -41,12 +41,9 @@ export default {
|
||||
})
|
||||
this.$router.replace("/")
|
||||
} catch (e) {
|
||||
console.log('DENTRO CATCH!!!', e)
|
||||
const error = e && e.response && e.response.data && e.response.data.errors[0].message || e
|
||||
console.error(error)
|
||||
console.error(e)
|
||||
Message({
|
||||
message: this.$t('register.error') + error,
|
||||
message: this.$t('register.error') + this.$t(error),
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user