diff --git a/.eslintrc.js b/.eslintrc.js
index f5beea15..6c7dde5c 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -19,6 +19,10 @@ module.exports = {
],
// add your custom rules here
rules: {
- 'nuxt/no-cjs-in-config': 'off'
+ 'nuxt/no-cjs-in-config': 'off',
+ 'camelcase': 'off',
+ 'no-console': 'off',
+ 'arrow-parens': 'off',
+ 'import/order': 'off'
}
}
diff --git a/.sequelizerc b/.sequelizerc
index cf1a6883..31b6598f 100644
--- a/.sequelizerc
+++ b/.sequelizerc
@@ -1,7 +1,7 @@
const path = require('path')
module.exports = {
- 'config': path.resolve('server' ,'config.js'),
+ 'config': path.resolve('config.js'),
'migrations-path': path.resolve('server', 'migrations'),
'models-path': path.resolve('server', 'api', 'models')
}
diff --git a/locales/it.js b/locales/it.js
index c87f8e98..da1d9e08 100644
--- a/locales/it.js
+++ b/locales/it.js
@@ -41,7 +41,7 @@ const it = {
logout_ok: 'Uscita correttamente',
copy: 'Copia'
},
-
+
login: {
description: `Entrando puoi pubblicare nuovi eventi.`,
check_email: 'Controlla la tua posta (anche lo spam)',
@@ -75,7 +75,9 @@ const it = {
description: `I movimenti hanno bisogno di organizzarsi e autofinanziarsi.
Questo รจ un dono per voi, usatelo solo per eventi non commerciali e ovviamente antifascisti, antisessisti, antirazzisti.
Prima di poter pubblicare dobbiamo approvare l'account, considera che dietro questo sito ci sono delle persone di
carne e sangue, scrivici quindi due righe per farci capire che eventi vorresti pubblicare.`,
- error: 'Errore: '
+ error: 'Errore: ',
+ admin_complete: 'Sei il primo utente e quindi sei amministratore!',
+ complete: 'Confermeremo la registrazione quanto prima.'
},
event: {
@@ -124,9 +126,9 @@ const it = {
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.`,
+ smtp: `Inserisci un account SMTP relativo a questa istanza di gancio.`
}
}
-export default it
\ No newline at end of file
+export default it
diff --git a/nuxt.config.js b/nuxt.config.js
index 8d00adf6..42ae54ef 100644
--- a/nuxt.config.js
+++ b/nuxt.config.js
@@ -1,4 +1,8 @@
-const config = require('./server/config').SHARED_CONF
+const argv = require('yargs').argv
+const path = require('path')
+const config_path = path.resolve(argv.config || './config.js')
+
+const config = require(config_path).SHARED_CONF
module.exports = {
mode: 'universal',
@@ -15,7 +19,6 @@ module.exports = {
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
},
dev: (process.env.NODE_ENV !== 'production'),
-
serverMiddleware: [
{ path: '/api', handler: '@/server/api/index.js' }
],
@@ -30,18 +33,20 @@ module.exports = {
*/
css: [
'bootstrap/dist/css/bootstrap.css',
- 'element-ui/lib/theme-chalk/index.css',
+ 'element-ui/lib/theme-chalk/index.css'
],
-
+ env: {
+ config
+ },
/*
** Plugins to load before mounting the App
*/
plugins: [
'@/plugins/element-ui', // UI library -> https://element.eleme.io/#/en-US/
- '@/plugins/filters', // text filters, datetime, etc.
- '@/plugins/i18n', // localization plugin
+ '@/plugins/filters', // text filters, datetime, etc.
+ '@/plugins/i18n', // localization plugin
'@/plugins/vue-awesome', // icon
- { src: '@/plugins/v-calendar', ssr: false }, // calendar, TO-REDO
+ { src: '@/plugins/v-calendar', ssr: false } // calendar, TO-REDO
],
/*
@@ -58,7 +63,7 @@ module.exports = {
axios: {
baseURL: config.baseurl + '/api',
browserBaseURL: config.baseurl + '/api',
- prefix: '/api',
+ prefix: '/api'
// credentials: true
// See https://github.com/nuxt-community/axios-module#options
},
@@ -68,37 +73,19 @@ module.exports = {
endpoints: {
login: { url: '/auth/login', method: 'post', propertyName: 'token' },
logout: false,
- user: { url: '/auth/user', method: 'get', propertyName: false },
- },
+ user: { url: '/auth/user', method: 'get', propertyName: false }
+ }
}
}
},
-
/*
** Build configuration
*/
build: {
- // babel: {
- // presets: ['@nuxt/babel-preset-app']
- // },
transpile: [/^element-ui/, /^vue-awesome/],
splitChunks: {
layouts: true
}
- /*
- ** You can extend webpack config here
- */
- // extend(config, ctx) {
- // Run ESLint on save
- // if (ctx.isDev && ctx.isClient) {
- // config.module.rules.push({
- // enforce: 'pre',
- // test: /\.(js|vue)$/,
- // loader: 'eslint-loader',
- // exclude: /(node_modules)/
- // })
- // }
- // }
}
}
diff --git a/pages/admin.vue b/pages/admin.vue
index b6f41b0d..23e0c75a 100644
--- a/pages/admin.vue
+++ b/pages/admin.vue
@@ -1,5 +1,9 @@
- el-dialog(:title='$t("common.admin")' width='80%' :visible='open' :before-close='close')
+ el-card(:title='$t("common.admin")' width='80%' :visible='open' :before-close='close')
+ nuxt-link.float-right(to='/')
+ v-icon(name='times' color='red')
+ h5 {{$t('common.admin')}}
+
el-tabs(tabPosition='left' v-model='tab')
//- USERS
@@ -81,9 +85,18 @@
template(slot='label')
v-icon(name='cog')
span {{$t('common.settings')}}
+
+ //- el-form(inline @submit.prevent.stop='save_settings' label-width='140px')
+ //- p {{$t('settings.name_description')}}
+ //- el-form-item(:label="$t('settings.name')")
+ //- el-input(v-model="settings.title")
+ //- el-form-item(:label="$t('settings.description')")
+ //- el-input(v-model="settings.description")
+ //- el-button(slot='append' @click='associate' :disabled='!mastodon_instance.length') {{$t('common.associate')}}
+
el-form(inline @submit.prevent.stop='associatemastodon_instance')
span {{$t('admin.mastodon_description')}}
- el-input(v-model="mastodon_instance")
+ el-input(v-model="settings.mastodon_instance")
span(slot='prepend') {{$t('admin.mastodon_instance')}}
el-button(slot='append' @click='associate' :disabled='!mastodon_instance.length') {{$t('common.associate')}}
@@ -111,7 +124,9 @@ export default {
tag: {name: '', color: ''},
events: [],
loading: false,
- mastodon_instance: '',
+ settings: {
+ mastodon_instance: '',
+ },
settings: {},
tab: "0",
open: true
diff --git a/pages/embed/list.vue b/pages/embed/list.vue
index 9a90b221..1e711364 100644
--- a/pages/embed/list.vue
+++ b/pages/embed/list.vue
@@ -11,9 +11,9 @@ export default {
components: { List },
computed: mapState(['config']),
async asyncData ({ $axios, req, res }) {
- const title = req.query.title || config.title
- const tags = req.query.tags
- const places = req.query.places
+ const title = req && req.query && req.query.title || this.config.title
+ const tags = req && req.query && req.query.tags
+ const places = req && req.query && req.query.places
const now = new Date()
let params = []
diff --git a/pages/index.vue b/pages/index.vue
index 53009c3b..a74231c1 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -2,7 +2,6 @@
#home
Nav
Home
-