mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
Widget: Add voucher explanation text
This commit is contained in:
@@ -434,6 +434,7 @@ class WidgetAPIProductList(EventListMixin, View):
|
||||
'display_net_prices': request.event.settings.display_net_prices,
|
||||
'show_variations_expanded': request.event.settings.show_variations_expanded,
|
||||
'waiting_list_enabled': request.event.settings.waiting_list_enabled,
|
||||
'voucher_explanation_text': str(request.event.settings.voucher_explanation_text),
|
||||
'error': None,
|
||||
'cart_exists': False
|
||||
}
|
||||
|
||||
@@ -680,6 +680,7 @@ Vue.component('pretix-widget-event-form', {
|
||||
+ ' v-if="$root.vouchers_exist && !$root.disable_vouchers && !$root.voucher_code">'
|
||||
+ '<div class="pretix-widget-voucher">'
|
||||
+ '<h3 class="pretix-widget-voucher-headline">'+ strings['redeem_voucher'] +'</h3>'
|
||||
+ '<div v-if="$root.voucher_explanation_text" class="pretix-widget-voucher-text">{{ $root.voucher_explanation_text }}</div>'
|
||||
+ '<div class="pretix-widget-voucher-input-wrap">'
|
||||
+ '<input class="pretix-widget-voucher-input" type="text" v-model="$parent.voucher" name="voucher" placeholder="'+strings.voucher_code+'">'
|
||||
+ '</div>'
|
||||
@@ -1045,6 +1046,7 @@ var shared_root_methods = {
|
||||
root.categories = data.items_by_category;
|
||||
root.currency = data.currency;
|
||||
root.display_net_prices = data.display_net_prices;
|
||||
root.voucher_explanation_text = data.voucher_explanation_text;
|
||||
root.error = data.error;
|
||||
root.display_add_to_cart = data.display_add_to_cart;
|
||||
root.waiting_list_enabled = data.waiting_list_enabled;
|
||||
@@ -1200,6 +1202,7 @@ var create_widget = function (element) {
|
||||
name: null,
|
||||
voucher_code: voucher,
|
||||
display_net_prices: false,
|
||||
voucher_explanation_text: null,
|
||||
show_variations_expanded: false,
|
||||
skip_ssl: skip_ssl,
|
||||
style: style,
|
||||
|
||||
@@ -273,6 +273,10 @@
|
||||
.pretix-widget-voucher-headline {
|
||||
margin: 10px 0 0 0;
|
||||
}
|
||||
.pretix-widget-voucher-text {
|
||||
margin: 10px 0;
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
.pretix-widget-voucher-input-wrap {
|
||||
padding: 0 15px;
|
||||
|
||||
Reference in New Issue
Block a user