diff --git a/config.example.js b/config.example.js
index b5af33fb..3aff4ebe 100644
--- a/config.example.js
+++ b/config.example.js
@@ -1,14 +1,15 @@
-const path = require('path')
-
/**
* -[ GANCIO CONFIGURATION ]-
*
+ * search and replace 'CHANGE ME'
+ *
* -[ Database configuration ]-
* `development` configuration is enabled running `yarn dev`
* while `production` with `yarn start`
* ref: http://docs.sequelizejs.com/class/lib/sequelize.js~Sequelize.html#instance-constructor-constructor
*
*/
+const path = require('path')
const DB_CONF = {
development: {
@@ -16,8 +17,8 @@ const DB_CONF = {
dialect: 'sqlite'
},
production: {
- username: '',
- password: '',
+ username: 'CHANGE ME',
+ password: 'CHANGE ME',
database: 'gancio',
host: 'localhost',
dialect: 'postgres',
@@ -26,7 +27,7 @@ const DB_CONF = {
}
const env = process.env.NODE_ENV || 'development'
-
+const isDev = env === 'development'
/**
* -[ Main configuration ]-
*
@@ -34,30 +35,34 @@ const env = process.env.NODE_ENV || 'development'
const config = {
server: {
port: '3000',
- host: '0',
+ host: 'localhost', // use 0.0.0.0 to bind to all interface
+
// uncomment to use unix socket to serve gancio
// path: '/tmp/gancio_socket',
},
+
locale: 'it',
- title: 'GANCIO',
- description: 'A shared agenda for radical communities',
- baseurl: '' || 'http://localhost:3000',
+ title: isDev ? 'GANCIO' : 'CHANGE ME',
+ description: isDev ? 'A shared agenda for radical communities' : 'CHANGE ME',
+ baseurl: isDev ? 'http://localhost:3000' : 'https://CHANGE_ME',
+
+ upload_path: isDev ? '/tmp/gancio_upload' : '/var/gancio/upload/',
// where events/users confirmation email are sent
- admin: '',
+ admin: 'CHANGE ME',
// jwt salt secret, generate it randomly with
// < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32};echo;
- secret: '',
+ secret: isDev ? 'notreallyrandom' : 'CHANGE ME',
// smtp account to send email
smtp: {
- host: process.env.SMTP_HOST || 'mail.example.com',
- secure: true,
+ host: 'CHANGE ME', // mail.example.com
auth: {
- user: process.env.SMTP_USER || 'gancio@example.com',
- pass: process.env.SMTP_PASS || ''
- }
+ user: 'CHANGE ME',
+ pass: 'CHANGE ME'
+ },
+ secure: true
},
db: DB_CONF[env]
}
diff --git a/locales/it.js b/locales/it.js
index f9eba3f3..9263ea73 100644
--- a/locales/it.js
+++ b/locales/it.js
@@ -122,21 +122,21 @@ const it = {
},
settings: {
- change_password: 'Cambia password'
+ change_password: 'Cambia password',
+ password_updated: 'Password modificata'
},
err: {
register_error: 'Errore nella registrazione'
}
+
+
// firstrun: {
// basic: `Inserisci titolo e descrizione della tua istanza di gancio.`,
// database: `Gancio ha bisogno di un database postgresql!`,
// smtp: `Inserisci un account SMTP relativo a questa istanza di gancio.`
// },
- // email: {
- // registration: `Abbiamo ricevuto la richiesta di registrazione. La confermeremo quanto prima.\n Ciao`
- // }
}
export default it
diff --git a/pages/add/_edit.vue b/pages/add/_edit.vue
index 4ba18cc3..4e5b2bd0 100644
--- a/pages/add/_edit.vue
+++ b/pages/add/_edit.vue
@@ -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()
},
diff --git a/pages/embed/list.vue b/pages/embed/list.vue
index 1e711364..25dc2e57 100644
--- a/pages/embed/list.vue
+++ b/pages/embed/list.vue
@@ -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()
diff --git a/pages/event/_id.vue b/pages/event/_id.vue
index 49f7bcc6..8844a635 100644
--- a/pages/event/_id.vue
+++ b/pages/event/_id.vue
@@ -1,6 +1,5 @@
- 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\>))*.<\/a>/, (orig, url) => {
diff --git a/pages/export.vue b/pages/export.vue
index b658f51a..c85b5dc2 100644
--- a/pages/export.vue
+++ b/pages/export.vue
@@ -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 ``
},
link () {
diff --git a/pages/settings.vue b/pages/settings.vue
index 231db972..78e81f16 100644
--- a/pages/settings.vue
+++ b/pages/settings.vue
@@ -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')}}