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
### event manager for radical communities
### shared agenda for local communities
> :warning: Gancio is under heavy development,
> if something is not working as expected, it's expected :D
## Install
You will need `npm` or `yarn` installed in your system.
@ -34,3 +35,5 @@ yarn build
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' }]
},
dev: (process.env.NODE_ENV !== 'production'),
serverMiddleware: [
{ path: '/api', handler: '@/server/api/index.js' }
],
// serverMiddleware: [
// { path: '/api', handler: '@/server/api/index.js' }
// ],
server: conf.server,

View file

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

View file

@ -42,8 +42,8 @@
@click='delete_user(data.row)') {{$t('admin.delete_user')}}
div(v-else)
span {{$t('common.me')}}
no-ssr
el-pagination(:page-size='perPage' :currentPage.sync='userPage' :total='users.length')
no-ssr
el-pagination(:page-size='perPage' :currentPage.sync='userPage' :total='users.length')
//- PLACES
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 moment = require('moment')
const ics = require('ics')
@ -9,11 +9,15 @@ const exportController = {
const type = req.params.type
const tags = req.query.tags
const places = req.query.places
const where = {}
const yesterday = moment().subtract('1', 'day').unix()
let where_tags = {}
if (tags) {
where.tag = tags.split(',')
where_tags = { where: { tag: tags.split(',') } }
}
if (places) {
where.placeId = places.split(',')
}
@ -27,7 +31,7 @@ const exportController = {
attributes: {
exclude: ['createdAt', 'updatedAt']
},
include: [{ model: Place, attributes: ['name', 'id', 'address'] }]
include: [ { model: Tag, ...where_tags }, { model: Place, attributes: ['name', 'id', 'address'] }]
})
switch (type) {
case 'feed':

View file

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

View file

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

View file

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