start with user favicon/locale personalization

This commit is contained in:
lesion 2019-07-24 11:49:02 +02:00
parent fec593bbbc
commit 96e0a0b57c
7 changed files with 74 additions and 34 deletions

View file

@ -8,28 +8,6 @@
"id": "23",
"references": [],
"title": "colori te prego!"
}
],
"in-progress": [],
"testing": [],
"todo": [
{
"assignedTo": {
"name": "lesion"
},
"creation_time": "2019-06-01T21:00:22.155Z",
"id": "28",
"references": [],
"title": "activitypub stream"
},
{
"assignedTo": {
"name": "lesion"
},
"creation_time": "2019-05-27T15:42:35.467Z",
"id": "21",
"references": [],
"title": "all'admin deve mostrare un badge se ci sono pending operation"
},
{
"assignedTo": {
@ -40,15 +18,6 @@
"references": [],
"title": "copy to clipboard"
},
{
"assignedTo": {
"name": "lesion"
},
"creation_time": "2019-05-29T13:08:20.887Z",
"id": "25",
"references": [],
"title": "creazione script di backup"
},
{
"assignedTo": {
"name": "lesion"
@ -93,6 +62,37 @@
"id": "29",
"references": [],
"title": "settings di istanza (default filter, eg, eventi ricorrenti)"
}
],
"in-progress": [],
"testing": [],
"todo": [
{
"assignedTo": {
"name": "lesion"
},
"creation_time": "2019-06-01T21:00:22.155Z",
"id": "28",
"references": [],
"title": "activitypub stream"
},
{
"assignedTo": {
"name": "lesion"
},
"creation_time": "2019-05-27T15:42:35.467Z",
"id": "21",
"references": [],
"title": "all'admin deve mostrare un badge se ci sono pending operation"
},
{
"assignedTo": {
"name": "lesion"
},
"creation_time": "2019-05-29T13:08:20.887Z",
"id": "25",
"references": [],
"title": "creazione script di backup"
},
{
"assignedTo": {

View file

@ -1,6 +1,7 @@
{
"title": "Gancio",
"description": "A shared agenda for local communities",
"favicon" : "../dist/favicon.ico",
"baseurl": "http://localhost:13120",
"server": {
"host": "localhost",

View file

@ -6,11 +6,23 @@ nav_order: 3
---
# Settings
Main `gancio` configuration is done with a configuration file.
This shoud be a `.json` or a `.js` file and could be specified using the `--config` flag.
- <small>eg. `gancio start --config ./config.json'</small>
- <small>eg. `pm2 start gancio start -- --config ~/config.json'</small>
Default configuration
{: .no_toc }
1. TOC
{:toc}
#### Title
####
## Default settings
```json
{
@ -26,6 +38,7 @@ nav_order: 3
"storage": "/tmp/db.sqlite"
},
"upload_path": "./",
"favicon": "../dist/favicon.ico",
"smtp": {
"auth": {
"user": "",

View file

@ -108,6 +108,18 @@
el-form-item(v-show='allow_recurrent_event' :label="$t('admin.recurrent_event_visible')")
el-switch(v-model='recurrent_event_visible')
el-divider {{$t('admin.personalization')}}
span {{$t('common.info')}}
el-input(type='textarea' v-model='about')
el-upload(action=''
:limit="1"
:auto-upload='false'
drag
accept='image/*'
:multiple='false')
el-divider {{$t('admin.federation')}}
el-form(inline @submit.native.prevent='associate_mastondon_instance' label-width='240px')
p {{$t('admin.mastodon_description')}}
@ -147,7 +159,8 @@ export default {
admin: false,
},
tab: "0",
open: true
open: true,
about: ''
}
},
async mounted () {

View file

@ -1,6 +1,7 @@
const Mastodon = require('mastodon-api')
const { setting: Setting } = require('../models')
const config = require('config')
const settingsController = {
settings: { initialized: false },
secretSettings: {},
@ -36,6 +37,14 @@ const settingsController = {
}
},
async getUserLocale(req, res) {
// console.error(res)
// load user locale specified in configuration
// res.json({ about: 'dentro user locale' })
// res.sendStatus(200)
return false
},
async setRequest(req, res) {
const { key, value, is_secret } = req.body
const ret = await settingsController.set(key, value, is_secret)

View file

@ -85,6 +85,8 @@ api.delete('/event/notification/:code', eventController.delNotification)
api.get('/settings', settingsController.getAllRequest)
api.post('/settings', jwt, fillUser, isAdmin, settingsController.setRequest)
api.get('/settings/user_locale', settingsController.getUserLocale)
// confirm event
api.get('/event/confirm/:event_id', jwt, isAuth, isAdmin, eventController.confirm)
api.get('/event/unconfirm/:event_id', jwt, isAuth, isAdmin, eventController.unconfirm)

View file

@ -23,7 +23,9 @@ async function start() {
await nuxt.ready()
}
app.use('/favicon.ico', express.static(path.resolve(__dirname, '../dist/favicon.ico')))
// configurable favicon && logo
app.use('/favicon.ico', express.static(path.resolve(config.favicon)))
app.use(morgan('dev'))
app.use('/media/', express.static(config.upload_path))
app.use('/api', require('./api/index'))
@ -31,7 +33,7 @@ async function start() {
// Give nuxt middleware to express
app.use(nuxt.render)
// Listen the server
// Listen
const server = app.listen(nuxt_config.server)
// close connections/port/unix socket