diff --git a/.github/workflows/style-js.yml b/.github/workflows/style-js.yml index 64e35fecce..d63896e9e6 100644 --- a/.github/workflows/style-js.yml +++ b/.github/workflows/style-js.yml @@ -7,6 +7,7 @@ on: - 'src/pretix/static/pretixpresale/widget/**' - 'src/pretix/static/pretixcontrol/js/ui/checkinrules/**' - 'src/pretix/plugins/webcheckin/**' + - 'src/pretix/plugins/wallet/**' - 'eslint.config.mjs' - 'package.json' - 'package-lock.json' @@ -16,6 +17,7 @@ on: - 'src/pretix/static/pretixpresale/widget/**' - 'src/pretix/static/pretixcontrol/js/ui/checkinrules/**' - 'src/pretix/plugins/webcheckin/**' + - 'src/pretix/plugins/wallet/**' - 'eslint.config.mjs' - 'package.json' - 'package-lock.json' diff --git a/src/pretix/plugins/wallet/static/pretixplugins/wallet/components/app.vue b/src/pretix/plugins/wallet/static/pretixplugins/wallet/components/app.vue index f29a3e88c7..8e089965c4 100644 --- a/src/pretix/plugins/wallet/static/pretixplugins/wallet/components/app.vue +++ b/src/pretix/plugins/wallet/static/pretixplugins/wallet/components/app.vue @@ -1,67 +1,19 @@ @@ -116,31 +44,41 @@ function openPreview(e: SubmitEvent) { // TODO: add :key for all `v-for`s // TODO: i18n textfields // TODO: proper spinner - template(v-if="isLoading") {{ gettext("Loading...") }} - form(v-else @submit="saveLayout") + + template(v-if="!store.loaded") {{ gettext("Loading...") }} + form(v-else @submit.prevent="store.saveLayout") .form-group - Input(label="Name" v-model="wallet_layout.name") + Input(label="Name" v-model="store.walletLayout.name") nav ul.nav.nav-tabs - li(v-for="platform in PLATFORMS" :class="{'active': currentPlatform === platform.identifier}") - a(role="tab" @click="currentPlatform = platform.identifier") {{ platform.name }} + li(v-for="platform in store.platforms" :class="{'active': store.currentPlatform === platform.identifier}") + a(role="tab" @click="store.currentPlatform = platform.identifier") {{ platform.name }} .tabbed-form.tab-content .tab-pane.active.row .col-md-8 - Select.form-group(label="Style" v-model="platformLayout.style" :choices="platformChoices") + Select.form-group(label="Style" :modelValue="store.currentPlatformLayout.style" @update:modelValue="store.setCurrentPlatformStyle" :choices="platformChoices") - StyleSettings(v-if="platformLayout.style" v-model="platformLayout.layout" :style="platformStyles[platformLayout.style]" :variables="VARIABLES" :locales="LOCALES") + StyleSettings(v-if="store.currentPlatformLayout.style" v-model="store.currentPlatformLayout.layout" :style="store.currentPlatformStyles[store.currentPlatformLayout.style]") .col-md-4 .panel.panel-default .panel-heading Preview .panel-body + span.text-muted The preview below is only a rough representation of what the pass might look like. Please check the generated pass. + div(style="margin-top: 1em; width: 10cm; height: 15cm; position: relative; border: solid 1px gray; border-radius: 1em;") + div(style="position: absolute; background-color: red; top: 0.5cm; left: 0cm; height: 1cm; width: 2cm;") Logo + div(style="position: absolute; background-color: red; top: 0.5cm; left: 2.25cm; height: 1cm; width: 5.5cm;") Logo Text + div(style="position: absolute; background-color: red; top: 0.5cm; left: 8cm; height: 1cm; width: 2cm;") Header + div(style="position: absolute; background-color: red; top: 2.5cm; left: 0cm; height: 2cm; width: 10cm;") Primary + div(style="position: absolute; background-color: red; top: 4.75cm; left: 0cm; height: 1cm; width: 10cm;") Secondary + div(style="position: absolute; background-color: red; top: 7cm; left: 0cm; height: 1cm; width: 10cm;") Auxiliary + div(style="position: absolute; background-color: red; top: 10cm; left: 3cm; height: 4cm; width: 4cm;") Barcode // TODO: Preview pre - code {{ platformLayout }} - pre(v-if="wallet_layout.style") - code {{ platformStyles[wallet_layout.style] }} + code {{ store.currentPlatformLayout }} + pre(v-if="store.currentPlatformLayout.style") + code {{ store.currentPlatformStyles[store.currentPlatformLayout.style] }} pre - code {{ wallet_layout }} + code {{ store.walletLayout }} .form-group.submit-group button.btn.btn-lg.btn-default(type="button" @click="openPreview") Preview button.btn.btn-primary.btn-save(type="submit") Submit diff --git a/src/pretix/plugins/wallet/static/pretixplugins/wallet/components/app.vue_old b/src/pretix/plugins/wallet/static/pretixplugins/wallet/components/app.vue_old new file mode 100644 index 0000000000..21df10b708 --- /dev/null +++ b/src/pretix/plugins/wallet/static/pretixplugins/wallet/components/app.vue_old @@ -0,0 +1,148 @@ + + + diff --git a/src/pretix/plugins/wallet/static/pretixplugins/wallet/components/input/i18ninput.vue b/src/pretix/plugins/wallet/static/pretixplugins/wallet/components/input/i18ninput.vue index 1115fdebe8..509b85c7b1 100644 --- a/src/pretix/plugins/wallet/static/pretixplugins/wallet/components/input/i18ninput.vue +++ b/src/pretix/plugins/wallet/static/pretixplugins/wallet/components/input/i18ninput.vue @@ -1,5 +1,8 @@ diff --git a/src/pretix/plugins/wallet/static/pretixplugins/wallet/components/input/select.vue b/src/pretix/plugins/wallet/static/pretixplugins/wallet/components/input/select.vue index e6fdbed922..17705c6db6 100644 --- a/src/pretix/plugins/wallet/static/pretixplugins/wallet/components/input/select.vue +++ b/src/pretix/plugins/wallet/static/pretixplugins/wallet/components/input/select.vue @@ -9,7 +9,7 @@ const props = defineProps<{ label?: string choices: Array<[string, string]> errors?: string[], - class: string + class?: string }>() const modelValue = defineModel(); const id = useId() diff --git a/src/pretix/plugins/wallet/static/pretixplugins/wallet/components/placeholder-field-settings.vue b/src/pretix/plugins/wallet/static/pretixplugins/wallet/components/placeholder-field-settings.vue index 97941bd3df..fe5efed362 100644 --- a/src/pretix/plugins/wallet/static/pretixplugins/wallet/components/placeholder-field-settings.vue +++ b/src/pretix/plugins/wallet/static/pretixplugins/wallet/components/placeholder-field-settings.vue @@ -1,17 +1,18 @@