This commit is contained in:
lesion 2019-06-08 13:18:47 +02:00
parent c408c44676
commit d6501b1a5b
17 changed files with 63 additions and 34 deletions

2
.gitignore vendored
View file

@ -1,6 +1,6 @@
# Created by .ignore support plugin (hsz.mobi)
### Gancio production configuration
server/config.js
config.js
### Node template
# Logs

View file

@ -6,13 +6,32 @@
## Install
You will need `npm` or `yarn` installed in your system.
``` bash
# clone this repo
git clone https://git.lattuga.net/cisti/gancio.git
cd gancio
# install dependencies
$ yarn install
yarn install
# edit configuration
cp config.example.js config.js
# - migrate/create test sqlite db
yarn migrate:dev
# testing with sqlite db
yarn dev
# - migrate/create production db
yarn migrate
# build for production and launch server
$ yarn build
$ yarn start
yarn build
yarn start
```
@ -27,8 +46,4 @@ For detailed explanation on how things work, checkout [Nuxt.js docs](https://nux
``` bash
$ yarn dev
```
#### Add a new icon
plugin/vue-awesome.js
```

View file

@ -51,9 +51,8 @@ const SHARED_CONF = {
locale: 'it',
title: 'GANCIO',
description: 'A calendar for radical communities',
baseurl: env === 'development' ? 'http://localhost:3000': 'https://gancio.example.com',
baseurl: '' || 'http://localhost:3000',
env
}
module.exports = { SHARED_CONF, SECRET_CONF }
module.exports = { SHARED_CONF, SECRET_CONF, ...SECRET_CONF.db }

View file

@ -1,5 +1,6 @@
{
"registration_email": "registration_email",
"recover_email": "recover_email",
"press here": "press here"
"press here": "press here",
"register.request": "register.request"
}

View file

@ -1,5 +1,6 @@
{
"registration_email": "registration_email",
"recover_email": "recover_email",
"press here": "press here"
"press here": "press here",
"register.request": "register.request"
}

View file

@ -1,5 +1,6 @@
{
"registration_email": "registration_email",
"recover_email": "recover_email",
"press here": "press here"
"press here": "press here",
"register.request": "register.request"
}

View file

@ -1,5 +1,6 @@
{
"registration_email": "registration_email",
"recover_email": "recover_email",
"press here": "press here"
"press here": "press here",
"register.request": "register.request"
}

View file

@ -39,7 +39,9 @@ const it = {
related: 'Memoria storica',
add: 'Aggiungi',
logout_ok: 'Uscita correttamente',
copy: 'Copia'
copy: 'Copia',
recover_password: 'Recupera password',
new_password: 'Nuova password'
},
login: {
@ -77,7 +79,10 @@ const it = {
carne e sangue, scrivici quindi due righe per farci capire che eventi vorresti pubblicare.`,
error: 'Errore: ',
admin_complete: 'Sei il primo utente e quindi sei amministratore!',
complete: 'Confermeremo la registrazione quanto prima.'
complete: 'Confermeremo la registrazione quanto prima.',
request: 'Richiesta di registrazione',
registration_email: `Ciao,
ci è arrivata una richiesta di registrazione su gancio, la confermeremo quanto prima.`
},
event: {

View file

@ -9,7 +9,9 @@
"start": "cross-env NODE_ENV=production node server/index.js",
"generate": "nuxt generate",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
"precommit": "npm run lint"
"precommit": "npm run lint",
"migrate:dev": "sequelize db:migrate",
"migrate": "NODE_ENV=production sequelize db:migrate"
},
"bin": {
"gancio": "server/index.js"

View file

@ -1,9 +1,5 @@
<template lang="pug">
el-card#eventDetail(
visible hide-header
no-header :show-close='false'
top='0vh !important'
:appendToBody='true')
el-card#eventDetail
//- close button
nuxt-link.float-right(to='/')

View file

@ -1,7 +1,9 @@
<template lang="pug">
el-dialog(visible)
template(slot='title')
h5 <img src='/favicon.ico'/> {{$t('common.recover_password')}}
el-card
nuxt-link.float-right(to='/')
el-button(circle icon='el-icon-close' type='danger' size='small' plain)
h5 <img src='/favicon.ico'/> {{$t('common.recover_password')}}
div(v-if='valid')
el-form
el-form-item {{$t('common.new_password')}}

View file

@ -8,6 +8,7 @@ const mail = {
send(addresses, template, locals) {
const email = new Email({
views: { root: path.join(__dirname, '..', 'emails') },
htmlToText: false,
juice: true,
juiceResources: {
preserveImportant: true,
@ -25,7 +26,7 @@ const mail = {
},
transport: config.SECRET_CONF.smtp
})
return email.send({
const msg = {
template,
message: {
to: addresses,
@ -37,7 +38,11 @@ const mail = {
config: config.SHARED_CONF,
datetime: datetime => moment(datetime).format('ddd, D MMMM HH:mm')
}
})
}
return email.send(msg)
.catch(e => {
console.error(e)
})
}
}

View file

@ -5,7 +5,7 @@ module.exports = (sequelize, DataTypes) => {
const user = sequelize.define('user', {
email: {
type: DataTypes.STRING,
unique: { msg: 'err.register_error' },
unique: true,
index: true,
allowNull: false
},
@ -16,7 +16,7 @@ module.exports = (sequelize, DataTypes) => {
is_active: DataTypes.BOOLEAN
}, {
defaultScope: {
exclude: ['password', 'recover_code']
attributes: { exclude: ['password', 'recover_code'] }
}
})

View file

@ -1,3 +1,3 @@
p= t('recover_email')
p= t('mail.recover')
<a href="#{config.baseurl}/recover/#{user.recover_code}">#{t('press here')}</a>

View file

@ -1 +1 @@
= `[Gancio] Richiesta registrazione`
| [Gancio] #{t('register.request')}

View file

@ -0,0 +1 @@
| dioicane ciao

View file

@ -10,7 +10,7 @@ module.exports = {
},
email: {
type: Sequelize.STRING,
unique: { msg: 'err.register_error' },
unique: true,
index: true,
allowNull: false
},