diff --git a/.vscode/vscode-kanban.json b/.vscode/vscode-kanban.json
index 47a6e887..9d48a542 100644
--- a/.vscode/vscode-kanban.json
+++ b/.vscode/vscode-kanban.json
@@ -1,6 +1,39 @@
{
- "done": [],
- "in-progress": [],
+ "done": [
+ {
+ "assignedTo": {
+ "name": "lesion"
+ },
+ "category": "feature",
+ "creation_time": "2019-04-23T19:50:00.973Z",
+ "description": {
+ "content": "- export page ok\n- usare un'altra api per retrieve di eventi (perche' devo mostrarli tutti, non solo quelli del mese corrente)\n- non devo fare il load degli eventi nel nuxtServerInit (o dentro il layout normale oppure nelle pagine, tipo nella home)",
+ "mime": "text/markdown"
+ },
+ "details": {
+ "content": "- export page ok\n- usare un'altra api per retrieve di eventi (perche' devo mostrarli tutti, non solo quelli del mese corrente)\n- non devo fare il load degli eventi nel nuxtServerInit (o dentro il layout normale oppure nelle pagine, tipo nella home)\n",
+ "mime": "text/markdown"
+ },
+ "id": "7",
+ "prio": 1,
+ "references": [],
+ "title": "export page",
+ "type": "bug"
+ }
+ ],
+ "in-progress": [
+ {
+ "assignedTo": {
+ "name": "lesion"
+ },
+ "category": "feature",
+ "creation_time": "2019-04-23T19:46:46.332Z",
+ "id": "3",
+ "prio": 0,
+ "references": [],
+ "title": "export lista"
+ }
+ ],
"testing": [
{
"assignedTo": {
@@ -15,18 +48,6 @@
}
],
"todo": [
- {
- "assignedTo": {
- "name": "lesion"
- },
- "category": "feature",
- "creation_time": "2019-04-23T19:50:00.973Z",
- "id": "7",
- "prio": 1,
- "references": [],
- "title": "export page",
- "type": "bug"
- },
{
"assignedTo": {
"name": "lesion"
@@ -99,21 +120,19 @@
"name": "lesion"
},
"category": "feature",
- "creation_time": "2019-04-23T19:46:46.332Z",
- "id": "3",
- "prio": 0,
+ "creation_time": "2019-04-23T19:44:56.705Z",
+ "id": "1",
"references": [],
- "title": "export lista"
+ "title": "popup sul calendario"
},
{
"assignedTo": {
"name": "lesion"
},
- "category": "feature",
- "creation_time": "2019-04-23T19:44:56.705Z",
- "id": "1",
+ "creation_time": "2019-04-27T19:44:33.769Z",
+ "id": "12",
"references": [],
- "title": "popup sul calendario"
+ "title": "rifare il calendario o solo il popup"
},
{
"assignedTo": {
@@ -137,6 +156,15 @@
"references": [],
"title": "documentare sorgenti",
"type": "bug"
+ },
+ {
+ "assignedTo": {
+ "name": "lesion"
+ },
+ "creation_time": "2019-04-28T09:25:50.701Z",
+ "id": "13",
+ "references": [],
+ "title": "test altra visualizzazione"
}
]
}
\ No newline at end of file
diff --git a/components/Calendar.vue b/components/Calendar.vue
index 7787d5f4..d3c06ff1 100644
--- a/components/Calendar.vue
+++ b/components/Calendar.vue
@@ -1,15 +1,24 @@
v-calendar#calendar.card(
+ title-position='left'
+ locale='it'
+ is-dark
show-caps
:attributes='attributes'
:from-page.sync='page'
is-expanded is-inline)
- //- div(slot='popover', slot-scope='{ customData }')
- //- router-link(:to="`/event/${customData.id}`") {{customData.start_datetime|hour}} - {{customData.title}} @{{customData.place.name}}
+ div(slot='popover', slot-scope='{ customData, attributes }')
+ p {{attributes}}
+ //- router-link(:to="`/event/${customData.id}`") {{customData.start_datetime|hour}} - {{customData.title}}
+ //- div(v-if='customData.days && customData.days[selectedEvent]')
+ p {{customData.days[customData.selectedEvent].title}}
+ p {{customData.days[customData.selectedEvent].tags}}
+ el-button(@click='customData.selectedEvent=customData.selectedEvent+1') {{customData.selectedEvent}}/{{customData.days.length}}
+ v-icon(name='clock' @click='customData.selectedEvent=customData.selectedEvent+1')
+ //- @{{customData.place.name}}
\ No newline at end of file
diff --git a/components/Nav.vue b/components/Nav.vue
index 67a682e2..d10cf8c7 100644
--- a/components/Nav.vue
+++ b/components/Nav.vue
@@ -10,12 +10,13 @@
span.d-md-none {{$t('common.add_event')}}
b-nav-item(v-if='$auth.loggedIn' to='/settings' v-b-tooltip :title='$t("common.settings")')
span.d-md-none {{$t('common.settings')}}
- b-nav-item(v-if='$auth.hasScope(`admin`)' to='/admin' v-b-tooltip :title='$t("common.admin")')
+ b-nav-item(v-if='$auth.user.is_admin' to='/admin' v-b-tooltip :title='$t("common.admin")')
span.d-md-none {{$t('common.admin')}}
b-nav-item(to='/export' v-b-tooltip :title='$t("common.export")')
span.d-md-none {{$t('common.export')}}
- b-nav-item(v-if='auth.loggedIn' @click='logout' v-b-tooltip :title='$t("common.logout")')
+ b-nav-item(v-if='$auth.loggedIn' @click='logout' v-b-tooltip :title='$t("common.logout")')
span.d-md-none {{$t('common.logout')}}
+ b-nav-item
b-navbar-nav.ml-auto
b-nav-item(to='/about')
span {{$t('common.info')}}
@@ -26,7 +27,7 @@ import {mapState, mapActions} from 'vuex'
export default {
name: 'Nav',
computed: {
- ...mapState(['filters', 'auth']),
+ ...mapState(['filters']),
filters_tags: {
set (value) {
this.setSearchTags(value)
diff --git a/layouts/iframe.vue b/layouts/iframe.vue
new file mode 100644
index 00000000..858c52d1
--- /dev/null
+++ b/layouts/iframe.vue
@@ -0,0 +1,3 @@
+
+ nuxt
+
diff --git a/locales/it.json b/locales/it.json
index efa952cb..6f37cec2 100644
--- a/locales/it.json
+++ b/locales/it.json
@@ -17,7 +17,25 @@
"next": "Avanti",
"what": "Cosa",
"address": "Indirizzo",
- "media": "Media"
+ "media": "Media",
+ "today": "Oggi",
+ "users": "Utenti",
+ "places": "Posti",
+ "events": "Eventi",
+ "tags": "Etichette",
+ "deactivate": "Disattiva",
+ "activate": "Attiva",
+ "remove_admin": "Rimuovi Admin",
+ "name": "Nome",
+ "save": "Salva",
+ "confirm": "Conferma",
+ "tag": "Etichetta",
+ "color": "Colore",
+ "associate": "Associa",
+ "hide": "Nascondi",
+ "remove": "Elimina",
+ "edit": "Modifica",
+ "actions": "Azioni"
},
"login": {
@@ -41,6 +59,14 @@
"where_description" : "Dov'è il gancio? Se è un luogo fisico, scrivi il suo nome del per esteso (tipo 'Mezcal Squat'), se è una Piazza/Via metti quella (tipo 'Piazza Castello, Torino'). Se trovi già il luogo dell'evento premilo e l'indirizzo verrà autocompletato.",
"address_description": "",
"tag_description": "Puoi inserire un tag (es. concerto, corteo)"
+ },
+
+ "admin": {
+ "event_confirm_description": "Qui puoi confermare gli eventi inseriti da utenti non iscritti",
+ "tag_description": "Cambia il colore delle etichette",
+ "place_description": "Modifica l'indirizzo di un posto",
+ "mastodon_description": "Puoi associare un account mastodon a questa istanza di gancio. Tutti gli eventi verranno pubblicati li'",
+ "mastodon_instance": "Istanza mastodon"
}
}
diff --git a/nuxt.config.js b/nuxt.config.js
index 29c34492..30bdf1da 100644
--- a/nuxt.config.js
+++ b/nuxt.config.js
@@ -41,8 +41,8 @@ module.exports = {
plugins: ['@/plugins/element-ui', '@/plugins/filters',
'@/plugins/i18n', '@/plugins/bootstrap-vue',
'@/plugins/vue-awesome',
- '@/plugins/v-calendar',
- { src: '@/plugins/vuex-persist', ssr: false },
+ { src: '@/plugins/v-calendar', ssr: false },
+ { src: '@/plugins/vuex-persist.js', ssr: false },
'@/plugins/magic-grid'],
/*
@@ -68,7 +68,7 @@ module.exports = {
endpoints: {
login: { url: '/auth/login', method: 'post', propertyName: 'token' },
logout: { url: '/auth/logout', method: 'post' },
- user: { url: '/auth/user', method: 'get', propertyName: 'user' }
+ user: { url: '/auth/user', method: 'get', propertyName: false }
},
// tokenRequired: true,
// tokenType: 'bearer',
diff --git a/package.json b/package.json
index ecb78137..73aa6086 100644
--- a/package.json
+++ b/package.json
@@ -40,6 +40,7 @@
"sqlite3": "^4.0.6",
"v-calendar": "^0.9.7",
"vue-awesome": "^3.5.1",
+ "vue-custom-element": "^3.2.6",
"vue-i18n": "^8.10.0",
"vue-magic-grid": "^0.0.4",
"vuex-persist": "^2.0.0"
@@ -61,6 +62,7 @@
"eslint-plugin-vue": "^5.2.2",
"nodemon": "^1.18.9",
"prettier": "^1.16.4",
- "pug-plain-loader": "^1.0.0"
+ "pug-plain-loader": "^1.0.0",
+ "webpack-cli": "^3.3.1"
}
}
diff --git a/pages/add.vue b/pages/add/_edit.vue
similarity index 94%
rename from pages/add.vue
rename to pages/add/_edit.vue
index ae5c2ac1..f9a8ae44 100644
--- a/pages/add.vue
+++ b/pages/add/_edit.vue
@@ -5,7 +5,7 @@
el-tabs.mb-2(v-model='activeTab' v-loading='sending')
//- NOT LOGGED EVENT
- el-tab-pane(v-if='!logged')
+ el-tab-pane(v-if='!$auth.loggedIn')
span(slot='label') {{$t('event.anon')}}
p(v-html="$t('event.anon_description')")
el-button.float-right(@click='next' :disabled='!couldProceed') {{$t('common.next')}}
@@ -13,7 +13,14 @@
//- WHERE
el-tab-pane
span(slot='label') {{$t('common.where')}}
- div {{$t('common.where')}}
+ div {{$t('common.where')}}
+ el-popover(
+ placement="top-start"
+ width="400"
+ trigger="hover")
+ v-icon(slot='reference' color='#ff9fc4' name='question-circle')
+ slot
+ p {{$t('event.where_description')}}
el-select.mb-3(v-model='event.place.name' @change='placeChoosed' filterable allow-create default-first-option)
el-option(v-for='place in places_name' :label='place' :value='place' :key='place.id')
div {{$t("common.address")}}
@@ -119,7 +126,6 @@ export default {
places_name: state => state.places.map(p => p.name ),
places: state => state.places,
user: state => state.user,
- logged: state => state.logged
}),
disableAddress () {
console.log('dentro disable Address')
@@ -128,7 +134,7 @@ export default {
return ret
},
couldProceed () {
- const t = this.logged ? -1 : 0
+ const t = this.$auth.loggedIn ? -1 : 0
switch(Number(this.activeTab)) {
case 0+t:
return true
@@ -209,7 +215,7 @@ export default {
this.updateMeta()
this.sending = false
this.$refs.modal.hide()
- Message({ type: 'success', message: this.logged ? this.$t('event.added') : this.$t('event.added_anon')})
+ Message({ type: 'success', message: this.$auth.loggedIn ? this.$t('event.added') : this.$t('event.added_anon')})
} catch (e) {
this.sending = false
console.error(e)
diff --git a/pages/admin.vue b/pages/admin.vue
index 0b83f1a1..edc22def 100644
--- a/pages/admin.vue
+++ b/pages/admin.vue
@@ -1,5 +1,5 @@
- b-modal(hide-footer @hidden='$router.replace("/")' :title='$t("Admin")'
+ b-modal(hide-footer @hidden='$router.replace("/")' :title='$t("common.admin")'
:visible='true' size='lg')
el-tabs(tabPosition='left' v-model='tab')
@@ -7,55 +7,56 @@
el-tab-pane.pt-1
template(slot='label')
v-icon(name='users')
- span.ml-1 {{$t('Users')}}
+ span.ml-1 {{$t('common.users')}}
el-table(:data='paginatedUsers' small)
el-table-column(label='Email')
template(slot-scope='data')
el-popover(trigger='hover' :content='data.row.description' width='400')
span(slot='reference') {{data.row.email}}
- el-table-column(label='Azioni')
+ el-table-column(:label="$t('common.actions')")
template(slot-scope='data')
el-button.mr-1(size='mini'
:type='data.row.is_active?"warning":"success"'
- @click='toggle(data.row)') {{data.row.is_active?$t('Deactivate'):$t('Activate')}}
+ @click='toggle(data.row)') {{data.row.is_active?$t('common.deactivate'):$t('common.activate')}}
el-button(size='mini'
:type='data.row.is_admin?"danger":"warning"'
- @click='toggleAdmin(data.row)') {{data.row.is_admin?$t('Remove Admin'):$t('Admin')}}
+ @click='toggleAdmin(data.row)') {{data.row.is_admin?$t('common.remove_admin'):$t('common.admin')}}
el-pagination(:page-size='perPage' :currentPage.sync='userPage' :total='users.length')
//- PLACES
el-tab-pane.pt-1
template(slot='label')
v-icon(name='map-marker-alt')
- span.ml-1 {{$t('Places')}}
- p {{$t('admin_place_explanation')}}
+ span.ml-1 {{$t('common.places')}}
+ p {{$t('admin.place_description')}}
el-form.mb-2(:inline='true' label-width='120px')
- el-form-item(:label="$t('Name')")
- el-input.mr-1(:placeholder='$t("Name")' v-model='place.name')
- el-form-item(:label="$t('Address')")
- el-input.mr-1(:placeholder='$t("Address")' v-model='place.address')
- el-button(variant='primary' @click='savePlace') {{$t('Save')}}
- b-table(selectable :items='places' :fields='placeFields' striped hover
- small selectedVariant='success' primary-key='id'
- select-mode="single" @row-selected='placeSelected'
- :per-page='perPage' :current-page='placePage')
+ el-form-item(:label="$t('common.name')")
+ el-input.mr-1(:placeholder='$t("common.name")' v-model='place.name')
+ el-form-item(:label="$t('common.address')")
+ el-input.mr-1(:placeholder='$t("common.address")' v-model='place.address')
+ el-button(variant='primary' @click='savePlace') {{$t('common.save')}}
+ el-table(:data='paginatedPlaces' small)
+ el-table-column(:label="$t('common.name')")
+ template(slot-scope='data') {{data.row.name}}
+ el-table-column(:label="$t('common.address')")
+ template(slot-scope='data') {{data.row.address}}
el-pagination(:page-size='perPage' :currentPage.sync='placePage' :total='places.length')
//- EVENTS
el-tab-pane.pt-1
template(slot='label')
v-icon(name='calendar')
- span.ml-1 {{$t('Events')}}
- p {{$t('event_confirm_explanation')}}
+ span.ml-1 {{$t('common.events')}}
+ p {{$t('admin.event_confirm_description')}}
el-table(:data='paginatedEvents' small primary-key='id' v-loading='loading')
- el-table-column(:label='$t("Name")')
+ el-table-column(:label='$t("common.name")')
template(slot-scope='data') {{data.row.title}}
- el-table-column(:label='$t("Where")')
+ el-table-column(:label='$t("common.where")')
template(slot-scope='data') {{data.row.place.name}}
- el-table-column(:label='$t("Confirm")')
+ el-table-column(:label='$t("common.confirm")')
template(slot-scope='data')
- el-button(type='primary' @click='confirm(data.row.id)' size='mini') {{$t('Confirm')}}
- el-button(type='success' @click='preview(data.row.id)' size='mini') {{$t('Preview')}}
+ el-button(type='primary' @click='confirm(data.row.id)' size='mini') {{$t('common.confirm')}}
+ el-button(type='success' @click='preview(data.row.id)' size='mini') {{$t('common.preview')}}
el-pagination(:page-size='perPage' :currentPage.sync='eventPage' :total='events.length')
@@ -63,29 +64,29 @@
el-tab-pane.pt-1
template(slot='label')
v-icon(name='tag')
- span {{$t('Tags')}}
- p {{$t('admin_tag_explanation')}}
- el-tag(v-if='tag.tag' :color='tag.color || "grey"' size='mini') {{tag.tag}}
+ span {{$t('common.tags')}}
+ p {{$t('admin.tag_description')}}
+ el-tag(v-if='tag.tag' :color='tag.color' size='mini') {{tag.tag}}
el-form(:inline='true' label-width='120px')
- el-form-item(:label="$t('Color')")
+ el-form-item(:label="$t('common.color')")
el-color-picker(v-model='tag.color' @change='updateColor')
el-table(:data='paginatedTags' striped small hover
highlight-current-row @current-change="tagSelected")
- el-table-column(label='Tag')
+ el-table-column(:label="$t('common.tag')")
template(slot-scope='data')
- el-tag(:color='data.row.color || "grey"' size='mini') {{data.row.tag}}
+ el-tag(:color='data.row.color' size='mini') {{data.row.tag}}
el-pagination(:page-size='perPage' :currentPage.sync='tagPage' :total='tags.length')
//- SETTINGS
el-tab-pane.pt-1
template(slot='label')
v-icon(name='tools')
- span {{$t('Settings')}}
- el-form(inline)
- span {{$t('admin_mastodon_explanation')}}
+ span {{$t('common.settings')}}
+ el-form(inline @submit.prevent.stop='associatemastodon_instance')
+ span {{$t('admin.mastodon_description')}}
el-input(v-model="mastodon_instance")
- span(slot='prepend') {{$t('Mastodon instance')}}
- el-button(slot='append' @click='associate' variant='success' type='success') {{$t('Associate')}}
+ span(slot='prepend') {{$t('admin.mastodon_instance')}}
+ el-button(slot='append' @click='associate' :disabled='!mastodon_instance.length') {{$t('common.associate')}}
diff --git a/pages/event/_id.vue b/pages/event/_id.vue
index 6873a2cf..935612cf 100644
--- a/pages/event/_id.vue
+++ b/pages/event/_id.vue
@@ -3,26 +3,26 @@
b-card(no-body, :img-src='imgPath' v-loading='loading')
nuxt-link(to='/')
el-button.close_button(circle icon='el-icon-close' type='success'
- @click='$refs.eventDetail.hide()')
+ @click.prevent='$refs.eventDetail.hide()')
b-card-header
h3 {{event.title}}
v-icon(name='clock')
span {{event.start_datetime|datetime}}
br
v-icon(name='map-marker-alt')
- //- span {{event.place.name}} - {{event.place.address}}
+ span {{event.place.name}} - {{event.place.address}}
br
b-card-body(v-if='event.description || event.tags')
pre(v-html='event.description')
br
- el-tag.mr-1(:color='tag.color || "grey"' v-for='tag in event.tags'
+ el-tag.mr-1(:color='tag.color' v-for='tag in event.tags'
size='mini' :key='tag.tag') {{tag.tag}}
- .ml-auto(v-if='mine')
+ div(v-if='mine')
hr
- el-button(v-if='event.is_visible' plain type='warning' @click.prevents='toggle' icon='el-icon-view') {{$t('Unconfirm')}}
- el-button(v-else plain type='success' @click.prevents='toggle' icon='el-icon-view') {{$t('Confirm')}}
- el-button(plain type='danger' @click.prevent='remove' icon='el-icon-remove') {{$t('Remove')}}
- el-button(plain type='primary' @click='$router.replace("/edit/"+event.id)') {{$t('Edit')}}
+ el-button(v-if='event.is_visible' plain type='warning' @click.prevents='toggle' icon='el-icon-view') {{$t('common.hide')}}
+ el-button(v-else plain type='success' @click.prevents='toggle' icon='el-icon-view') {{$t('common.confirm')}}
+ el-button(plain type='danger' @click.prevent='remove' icon='el-icon-remove') {{$t('common.remove')}}
+ el-button(plain type='primary' @click='$router.replace("/edit/"+event.id)') {{$t('common.edit')}}
//- COMMENTS ...
//- b-navbar(type="dark" variant="dark" toggleable='lg')
@@ -34,10 +34,17 @@
//- span.mr-3 {{event.comments.length}}
//- a(href='#', @click='remove')
v-icon(color='orange' name='times')
- //- b-card-footer(v-for='comment in event.comments')
- strong {{comment.author}}
- div(v-html='comment.text')
+ //- el-footer(v-for='comment in event.comments')
+ strong {{comment.author}}
+ div(v-html='comment.text')
+ //- el-timeline
+ //- el-timeline-item(v-for='comment in event.comments')
+ //- p(v-html='comment.text')
+ //- a.el-timeline-item__timestamp(href='') {{comment.createdAt}}
+ strong {{$t('common.comments')}}
+ div.text.item(v-for='comment in event.comments')
+ span(v-html='comment.text')
+
+
+
+
+
+
+
+
+