fix #10 choose upload path in config.js

This commit is contained in:
lesion
2019-06-11 17:44:11 +02:00
parent a557348b21
commit 5778c64108
16 changed files with 99 additions and 95 deletions

View File

@@ -223,6 +223,8 @@ export default {
const place = this.places.find( p => p.name === this.event.place.name )
if (place && place.address) {
this.event.place.address = place.address
} else {
this.event.place.address = ''
}
this.$refs.address.focus()
},

View File

@@ -5,13 +5,13 @@
import { mapState } from 'vuex'
import List from '../../components/List'
import moment from 'dayjs'
import get from 'lodash/get'
export default {
layout: 'iframe',
components: { List },
computed: mapState(['config']),
async asyncData ({ $axios, req, res }) {
const title = req && req.query && req.query.title || this.config.title
const title = get(req, 'query.title')
const tags = req && req.query && req.query.tags
const places = req && req.query && req.query.places
const now = new Date()

View File

@@ -1,6 +1,5 @@
<template lang="pug">
el-card#eventDetail
el-card#eventDetail(v-loading='!loaded')
//- close button
nuxt-link.float-right(to='/')
el-button(circle icon='el-icon-close' type='danger' size='small' plain)
@@ -18,7 +17,7 @@
el-button(icon='el-icon-arrow-right' round type='success')
//- image
img(:src='imgPath' v-if='event.image_path')
img(:src='imgPath' v-if='event.image_path' @load='image_loaded')
.info
div {{event|event_when}}
@@ -56,6 +55,11 @@ import { mapState, mapActions, mapGetters } from 'vuex'
export default {
name: 'Event',
data () {
return {
loaded: false,
}
},
// transition: null,
// Watch for $route.query.page to call Component methods (asyncData, fetch, validate, layout, etc.)
// watchQuery: ['id'],
@@ -84,7 +88,8 @@ export default {
},
async asyncData ( { $axios, params }) {
const event = await $axios.$get(`/event/${params.id}`)
return { event, id: params.id}
const loaded = !event.image_path
return { event, id: params.id, loaded }
},
computed: {
...mapGetters(['filteredEvents']),
@@ -112,6 +117,9 @@ export default {
},
},
methods: {
image_loaded (e, b) {
this.loaded = true
},
...mapActions(['delEvent']),
comment_filter (value) {
return value.replace(/<a.*href="([^">]+).*>(?:.(?!\<\/a\>))*.<\/a>/, (orig, url) => {

View File

@@ -15,14 +15,14 @@
//- 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')
p(v-html='$t(`export.email_description`)')
el-form(@submit.native.prevent)
//- el-switch(v-model='notification.notify_on_add' :active-text="$t('notify_on_insert')")
//- br
//- el-switch.mt-2(v-model='notification.send_notification' :active-text="$t('send_notification')")
el-input.mt-2(v-model='notification.email' :placeholder="$t('export.insert_your_address')" ref='email')
el-button.mt-2.float-right(native-type= 'submit' type='success' @click='add_notification') {{$t('common.send')}}
//- el-tab-pane.pt-1(label='email' name='email')
//- p(v-html='$t(`export.email_description`)')
//- el-form(@submit.native.prevent)
//- //- el-switch(v-model='notification.notify_on_add' :active-text="$t('notify_on_insert')")
//- //- br
//- //- el-switch.mt-2(v-model='notification.send_notification' :active-text="$t('send_notification')")
//- el-input.mt-2(v-model='notification.email' :placeholder="$t('export.insert_your_address')" ref='email')
//- el-button.mt-2.float-right(native-type= 'submit' type='success' @click='add_notification') {{$t('common.send')}}
el-tab-pane.pt-1(label='feed rss' name='feed')
span(v-html='$t(`export.feed_description`)')
@@ -104,10 +104,14 @@ export default {
params.push(`title=${this.list.title}`)
}
if (this.filters.places) {
if (this.filters.places.length) {
params.push(`places=${this.filters.places}`)
}
if (this.filters.tags.length) {
params.push(`tags=${this.filters.tags}`)
}
return `<iframe src="${process.env.baseurl}/embed/list?${params.join('&')}"></iframe>`
},
link () {

View File

@@ -5,21 +5,21 @@
v-icon(name='times' color='red')
h5 {{$t('common.settings')}}
//- el-form
//- el-form-item {{$t('settings.change_password')}}
el-divider {{$t('settings.change_password')}}
el-input(v-model='password' type='password')
el-button(slot='append' @click='change' type='success') {{$t('common.send')}}
el-form(action='/api/user' method='PUT' @submit.native.prevent='change')
el-form-item {{$t('settings.change_password')}}
el-input(v-model='password' type='password')
el-button(type='success' native-type='submit') {{$t('common.send')}}
</template>
<script>
import { mapState, mapActions } from 'vuex'
import { Message } from 'element-ui'
export default {
data () {
return {
password: '',
}
},
// computed: mapState(['user']),
// async asyncData ({ $axios, params }) {
// const user = await $axios.$get('/auth/user')
// user.mastodon_auth = ''
@@ -31,6 +31,8 @@ export default {
const user_data = { id : this.$auth.user.id, password: this.password }
try {
const user = await this.$axios.$put('/user', user_data)
Message({ message: this.$t('settings.password_updated'), type: 'success' })
this.$router.replace('/')
} catch (e) {
console.log(e)
}