From 40bab39965f76345c20fdfd438e3621f207c2e4c Mon Sep 17 00:00:00 2001 From: lesion Date: Tue, 1 Feb 2022 12:48:14 +0100 Subject: [PATCH] add new webcomponent "fullwidth" layout --- locales/it.json | 3 +- pages/export.vue | 17 +- static/gancio-events.es.js | 571 ++++++++++++++++++++------ webcomponents/index.html | 5 +- webcomponents/package.json | 2 +- webcomponents/src/GancioEvents.svelte | 203 ++++++--- 6 files changed, 626 insertions(+), 175 deletions(-) diff --git a/locales/it.json b/locales/it.json index 3f117096..184a0f9a 100644 --- a/locales/it.json +++ b/locales/it.json @@ -223,7 +223,8 @@ "delete_footer_link_confirm": "Vuoi eliminare questo collegamento?", "edit_place": "Modifica luogo", "new_announcement": "Nuovo annuncio", - "show_smtp_setup": "Impostazioni email" + "show_smtp_setup": "Impostazioni email", + "widget": "Widget" }, "auth": { "not_confirmed": "Non ancora confermato…", diff --git a/pages/export.vue b/pages/export.vue index 6e82aa91..30e64b50 100644 --- a/pages/export.vue +++ b/pages/export.vue @@ -53,14 +53,16 @@ v-text-field(v-model='list.title' :label='$t("common.title")') v-text-field(v-model='list.maxEvents' type='number' min='1' :label='$t("common.max_events")') v-switch(v-model='list.theme' inset true-value='dark' false-value='light' :label="$t('admin.is_dark')") - v-col.float-right(:span='12') + v-switch(v-model='list.sidebar' inset true-value='true' false-value='false' :label="$t('admin.widget')") + v-col.col-12.col-lg-8 gancio-events(:baseurl='settings.baseurl' :maxlength='list.maxEvents && Number(list.maxEvents)' :title='list.title' :theme='list.theme' :places='filters.places.join(",")' :tags='filters.tags.join(",")' - :show_recurrent='filters.show_recurrent') + :show_recurrent='filters.show_recurrent' + :sidebar="list.sidebar") v-alert.pa-5.my-4.blue-grey.darken-4.text-body-1.lime--text.text--lighten-3
{{code}}
v-btn.float-end(text color='primary' @click='clipboard(code)') {{$t("common.copy")}} v-icon.ml-1 mdi-content-copy @@ -101,7 +103,12 @@ export default { return { type: 'rss', notification: { email: '' }, - list: { title: $store.state.settings.title, maxEvents: null, theme: 'dark' }, + list: { + title: $store.state.settings.title, + maxEvents: null, + theme: $store.state.settings['theme.is_dark'] ? 'dark' : 'light', + sidebar: 'true' + }, filters: { tags: [], places: [], show_recurrent: false }, events: [] } @@ -116,7 +123,7 @@ export default { code () { const params = [`baseurl="${this.settings.baseurl}"`] - if (this.list.title) { + if (this.list.title && this.list.sidebar === 'true') { params.push(`title="${this.list.title}"`) } @@ -136,6 +143,8 @@ export default { params.push('maxlength=' + this.list.maxEvents) } + params.push('sidebar="' + this.list.sidebar + '"') + params.push(`theme="${this.list.theme}"`) return ` diff --git a/webcomponents/package.json b/webcomponents/package.json index 1facfb05..f88bd8dc 100644 --- a/webcomponents/package.json +++ b/webcomponents/package.json @@ -10,7 +10,7 @@ }, "devDependencies": { "@sveltejs/vite-plugin-svelte": "^1.0.0-next.34", - "svelte": "^3.46.1", + "svelte": "^3.46.3", "vite": "^2.7.11" } } diff --git a/webcomponents/src/GancioEvents.svelte b/webcomponents/src/GancioEvents.svelte index f016315f..4a5bfcc5 100644 --- a/webcomponents/src/GancioEvents.svelte +++ b/webcomponents/src/GancioEvents.svelte @@ -1,11 +1,14 @@ {#if events.length} -
- + {/if}