This commit is contained in:
lesion
2019-07-03 16:33:03 +02:00
parent c6fb23810a
commit 6a96193ffc
8 changed files with 26 additions and 16 deletions

View File

@@ -1,10 +1,11 @@
## gancio ## gancio
### event manager for radical communities ### shared agenda for local communities
> :warning: Gancio is under heavy development, > :warning: Gancio is under heavy development,
> if something is not working as expected, it's expected :D > if something is not working as expected, it's expected :D
## Install ## Install
You will need `npm` or `yarn` installed in your system. You will need `npm` or `yarn` installed in your system.
@@ -34,3 +35,5 @@ yarn build
yarn start yarn start
``` ```
Made with :heart: by [underscore hacklab](https://autistici.org/underscore)

View File

@@ -13,9 +13,9 @@ module.exports = {
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }] link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
}, },
dev: (process.env.NODE_ENV !== 'production'), dev: (process.env.NODE_ENV !== 'production'),
serverMiddleware: [ // serverMiddleware: [
{ path: '/api', handler: '@/server/api/index.js' } // { path: '/api', handler: '@/server/api/index.js' }
], // ],
server: conf.server, server: conf.server,

View File

@@ -1,6 +1,6 @@
{ {
"name": "gancio", "name": "gancio",
"version": "0.9.15", "version": "0.9.17",
"description": "A shared agenda for local communities", "description": "A shared agenda for local communities",
"author": "lesion", "author": "lesion",
"scripts": { "scripts": {
@@ -36,7 +36,6 @@
"dependencies": { "dependencies": {
"@nuxtjs/auth": "^4.6.5", "@nuxtjs/auth": "^4.6.5",
"@nuxtjs/axios": "^5.5.3", "@nuxtjs/axios": "^5.5.3",
"arg": "^4.1.0",
"axios": "^0.19.0", "axios": "^0.19.0",
"bcrypt": "^3.0.5", "bcrypt": "^3.0.5",
"body-parser": "^1.18.3", "body-parser": "^1.18.3",
@@ -54,11 +53,10 @@
"inquirer": "^6.3.1", "inquirer": "^6.3.1",
"jsonwebtoken": "^8.5.1", "jsonwebtoken": "^8.5.1",
"less": "^3.9.0", "less": "^3.9.0",
"mastodon-api": "^1.3.0", "mastodon-api": "lesion/mastodon-api",
"morgan": "^1.9.1", "morgan": "^1.9.1",
"multer": "^1.4.1", "multer": "^1.4.1",
"nuxt": "^2.8.1", "nuxt": "^2.8.1",
"nuxt-env": "^0.1.0",
"nuxt-i18n": "^5.12.4", "nuxt-i18n": "^5.12.4",
"pg": "^7.11.0", "pg": "^7.11.0",
"sequelize": "^5.8.7", "sequelize": "^5.8.7",

View File

@@ -42,8 +42,8 @@
@click='delete_user(data.row)') {{$t('admin.delete_user')}} @click='delete_user(data.row)') {{$t('admin.delete_user')}}
div(v-else) div(v-else)
span {{$t('common.me')}} span {{$t('common.me')}}
no-ssr no-ssr
el-pagination(:page-size='perPage' :currentPage.sync='userPage' :total='users.length') el-pagination(:page-size='perPage' :currentPage.sync='userPage' :total='users.length')
//- PLACES //- PLACES
el-tab-pane.pt-1 el-tab-pane.pt-1

View File

@@ -1,4 +1,4 @@
const { event: Event, place: Place } = require('../models') const { event: Event, place: Place, tag: Tag } = require('../models')
const { Op } = require('sequelize') const { Op } = require('sequelize')
const moment = require('moment') const moment = require('moment')
const ics = require('ics') const ics = require('ics')
@@ -9,11 +9,15 @@ const exportController = {
const type = req.params.type const type = req.params.type
const tags = req.query.tags const tags = req.query.tags
const places = req.query.places const places = req.query.places
const where = {} const where = {}
const yesterday = moment().subtract('1', 'day').unix() const yesterday = moment().subtract('1', 'day').unix()
let where_tags = {}
if (tags) { if (tags) {
where.tag = tags.split(',') where_tags = { where: { tag: tags.split(',') } }
} }
if (places) { if (places) {
where.placeId = places.split(',') where.placeId = places.split(',')
} }
@@ -27,7 +31,7 @@ const exportController = {
attributes: { attributes: {
exclude: ['createdAt', 'updatedAt'] exclude: ['createdAt', 'updatedAt']
}, },
include: [{ model: Place, attributes: ['name', 'id', 'address'] }] include: [ { model: Tag, ...where_tags }, { model: Place, attributes: ['name', 'id', 'address'] }]
}) })
switch (type) { switch (type) {
case 'feed': case 'feed':

View File

@@ -2,6 +2,7 @@ const Email = require('email-templates')
const path = require('path') const path = require('path')
const moment = require('moment') const moment = require('moment')
const config = require('config') const config = require('config')
const settings = require('./controller/settings')
moment.locale('it') moment.locale('it')
const mail = { const mail = {
@@ -23,7 +24,10 @@ const mail = {
send: true, send: true,
i18n: { i18n: {
directory: path.join(__dirname, '..', '..', 'locales', 'email'), directory: path.join(__dirname, '..', '..', 'locales', 'email'),
defaultLocale: 'it' syncFiles: false,
updateFiles: false,
defaultLocale: settings.locale,
objectNotation: true
}, },
transport: config.smtp transport: config.smtp
}) })

View File

@@ -8,7 +8,7 @@ const db = {}
const sequelize = new Sequelize(config.db) const sequelize = new Sequelize(config.db)
sequelize.authenticate().catch( e => { sequelize.authenticate().catch( e => {
consola.error('Error connecting to DB: ', e) consola.error('Error connecting to DB: ', String(e))
process.exit(-1) process.exit(-1)
}) })

View File

@@ -26,9 +26,10 @@ async function start() {
} }
// Give nuxt middleware to express
app.use(morgan('dev')) app.use(morgan('dev'))
app.use('/media/', express.static(config.upload_path)) app.use('/media/', express.static(config.upload_path))
app.use('/api', require('./api/index'))
// Give nuxt middleware to express
app.use(nuxt.render) app.use(nuxt.render)
// Listen the server // Listen the server