Allow to show description of add-on product variations by default

This commit is contained in:
Raphael Michel
2019-07-15 11:26:42 +02:00
parent 020122b44f
commit 8d674965d1
6 changed files with 17 additions and 3 deletions

View File

@@ -205,6 +205,10 @@ DEFAULTS = {
'default': 'False',
'type': bool
},
'addon_variation_description_collapsed': {
'default': 'True',
'type': bool
},
'waiting_list_enabled': {
'default': 'False',
'type': bool

View File

@@ -1194,6 +1194,10 @@ class DisplaySettingsForm(SettingsForm):
label=_("Show variations of a product expanded by default"),
required=False
)
addon_variation_description_collapsed = forms.BooleanField(
label=_("Collapse descriptions of variations of add-on products"),
required=False
)
frontpage_subevent_ordering = forms.ChoiceField(
label=pgettext('subevent', 'Date ordering'),
choices=[

View File

@@ -18,6 +18,7 @@
{% bootstrap_field form.presale_has_ended_text layout="control" %}
{% bootstrap_field form.voucher_explanation_text layout="control" %}
{% bootstrap_field form.show_variations_expanded layout="control" %}
{% bootstrap_field form.addon_variation_description_collapsed layout="control" %}
{% bootstrap_field form.meta_noindex layout="control" %}
{% if form.frontpage_subevent_ordering %}
{% bootstrap_field form.frontpage_subevent_ordering layout="control" %}

View File

@@ -6,7 +6,8 @@
<p>
{% trans "For some of the products in your cart, you can choose additional options before you continue." %}
</p>
<form class="form-horizontal" method="post" data-asynctask
<form class="form-horizontal {% if request.event.settings.addon_variation_description_collapsed %}collapse-vardesc{% endif %}"
method="post" data-asynctask
data-asynctask-headline="{% trans "We're now trying to book these add-ons for you!" %}">
{% csrf_token %}
<div class="panel-group" id="questions_group">

View File

@@ -140,8 +140,8 @@ $(function () {
$("#ajaxerr").on("click", ".ajaxerr-close", ajaxErrDialog.hide);
// AddOns
$('.addon-variation-description').hide();
$('.toggle-variation-description').click(function () {
$('.collapse-vardesc .addon-variation-description').hide();
$('.collapse-vardesc .toggle-variation-description').click(function () {
$(this).parent().find('.addon-variation-description').slideToggle();
});

View File

@@ -88,7 +88,11 @@
margin-top: 10px;
}
.toggle-variation-description {
display: none;
}
.collapse-vardesc .toggle-variation-description {
cursor: pointer;
display: block;
}
#voucher-toggle {
display: none;