This commit is contained in:
lesion
2019-06-06 23:54:32 +02:00
parent 745b9247c9
commit 3ca818f016
66 changed files with 989 additions and 532 deletions

View File

@@ -1,7 +1,10 @@
<template lang="pug">
el-dialog(:title='$t("common.info")' visible
:before-close='close')
h5 Chi siamo
el-card
nuxt-link.float-right(to='/')
v-icon(name='times' color='red')
h3 {{$t('common.info')}}
p.
Gancio e' un progetto dell'<a href='https://autistici.org/underscore'>underscore hacklab</a> e uno dei
servizi di <a href='https://cisti.org'>cisti.org</a>.

View File

@@ -1,5 +1,9 @@
<template lang="pug">
el-dialog(:before-close='close' :visible='open' :title="edit?$t('common.edit_event'):$t('common.add_event')")
el-card
nuxt-link.float-right(to='/')
v-icon(name='times' color='red')
h5 {{edit?$t('common.edit_event'):$t('common.add_event')}}
el-form(v-loading='loading')
el-tabs.mb-2(v-model='activeTab')
@@ -12,14 +16,7 @@
//- WHERE
el-tab-pane
span(slot='label') <v-icon name='map-marker-alt'/> {{$t('common.where')}}
div {{$t('common.where')}}
el-popover(
placement="top-start"
width="400"
trigger="click")
v-icon(slot='reference' color='#ff9fc4' name='question-circle')
slot
p(v-html="$t('event.where_description')")
p(v-html="$t('event.where_description')")
el-select.mb-3(v-model='event.place.name'
@change='placeChoosed'
@@ -27,7 +24,7 @@
default-first-option
)
el-option(v-for='place in places' :label='place.name' :value='place.name' :key='place.id')
span {{place.name}} - {{place.weigth}}
span {{place.name}}
div {{$t("common.address")}}
el-input.mb-3(ref='address' v-model='event.place.address'
:disabled='places_name.indexOf(event.place.name)>-1'
@@ -190,11 +187,6 @@ export default {
},
methods: {
...mapActions(['addEvent', 'updateEvent', 'updateMeta']),
close (done) {
this.$router.replace('/')
done()
},
eventToAttribute(event) {
let e = {
key: event.id,

View File

@@ -130,7 +130,8 @@ export default {
const users = await $axios.$get('/users')
const events = await $axios.$get('/event/unconfirmed')
const settings = await $axios.$get('/settings')
return { users, events, settings, mastodon_instance: settings.mastodon_auth && settings.mastodon_auth.instance}
return { users, events, settings, mastodon_instance: settings && settings.mastodon_auth && settings.mastodon_auth.instance || ''}
} catch ( e ) {
console.error(e)
}

View File

@@ -3,15 +3,15 @@
</template>
<script>
import { mapState } from 'vuex'
import { SHARED_CONF } from '../../config'
import List from '../../components/List'
import moment from 'dayjs'
export default {
layout: 'iframe',
components: { List },
computed: mapState(['config']),
async asyncData ({ $axios, req, res }) {
const title = req.query.title || SHARED_CONF.title
const title = req.query.title || config.title
const tags = req.query.tags
const places = req.query.places
const now = new Date()

View File

@@ -53,7 +53,6 @@
</template>
<script>
import { mapState, mapActions, mapGetters } from 'vuex'
import config from '@/config'
export default {
name: 'Event',

View File

@@ -1,5 +1,11 @@
<template lang="pug">
el-dialog(:title='$t("common.export")' visible :before-close='close')
el-card
nuxt-link.float-right(to='/')
v-icon(name='times' color='red')
h5 {{$t('common.export')}}
p {{$t('export.intro')}}
Search
//- li(v-if='filters.tags.length') {{$t('common.tags')}}:
@@ -59,7 +65,6 @@ import Search from '@/components/Search'
import {intersection} from 'lodash'
import { Message } from 'element-ui'
const { SHARED_CONF } = require('@/config')
export default {
name: 'Export',
@@ -68,7 +73,7 @@ export default {
return {
type: 'email',
notification: { email: '' },
list: { title: SHARED_CONF.title },
list: { title: 'Gancio' },
}
},
// filters,
@@ -76,7 +81,7 @@ export default {
async add_notification () {
if (!this.notification.email){
Message({message:'Inserisci una mail', type: 'error'})
return this.$refs.email.focus()
// return this.$refs.email.focus()
}
// await api.addNotification({ ...this.notification, filters: this.filters})
// this.$refs.modal.hide()
@@ -103,7 +108,7 @@ export default {
params.push(`places=${this.filters.places}`)
}
return `<iframe src="${SHARED_CONF.baseurl}/embed/list?${params.join('&')}"></iframe>`
return `<iframe src="/embed/list?${params.join('&')}"></iframe>`
},
link () {
const tags = this.filters.tags.join(',')
@@ -119,7 +124,7 @@ export default {
}
}
return `${SHARED_CONF.baseurl}/api/export/${this.type}${query}`
return `/api/export/${this.type}${query}`
},
showLink () {
return (['feed', 'ics'].indexOf(this.type)>-1)

View File

@@ -2,13 +2,34 @@
#home
Nav
Home
</template>
<script>
import Home from '~/components/Home.vue'
import Nav from '~/components/Nav.vue'
import { mapState } from 'vuex'
export default {
name: 'Index',
async asyncData ({ redirect, store }) {
// console.error('diocane', store.state.settings)
// const firstRun = store.state.settings.firstRun
// if (firstRun!==true) {
// redirect('/firstrun')
// }
},
async fetch ({ store, $axios }) {
const now = new Date()
const events = await $axios.$get(`/event/${now.getMonth()}/${now.getFullYear()}`)
console.error(events)
store.commit('setEvents', events)
const { tags, places } = await $axios.$get('/event/meta')
store.commit('update', { tags, places })
// const settings = await $axios.$get('/settings')
// store.commit('setSettings', settings)
},
computed: mapState(['events']),
components: { Nav, Home },
}
</script>

View File

@@ -1,17 +1,24 @@
<template lang='pug'>
el-dialog(:title='$t("common.login")' :before-close='close' visible)
el-card
el-form(v-loading='loading')
nuxt-link.float-right(to='/')
v-icon(name='times' color='red')
h5 {{$t('common.login')}}
el-form(v-loading='loading' method='POST' action='/api/auth/login')
p(v-html="$t('login.description')")
el-input.mb-2(v-model='email' type='email' :placeholder='$t("common.email")' autocomplete='email' ref='email')
i.el-icon-user(slot='prepend')
el-input.mb-2(v-model='email' type='email' name='email'
:placeholder='$t("common.email")' autocomplete='email' ref='email')
v-icon(name='user' slot='prepend')
el-input.mb-1(v-model='password' @keyup.enter.native="submit" type='password' :placeholder='$t("common.password")')
i.el-icon-lock(slot='prepend')
el-input.mb-1(v-model='password' @keyup.enter.native="submit" name='password'
type='password' :placeholder='$t("common.password")')
v-icon(name='lock' slot='prepend')
el-button.mr-1(plain type="success" :disabled='!email || !password' @click='submit') {{$t('common.login')}}
el-button.mr-1(plain type="success" native-type='submit'
:disabled='disabled' @click='submit') {{$t('common.login')}}
nuxt-link(to='/register')
el-button.mt-1(plain type="primary") {{$t('login.not_registered')}}
@@ -35,6 +42,12 @@ export default {
loading: false
}
},
computed: {
disabled () {
if (process.server) return false
return !this.email || !this.password
}
},
methods: {
close () {
this.$router.replace('/')

View File

@@ -1,18 +1,25 @@
<template lang='pug'>
el-dialog(:title="$t('common.register')" visible :before-close='() => $router.replace("/")' @open='$refs.email.focus()')
el-form
el-card
nuxt-link.float-right(to='/')
v-icon(name='times' color='red')
h5 {{$t('common.register')}}
el-form(method='POST' action='/api/user')
p(v-html="$t('register.description')")
el-input.mb-2(ref='email' v-model='user.email' type='email' required
:placeholder='$t("common.email")' autocomplete='email')
:placeholder='$t("common.email")' autocomplete='email' name='email')
span(slot='prepend') @
el-input.mb-2(v-model='user.password' type="password" placeholder="Password")
el-input.mb-2(v-model='user.password' type="password" placeholder="Password" name='password')
v-icon(name='lock' slot='prepend')
el-input.mb-2(v-model='user.description' type="textarea" rows='3' :placeholder="$t('common.description')")
v-icon(name='envelope-open-text')
el-button(plain type="success" icon='el-icon-arrow-right' :disabled='!user.password || !user.email || !user.description' @click='register') {{$t('common.send')}}
el-button(plain type="success" native-type='submit'
:disabled='disabled'
@click='register') {{$t('common.send')}} <v-icon name='chevron-right'/>
</template>
<script>
@@ -28,7 +35,10 @@ export default {
}
},
computed: {
disabled () {
if (process.server) return false
return !this.user.password || !this.user.email || !this.user.description
}
},
methods: {
...mapActions(['login']),