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 @@ \ 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 @@ + 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 @@ 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') + + + + + + + + + \ No newline at end of file diff --git a/widgets/list/index.html b/widgets/list/index.html new file mode 100644 index 00000000..e69de29b diff --git a/widgets/list/index.js b/widgets/list/index.js new file mode 100644 index 00000000..0b47f6d7 --- /dev/null +++ b/widgets/list/index.js @@ -0,0 +1,12 @@ +import Vue from 'vue' +import vueCustomElement from 'vue-custom-element' +import App from '../../components/List' +// import router from './router' +// import store from '../../store' + +Vue.use(vueCustomElement) + +// App.store = store +// App.router = router +Vue.customElement('gancio-widget', App) +export default App diff --git a/widgets/list/style.css b/widgets/list/style.css new file mode 100644 index 00000000..87eb01f5 --- /dev/null +++ b/widgets/list/style.css @@ -0,0 +1,3 @@ +#gancio-widget { + border: 1px solid black; +} \ No newline at end of file