lot of fixes & cleaning
This commit is contained in:
@@ -9,8 +9,8 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^0.18.0",
|
"axios": "^0.18.0",
|
||||||
"bootstrap-vue": "^2.0.0-rc.11",
|
"bootstrap-vue": "^2.0.0-rc.13",
|
||||||
"element-ui": "^2.5.4",
|
"element-ui": "^2.6.0",
|
||||||
"mastodon-api": "^1.3.0",
|
"mastodon-api": "^1.3.0",
|
||||||
"moment": "^2.23.0",
|
"moment": "^2.23.0",
|
||||||
"node-sass": "^4.11.0",
|
"node-sass": "^4.11.0",
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ function put (path, data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function del (path) {
|
function del (path) {
|
||||||
console.log(store.state.token)
|
|
||||||
return api.delete(path, { headers: { 'x-access-token': store.state.token } }).then(ret => ret.data)
|
return api.delete(path, { headers: { 'x-access-token': store.state.token } }).then(ret => ret.data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,20 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
b-modal(hide-footer hide-header
|
b-modal(hide-footer hide-header
|
||||||
@hide='$router.go(-1)' size='lg' :visible='true')
|
@hide='$router.replace("/")' size='lg' :visible='true')
|
||||||
h4.text-center Admin
|
h4.text-center Admin
|
||||||
b-tabs(pills)
|
b-tabs(pills)
|
||||||
b-tab
|
|
||||||
|
b-tab.pt-1
|
||||||
template(slot='title')
|
template(slot='title')
|
||||||
v-icon(name='users')
|
v-icon(name='users')
|
||||||
span {{$t('Users')}}
|
span {{$t('Users')}}
|
||||||
b-table(:items='users' :fields='userFields' striped hover)
|
b-table(:items='users' :fields='userFields' striped small hover
|
||||||
|
:per-page='5' :current-page='userPage')
|
||||||
template(slot='action' slot-scope='data')
|
template(slot='action' slot-scope='data')
|
||||||
b-button.mr-1(:variant='data.item.is_active?"warning":"success"' @click='toggle(data.item)') {{data.item.is_active?$t('Deactivate'):$t('Activate')}}
|
b-button.mr-1(:variant='data.item.is_active?"warning":"success"' @click='toggle(data.item)') {{data.item.is_active?$t('Deactivate'):$t('Activate')}}
|
||||||
b-button(:variant='data.item.is_admin?"danger":"warning"' @click='toggleAdmin(data.item)') {{data.item.is_admin?$t('Remove Admin'):$t('Admin')}}
|
b-button(:variant='data.item.is_admin?"danger":"warning"' @click='toggleAdmin(data.item)') {{data.item.is_admin?$t('Remove Admin'):$t('Admin')}}
|
||||||
b-tab
|
b-pagination(:per-page='5' v-model='userPage' :total-rows='users.length')
|
||||||
|
b-tab.pt-1
|
||||||
template(slot='title')
|
template(slot='title')
|
||||||
v-icon(name='map-marker-alt')
|
v-icon(name='map-marker-alt')
|
||||||
span {{$t('Places')}}
|
span {{$t('Places')}}
|
||||||
@@ -29,12 +32,15 @@
|
|||||||
template(slot='title')
|
template(slot='title')
|
||||||
v-icon(name='tag')
|
v-icon(name='tag')
|
||||||
span {{$t('Tags')}}
|
span {{$t('Tags')}}
|
||||||
b-table(:items='tags' :fields='tagFields' striped hover)
|
p You can choose colors of your tags
|
||||||
|
b-table(:items='tags' :fields='tagFields'
|
||||||
|
striped small hover :per-page='10' :current-page='tagPage')
|
||||||
template(slot='tag' slot-scope='data')
|
template(slot='tag' slot-scope='data')
|
||||||
b-badge(:style='{backgroundColor: data.item.color}') {{data.item.tag}}
|
b-badge(:style='{backgroundColor: data.item.color}') {{data.item.tag}}
|
||||||
template(slot='color' slot-scope='data')
|
template(slot='color' slot-scope='data')
|
||||||
el-color-picker(v-model='data.item.color' @change='updateColor(data.item)')
|
el-color-picker(v-model='data.item.color' @change='updateColor(data.item)')
|
||||||
b-tab
|
b-pagination(:per-page='10' v-model='tagPage' :total-rows='tags.length')
|
||||||
|
b-tab.pt-1
|
||||||
template(slot='title')
|
template(slot='title')
|
||||||
v-icon(name='tools')
|
v-icon(name='tools')
|
||||||
span {{$t('Settings')}}
|
span {{$t('Settings')}}
|
||||||
@@ -51,8 +57,12 @@ export default {
|
|||||||
users: [],
|
users: [],
|
||||||
userFields: ['email', 'action'],
|
userFields: ['email', 'action'],
|
||||||
placeFields: ['name', 'address'],
|
placeFields: ['name', 'address'],
|
||||||
|
placePage: 1,
|
||||||
|
userPage: 1,
|
||||||
|
tagPage: 1,
|
||||||
tagFields: ['tag', 'color'],
|
tagFields: ['tag', 'color'],
|
||||||
description: '',
|
description: '',
|
||||||
|
place: {name: '', address: '' }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async mounted () {
|
async mounted () {
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const color = event.tags.length && event.tags[0].color ? event.tags[0].color : 'rgba(200,200,200,0.5)'
|
let color = event.tags.length && event.tags[0].color ? event.tags[0].color : 'rgba(200,200,200,0.5)'
|
||||||
|
if (event.past) color = 'rgba(200,200,200,0.5)'
|
||||||
if (event.multidate) {
|
if (event.multidate) {
|
||||||
e.dates = {
|
e.dates = {
|
||||||
start: event.start_datetime, end: event.end_datetime
|
start: event.start_datetime, end: event.end_datetime
|
||||||
@@ -60,18 +61,19 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
filteredEvents () {
|
filteredEvents () {
|
||||||
if (!this.filters.tags.length && !this.filters.places.length) return this.events
|
return this.$store.getters.filteredEvents
|
||||||
return this.events.filter(e => {
|
// if (!this.filters.tags.length && !this.filters.places.length) return this.events
|
||||||
if (this.filters.tags.length) {
|
// return this.events.filter(e => {
|
||||||
const m = intersection(e.tags.map(t => t.tag), this.filters.tags)
|
// if (this.filters.tags.length) {
|
||||||
if (m.length>0) return true
|
// const m = intersection(e.tags.map(t => t.tag), this.filters.tags)
|
||||||
}
|
// if (m.length>0) return true
|
||||||
if (this.filters.places.length) {
|
// }
|
||||||
if (this.filters.places.find(p => p === e.place.name))
|
// if (this.filters.places.length) {
|
||||||
return true
|
// if (this.filters.places.find(p => p === e.place.name))
|
||||||
}
|
// return true
|
||||||
return 0
|
// }
|
||||||
})
|
// return 0
|
||||||
|
// })
|
||||||
},
|
},
|
||||||
...mapState(['events', 'tags', 'filters']),
|
...mapState(['events', 'tags', 'filters']),
|
||||||
attributes () {
|
attributes () {
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
b-card(bg-variant='dark' text-variant='white'
|
b-card(bg-variant='dark' text-variant='white'
|
||||||
@click='$router.push("/event/" + event.id)'
|
@click='$router.push("/event/" + event.id)'
|
||||||
:img-src='imgPath')
|
:img-src='imgPath')
|
||||||
h5 {{event.title}}
|
strong {{event.title}}
|
||||||
div <v-icon name='clock'/> {{event.start_datetime|datetime}}
|
div <v-icon name='clock'/> {{event.start_datetime|datetime}}
|
||||||
span(v-b-popover.hover="event.place && event.place.address || ''") <v-icon name='map-marker-alt'/> {{event.place.name}}
|
span <v-icon name='map-marker-alt'/> {{event.place.name}}
|
||||||
br
|
br
|
||||||
b-badge(:style='{backgroundColor: tag.color}' v-for='tag in event.tags' href='#'
|
b-badge(:style='{backgroundColor: tag.color}' v-for='tag in event.tags' href='#'
|
||||||
@click.stop='addSearchTag(tag)') {{tag.tag}}
|
@click.stop='addSearchTag(tag)') {{tag.tag}}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
b-modal#eventDetail(hide-footer hide-header
|
b-modal#eventDetail(hide-footer hide-header
|
||||||
@hide='$router.go(-1)' size='lg' :visible='true')
|
@hide='$router.replace("/")' size='lg' :visible='true')
|
||||||
|
|
||||||
b-card(bg-variant='dark' href='#' text-variant='white'
|
b-card(bg-variant='dark' href='#' text-variant='white'
|
||||||
no-body, :img-src='imgPath')
|
no-body, :img-src='imgPath')
|
||||||
|
|||||||
@@ -13,24 +13,15 @@ import filters from '@/filters.js'
|
|||||||
import Event from '@/components/Event'
|
import Event from '@/components/Event'
|
||||||
import Calendar from '@/components/Calendar'
|
import Calendar from '@/components/Calendar'
|
||||||
import {intersection} from 'lodash'
|
import {intersection} from 'lodash'
|
||||||
|
import moment from 'moment'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Home',
|
name: 'Home',
|
||||||
components: { Event, Calendar },
|
components: { Event, Calendar },
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['events', 'filters']),
|
...mapState(['events', 'filters']),
|
||||||
filteredEvents () {
|
filteredEvents () {
|
||||||
if (!this.filters.tags.length && !this.filters.places.length) return this.events
|
return this.$store.getters.filteredEvents.filter(e => !e.past)
|
||||||
return this.events.filter(e => {
|
|
||||||
if (this.filters.tags.length) {
|
|
||||||
const m = intersection(e.tags.map(t => t.tag), this.filters.tags)
|
|
||||||
if (m.length>0) return true
|
|
||||||
}
|
|
||||||
if (this.filters.places.length) {
|
|
||||||
if (this.filters.places.find(p => p === e.place.name))
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template lang='pug'>
|
<template lang='pug'>
|
||||||
b-modal(hide-header hide-footer @shown="$refs.email.focus()"
|
b-modal(hide-header hide-footer @shown="$refs.email.focus()"
|
||||||
@hide='$router.go(-1)' :visible='true')
|
@hide='$router.replace("/")' :visible='true')
|
||||||
h4.text-center.center {{$t('Login')}}
|
h4.text-center.center {{$t('Login')}}
|
||||||
b-form
|
b-form
|
||||||
//- p.text-muted Sign In to your account
|
//- p.text-muted Sign In to your account
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template lang='pug'>
|
<template lang='pug'>
|
||||||
b-modal(hide-header hide-footer
|
b-modal(hide-header hide-footer
|
||||||
@hide='$router.go(-1)' :visible='true' @shown='$refs.email.focus()')
|
@hide='$router.replace("/")' :visible='true' @shown='$refs.email.focus()')
|
||||||
h4.text-center.center {{$t('Register')}}
|
h4.text-center.center {{$t('Register')}}
|
||||||
b-form
|
b-form
|
||||||
p.text-muted(v-html="$t('register_explanation')")
|
p.text-muted(v-html="$t('register_explanation')")
|
||||||
@@ -42,8 +42,6 @@ export default {
|
|||||||
async register () {
|
async register () {
|
||||||
try {
|
try {
|
||||||
const user = await api.register(this.user)
|
const user = await api.register(this.user)
|
||||||
// this.login(user)
|
|
||||||
// this.user = { name: '' }
|
|
||||||
this.$router.go(-1)
|
this.$router.go(-1)
|
||||||
this.$message({
|
this.$message({
|
||||||
message: this.$t('registration_complete'),
|
message: this.$t('registration_complete'),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
b-modal(hide-header hide-footer no-close-on-backdrop
|
b-modal(hide-header hide-footer no-close-on-backdrop
|
||||||
@hide='$router.go(-1)' no-close-on-esc size='lg' :visible='true')
|
@hide='$router.replace("/")' no-close-on-esc size='lg' :visible='true')
|
||||||
h4.text-center.center {{edit?$t('Edit event'):$t('New event')}}
|
h4.text-center.center {{edit?$t('Edit event'):$t('New event')}}
|
||||||
b-tabs#tabss(pills v-model='activeTab')
|
b-tabs#tabss(pills v-model='activeTab')
|
||||||
b-form
|
b-form
|
||||||
|
|||||||
@@ -18,16 +18,20 @@ const it = {
|
|||||||
tag_explanation: 'Puoi inserire un tag (es. concerto, corteo)',
|
tag_explanation: 'Puoi inserire un tag (es. concerto, corteo)',
|
||||||
export_intro: `Contrariamente alle piattaforme del capitalismo, che fanno di tutto per tenere
|
export_intro: `Contrariamente alle piattaforme del capitalismo, che fanno di tutto per tenere
|
||||||
i dati e gli utenti al loro interno, crediamo che le informazioni, come le persone,
|
i dati e gli utenti al loro interno, crediamo che le informazioni, come le persone,
|
||||||
debbano essere libere.`,
|
debbano essere libere. Per questo puoi rimanere aggiornata sugli eventi che vuoi, come meglio credi, senza necessariamente passare da qui.`,
|
||||||
export_feed_explanation: `Per seguire gli aggiornamenti da computer o smartphone senza la necessità di aprire periodicamente il sito, il metodo consigliato è quello dei Feed RSS.</p>
|
export_feed_explanation: `Per seguire gli aggiornamenti da computer o smartphone senza la necessità di aprire periodicamente il sito, il metodo consigliato è quello dei Feed RSS.</p>
|
||||||
|
|
||||||
<p>Con i feed rss utilizzi un'apposita applicazione per ricevere aggiornamenti dai siti che più ti interessano. È un buon metodo per seguire anche molti siti in modo molto rapido, senza necessità di creare un account o altre complicazioni.</p>
|
<p>Con i feed rss utilizzi un'apposita applicazione per ricevere aggiornamenti dai siti che più ti interessano. È un buon metodo per seguire anche molti siti in modo molto rapido, senza necessità di creare un account o altre complicazioni.</p>
|
||||||
|
|
||||||
<p>Se hai Android, ti consigliamo <a href="https://play.google.com/store/apps/details?id=net.frju.flym">Flym</a> o Feeder<br />
|
<li>Se hai Android, ti consigliamo <a href="https://play.google.com/store/apps/details?id=net.frju.flym">Flym</a> o Feeder</li>
|
||||||
Per iPhone/iPad puoi usare <a href="https://itunes.apple.com/ua/app/feeds4u/id1038456442?mt=8">Feed4U</a><br />
|
<li>Per iPhone/iPad puoi usare <a href="https://itunes.apple.com/ua/app/feeds4u/id1038456442?mt=8">Feed4U</a></li>
|
||||||
Per il computer fisso/portatile consigliamo Feedbro, da installare all'interno <a href="https://addons.mozilla.org/en-GB/firefox/addon/feedbroreader/">di Firefox </a>o <a href="https://chrome.google.com/webstore/detail/feedbro/mefgmmbdailogpfhfblcnnjfmnpnmdfa">di Chrome</a> e compatibile con tutti i principali sistemi operativi.</p>
|
<li>Per il computer fisso/portatile consigliamo Feedbro, da installare all'interno <a href="https://addons.mozilla.org/en-GB/firefox/addon/feedbroreader/">di Firefox </a>o <a href="https://chrome.google.com/webstore/detail/feedbro/mefgmmbdailogpfhfblcnnjfmnpnmdfa">di Chrome</a> e compatibile con tutti i principali sistemi operativi.</li>
|
||||||
|
<br/>
|
||||||
Aggiungendo il link sopra, rimarrai aggiornata sui seguenti eventi:`,
|
Aggiungendo questo link al tuo lettore di feed, rimarrai aggiornata.`,
|
||||||
|
export_email_explanation: `Puoi ricevere via mail gli eventi che ti interessano [WIP]`,
|
||||||
|
export_list_explanation: `Se hai un sito web e vuoi mostrare una lista di eventi, puoi usare il seguente codice [WIP]`,
|
||||||
|
export_calendar_explanation: `Se hai un sito web e vuoi mostrare un calendario di eventi, puoi usare il seguente codice [WIP]`,
|
||||||
|
export_ical_explanation: `I computer e gli smartphone sono comunemente attrezzati con un'applicazione per gestire un calendario. A questi programmi solitamente è possibile far importare un calendario remoto.`,
|
||||||
Poster: 'Locandina',
|
Poster: 'Locandina',
|
||||||
Settings: 'Impostazioni',
|
Settings: 'Impostazioni',
|
||||||
Search: 'Cerca',
|
Search: 'Cerca',
|
||||||
@@ -47,12 +51,19 @@ const it = {
|
|||||||
Users: 'Utenti',
|
Users: 'Utenti',
|
||||||
Places: 'Luoghi',
|
Places: 'Luoghi',
|
||||||
Tags: 'Etichette',
|
Tags: 'Etichette',
|
||||||
|
Name: 'Nome',
|
||||||
|
Save: 'Salva',
|
||||||
|
Address: 'Indirizzo',
|
||||||
Remove: 'Elimina',
|
Remove: 'Elimina',
|
||||||
Edit: 'Modifica',
|
Edit: 'Modifica',
|
||||||
Admin: 'Amministra',
|
Admin: 'Amministra',
|
||||||
Today: 'Oggi',
|
Today: 'Oggi',
|
||||||
|
Export: 'Esporta',
|
||||||
|
send_reminder: 'Ricordamelo il giorno prima',
|
||||||
|
notify_on_insert: `Notifica all'inserimento`,
|
||||||
'Edit event': 'Modifica evento',
|
'Edit event': 'Modifica evento',
|
||||||
'New event': 'Nuovo evento',
|
'New event': 'Nuovo evento',
|
||||||
|
'Insert your address': 'Inserisci il tuo indirizzo',
|
||||||
registration_complete: 'Controlla la tua posta (anche la cartella spam)',
|
registration_complete: 'Controlla la tua posta (anche la cartella spam)',
|
||||||
registration_email: `Ciao, la tua registrazione sarà confermata nei prossimi giorni. Riceverai una conferma non temere.`,
|
registration_email: `Ciao, la tua registrazione sarà confermata nei prossimi giorni. Riceverai una conferma non temere.`,
|
||||||
register_explanation: `I movimenti hanno bisogno di organizzarsi e autofinanziarsi. <br/>Questo è un dono per voi, non possiamo più vedervi usare le piattaforme del capitalismo. Solo eventi non commerciali e ovviamente antifascisti, antisessisti, antirazzisti.
|
register_explanation: `I movimenti hanno bisogno di organizzarsi e autofinanziarsi. <br/>Questo è un dono per voi, non possiamo più vedervi usare le piattaforme del capitalismo. Solo eventi non commerciali e ovviamente antifascisti, antisessisti, antirazzisti.
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export default new Router({
|
|||||||
props: { edit: true }
|
props: { edit: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/export/:type',
|
path: '/export',
|
||||||
components: { modal: Export }
|
components: { modal: Export }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import Vuex from 'vuex'
|
import Vuex from 'vuex'
|
||||||
import VuexPersistence from 'vuex-persist'
|
import VuexPersistence from 'vuex-persist'
|
||||||
|
import { intersection } from 'lodash'
|
||||||
import api from './api'
|
import api from './api'
|
||||||
|
import moment from 'moment'
|
||||||
Vue.use(Vuex)
|
Vue.use(Vuex)
|
||||||
|
|
||||||
const vuexLocal = new VuexPersistence({
|
const vuexLocal = new VuexPersistence({
|
||||||
@@ -12,7 +14,29 @@ const vuexLocal = new VuexPersistence({
|
|||||||
export default new Vuex.Store({
|
export default new Vuex.Store({
|
||||||
plugins: [vuexLocal.plugin],
|
plugins: [vuexLocal.plugin],
|
||||||
getters: {
|
getters: {
|
||||||
token: state => state.token
|
token: state => state.token,
|
||||||
|
filteredEvents: state => {
|
||||||
|
const events = state.events.map(e => {
|
||||||
|
const past = (moment().diff(e.start_datetime, 'minutes') > 0)
|
||||||
|
e.past = past
|
||||||
|
return e
|
||||||
|
})
|
||||||
|
if (!state.filters.tags.length && !state.filters.places.length) {
|
||||||
|
return events
|
||||||
|
}
|
||||||
|
return events.filter(e => {
|
||||||
|
if (state.filters.tags.length) {
|
||||||
|
const m = intersection(e.tags.map(t => t.tag), state.filters.tags)
|
||||||
|
if (m.length > 0) return true
|
||||||
|
}
|
||||||
|
if (state.filters.places.length) {
|
||||||
|
if (state.filters.places.find(p => p === e.place.name)) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
state: {
|
state: {
|
||||||
logged: false,
|
logged: false,
|
||||||
|
|||||||
@@ -9,6 +9,11 @@
|
|||||||
"apiurl": "https://example.com/api",
|
"apiurl": "https://example.com/api",
|
||||||
|
|
||||||
"db": {
|
"db": {
|
||||||
|
"dialect": "postgres",
|
||||||
|
"host": "localhost",
|
||||||
|
"database": "gancio",
|
||||||
|
"user": "user",
|
||||||
|
"password": "password"
|
||||||
},
|
},
|
||||||
"admin": "admin@example.com",
|
"admin": "admin@example.com",
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ rss(version='2.0', xmlns:atom='<a href="http://www.w3.org/2005/Atom" rel="nofoll
|
|||||||
each event in events
|
each event in events
|
||||||
item
|
item
|
||||||
title= event.title
|
title= event.title
|
||||||
link <a href=#{config.baseurl}/event/#{event.id}" rel="nofollow">#{config.baseurl}/event/#{event.id}</a>
|
link <a href="#{config.baseurl}/event/#{event.id}" rel="nofollow">#{config.baseurl}/event/#{event.id}</a>
|
||||||
description
|
description
|
||||||
| <![CDATA[
|
| <![CDATA[
|
||||||
| <h4>#{event.title}</h4>
|
| <h4>#{event.title}</h4>
|
||||||
|
|||||||
Reference in New Issue
Block a user