From c408c44676e9e0794e0999cf0afc1b42e4815c7b Mon Sep 17 00:00:00 2001 From: lesion Date: Fri, 7 Jun 2019 17:02:33 +0200 Subject: [PATCH] . --- .eslintrc.js | 6 ++- .sequelizerc | 2 +- locales/it.js | 10 +++-- nuxt.config.js | 43 +++++++------------ pages/admin.vue | 21 +++++++-- pages/embed/list.vue | 6 +-- pages/index.vue | 25 ++++------- pages/login.vue | 1 - pages/register.vue | 14 +++--- pages/settings.vue | 14 +++--- plugins/filters.js | 6 +-- plugins/i18n.js | 3 +- plugins/v-calendar.js | 2 +- server/api/controller/bot.js | 18 ++++---- server/api/controller/event.js | 12 +++--- server/api/controller/export.js | 16 +++---- server/api/controller/settings.js | 24 +++++------ server/api/controller/user.js | 31 ++++++------- server/api/index.js | 29 ++++++------- server/api/mail.js | 4 +- server/api/models/comment.js | 14 +++--- server/api/models/event.js | 16 +++---- server/api/models/eventnotification.js | 14 +++--- server/api/models/index.js | 36 ++++++++-------- server/api/models/notification.js | 14 +++--- server/api/models/place.js | 12 +++--- server/api/models/setting.js | 12 +++--- server/api/models/tag.js | 12 +++--- server/api/models/user.js | 18 +++++--- server/firstrun.js | 32 +++++++------- server/index.js | 9 ++-- ...lace.js => 20190605141800-create-place.js} | 0 .../migrations/20190605141850-create-event.js | 10 ++--- .../20190605142152-create-notification.js | 10 ++--- ...0190605142409-create-event-notification.js | 7 ++- ...nt.js => 20190605142434-create-comment.js} | 2 +- .../20190605142619-create-setting.js | 10 ++--- .../20190605160024-create-event-tag.js | 8 ++-- server/notifier.js | 10 ++--- store/index.js | 16 +++---- 40 files changed, 270 insertions(+), 279 deletions(-) rename server/migrations/{20190605142103-create-place.js => 20190605141800-create-place.js} (100%) rename server/migrations/{20190605135434-create-comment.js => 20190605142434-create-comment.js} (96%) 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 @@