.
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,6 +1,6 @@
|
|||||||
# Created by .ignore support plugin (hsz.mobi)
|
# Created by .ignore support plugin (hsz.mobi)
|
||||||
### Gancio production configuration
|
### Gancio production configuration
|
||||||
server/config.js
|
config.js
|
||||||
|
|
||||||
### Node template
|
### Node template
|
||||||
# Logs
|
# Logs
|
||||||
|
|||||||
31
README.md
31
README.md
@@ -6,13 +6,32 @@
|
|||||||
|
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
You will need `npm` or `yarn` installed in your system.
|
||||||
|
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
|
# clone this repo
|
||||||
|
git clone https://git.lattuga.net/cisti/gancio.git
|
||||||
|
cd gancio
|
||||||
|
|
||||||
# install dependencies
|
# 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
|
# build for production and launch server
|
||||||
$ yarn build
|
yarn build
|
||||||
$ yarn start
|
yarn start
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -27,8 +46,4 @@ For detailed explanation on how things work, checkout [Nuxt.js docs](https://nux
|
|||||||
``` bash
|
``` bash
|
||||||
$ yarn dev
|
$ yarn dev
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Add a new icon
|
|
||||||
|
|
||||||
plugin/vue-awesome.js
|
|
||||||
@@ -51,9 +51,8 @@ const SHARED_CONF = {
|
|||||||
locale: 'it',
|
locale: 'it',
|
||||||
title: 'GANCIO',
|
title: 'GANCIO',
|
||||||
description: 'A calendar for radical communities',
|
description: 'A calendar for radical communities',
|
||||||
|
baseurl: '' || 'http://localhost:3000',
|
||||||
baseurl: env === 'development' ? 'http://localhost:3000': 'https://gancio.example.com',
|
|
||||||
env
|
env
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = { SHARED_CONF, SECRET_CONF }
|
module.exports = { SHARED_CONF, SECRET_CONF, ...SECRET_CONF.db }
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"registration_email": "registration_email",
|
"registration_email": "registration_email",
|
||||||
"recover_email": "recover_email",
|
"recover_email": "recover_email",
|
||||||
"press here": "press here"
|
"press here": "press here",
|
||||||
|
"register.request": "register.request"
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"registration_email": "registration_email",
|
"registration_email": "registration_email",
|
||||||
"recover_email": "recover_email",
|
"recover_email": "recover_email",
|
||||||
"press here": "press here"
|
"press here": "press here",
|
||||||
|
"register.request": "register.request"
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"registration_email": "registration_email",
|
"registration_email": "registration_email",
|
||||||
"recover_email": "recover_email",
|
"recover_email": "recover_email",
|
||||||
"press here": "press here"
|
"press here": "press here",
|
||||||
|
"register.request": "register.request"
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"registration_email": "registration_email",
|
"registration_email": "registration_email",
|
||||||
"recover_email": "recover_email",
|
"recover_email": "recover_email",
|
||||||
"press here": "press here"
|
"press here": "press here",
|
||||||
|
"register.request": "register.request"
|
||||||
}
|
}
|
||||||
@@ -39,7 +39,9 @@ const it = {
|
|||||||
related: 'Memoria storica',
|
related: 'Memoria storica',
|
||||||
add: 'Aggiungi',
|
add: 'Aggiungi',
|
||||||
logout_ok: 'Uscita correttamente',
|
logout_ok: 'Uscita correttamente',
|
||||||
copy: 'Copia'
|
copy: 'Copia',
|
||||||
|
recover_password: 'Recupera password',
|
||||||
|
new_password: 'Nuova password'
|
||||||
},
|
},
|
||||||
|
|
||||||
login: {
|
login: {
|
||||||
@@ -77,7 +79,10 @@ const it = {
|
|||||||
carne e sangue, scrivici quindi due righe per farci capire che eventi vorresti pubblicare.`,
|
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!',
|
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: {
|
event: {
|
||||||
|
|||||||
@@ -9,7 +9,9 @@
|
|||||||
"start": "cross-env NODE_ENV=production node server/index.js",
|
"start": "cross-env NODE_ENV=production node server/index.js",
|
||||||
"generate": "nuxt generate",
|
"generate": "nuxt generate",
|
||||||
"lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
|
"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": {
|
"bin": {
|
||||||
"gancio": "server/index.js"
|
"gancio": "server/index.js"
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
el-card#eventDetail(
|
el-card#eventDetail
|
||||||
visible hide-header
|
|
||||||
no-header :show-close='false'
|
|
||||||
top='0vh !important'
|
|
||||||
:appendToBody='true')
|
|
||||||
|
|
||||||
//- close button
|
//- close button
|
||||||
nuxt-link.float-right(to='/')
|
nuxt-link.float-right(to='/')
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
el-dialog(visible)
|
el-card
|
||||||
template(slot='title')
|
nuxt-link.float-right(to='/')
|
||||||
h5 <img src='/favicon.ico'/> {{$t('common.recover_password')}}
|
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')
|
div(v-if='valid')
|
||||||
el-form
|
el-form
|
||||||
el-form-item {{$t('common.new_password')}}
|
el-form-item {{$t('common.new_password')}}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ const mail = {
|
|||||||
send(addresses, template, locals) {
|
send(addresses, template, locals) {
|
||||||
const email = new Email({
|
const email = new Email({
|
||||||
views: { root: path.join(__dirname, '..', 'emails') },
|
views: { root: path.join(__dirname, '..', 'emails') },
|
||||||
|
htmlToText: false,
|
||||||
juice: true,
|
juice: true,
|
||||||
juiceResources: {
|
juiceResources: {
|
||||||
preserveImportant: true,
|
preserveImportant: true,
|
||||||
@@ -25,7 +26,7 @@ const mail = {
|
|||||||
},
|
},
|
||||||
transport: config.SECRET_CONF.smtp
|
transport: config.SECRET_CONF.smtp
|
||||||
})
|
})
|
||||||
return email.send({
|
const msg = {
|
||||||
template,
|
template,
|
||||||
message: {
|
message: {
|
||||||
to: addresses,
|
to: addresses,
|
||||||
@@ -37,7 +38,11 @@ const mail = {
|
|||||||
config: config.SHARED_CONF,
|
config: config.SHARED_CONF,
|
||||||
datetime: datetime => moment(datetime).format('ddd, D MMMM HH:mm')
|
datetime: datetime => moment(datetime).format('ddd, D MMMM HH:mm')
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
return email.send(msg)
|
||||||
|
.catch(e => {
|
||||||
|
console.error(e)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ module.exports = (sequelize, DataTypes) => {
|
|||||||
const user = sequelize.define('user', {
|
const user = sequelize.define('user', {
|
||||||
email: {
|
email: {
|
||||||
type: DataTypes.STRING,
|
type: DataTypes.STRING,
|
||||||
unique: { msg: 'err.register_error' },
|
unique: true,
|
||||||
index: true,
|
index: true,
|
||||||
allowNull: false
|
allowNull: false
|
||||||
},
|
},
|
||||||
@@ -16,7 +16,7 @@ module.exports = (sequelize, DataTypes) => {
|
|||||||
is_active: DataTypes.BOOLEAN
|
is_active: DataTypes.BOOLEAN
|
||||||
}, {
|
}, {
|
||||||
defaultScope: {
|
defaultScope: {
|
||||||
exclude: ['password', 'recover_code']
|
attributes: { exclude: ['password', 'recover_code'] }
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
p= t('recover_email')
|
p= t('mail.recover')
|
||||||
|
|
||||||
<a href="#{config.baseurl}/recover/#{user.recover_code}">#{t('press here')}</a>
|
<a href="#{config.baseurl}/recover/#{user.recover_code}">#{t('press here')}</a>
|
||||||
@@ -1 +1 @@
|
|||||||
= `[Gancio] Richiesta registrazione`
|
| [Gancio] #{t('register.request')}
|
||||||
|
|||||||
1
server/emails/register/text.pug
Normal file
1
server/emails/register/text.pug
Normal file
@@ -0,0 +1 @@
|
|||||||
|
| dioicane ciao
|
||||||
@@ -10,7 +10,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
email: {
|
email: {
|
||||||
type: Sequelize.STRING,
|
type: Sequelize.STRING,
|
||||||
unique: { msg: 'err.register_error' },
|
unique: true,
|
||||||
index: true,
|
index: true,
|
||||||
allowNull: false
|
allowNull: false
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user