diff --git a/src/pretix/api/serializers/event.py b/src/pretix/api/serializers/event.py index 6280d9a1c..842a11f26 100644 --- a/src/pretix/api/serializers/event.py +++ b/src/pretix/api/serializers/event.py @@ -662,6 +662,7 @@ class EventSettingsSerializer(SettingsSerializer): 'show_times', 'show_items_outside_presale_period', 'display_net_prices', + 'hide_prices_from_attendees', 'presale_start_show_date', 'locales', 'locale', diff --git a/src/pretix/base/settings.py b/src/pretix/base/settings.py index 8a7b74e6f..f3ca2fd13 100644 --- a/src/pretix/base/settings.py +++ b/src/pretix/base/settings.py @@ -195,6 +195,19 @@ DEFAULTS = { ) }, + 'hide_prices_from_attendees': { + 'default': 'True', + 'type': bool, + 'form_class': forms.BooleanField, + 'serializer_class': serializers.BooleanField, + 'form_kwargs': dict( + label=_("Hide prices on attendee ticket page"), + help_text=_("If a person buys multiple tickets and you send emails to all of the attendees, with this " + "option the ticket price will not be shown on the ticket page of the individual attendees. " + "The ticket buyer will of course see the price."), + + ) + }, 'system_question_order': { 'default': {}, 'type': dict, diff --git a/src/pretix/control/forms/event.py b/src/pretix/control/forms/event.py index 96054acfd..f2389e5ea 100644 --- a/src/pretix/control/forms/event.py +++ b/src/pretix/control/forms/event.py @@ -486,6 +486,7 @@ class EventSettingsForm(SettingsForm): 'show_times', 'show_items_outside_presale_period', 'display_net_prices', + 'hide_prices_from_attendees', 'presale_start_show_date', 'locales', 'locale', diff --git a/src/pretix/control/templates/pretixcontrol/event/settings.html b/src/pretix/control/templates/pretixcontrol/event/settings.html index db0490f56..635511f30 100644 --- a/src/pretix/control/templates/pretixcontrol/event/settings.html +++ b/src/pretix/control/templates/pretixcontrol/event/settings.html @@ -235,6 +235,7 @@ {% bootstrap_field sform.show_times layout="control" %} {% bootstrap_field sform.show_quota_left layout="control" %} {% bootstrap_field sform.display_net_prices layout="control" %} + {% bootstrap_field sform.hide_prices_from_attendees layout="control" %} {% bootstrap_field sform.show_variations_expanded layout="control" %} {% bootstrap_field sform.hide_sold_out layout="control" %} diff --git a/src/pretix/presale/templates/pretixpresale/event/fragment_cart.html b/src/pretix/presale/templates/pretixpresale/event/fragment_cart.html index d98c57eff..fcd310a71 100644 --- a/src/pretix/presale/templates/pretixpresale/event/fragment_cart.html +++ b/src/pretix/presale/templates/pretixpresale/event/fragment_cart.html @@ -10,15 +10,17 @@ {% trans "Product" %} {% if download %} {% trans "Ticket download" %} - {% else %} + {% elif not hide_prices %} {% trans "Price per item" %} {% endif %} - {% trans "Price total" %} + {% if not hide_prices %} + {% trans "Price total" %} + {% endif %}
{% for line in cart.positions %} -
+

{% if line.addon_to %} @@ -255,20 +257,22 @@

{% elif line.addon_to %}
{% if line.count == 1 %} {% else %}{{ line.count }}{% endif %}
-
- {% if event.settings.display_net_prices %} - {{ line.net_price|money:event.currency }} - {% else %} - {{ line.price|money:event.currency }} - {% endif %} - {% if line.discount and line.line_price_gross != line.price %} - -
- - {% trans "Discounted" %} -
- {% endif %} -
+ {% if not hide_prices %} +
+ {% if event.settings.display_net_prices %} + {{ line.net_price|money:event.currency }} + {% else %} + {{ line.price|money:event.currency }} + {% endif %} + {% if line.discount and line.line_price_gross != line.price %} + +
+ + {% trans "Discounted" %} +
+ {% endif %} +
+ {% endif %} {% else %}
{% if editable %} @@ -320,44 +324,48 @@ {% endif %}
-
+ {% if not hide_prices %} +
+ {% if event.settings.display_net_prices %} + {{ line.net_price|money:event.currency }} + {% else %} + {{ line.price|money:event.currency }} + {% endif %} + {% if line.discount and line.line_price_gross != line.price %} + +
+ + {% trans "Discounted" %} +
+ {% endif %} +
+ {% endif %} + {% endif %} + {% if not hide_prices %} +
{% if event.settings.display_net_prices %} - {{ line.net_price|money:event.currency }} + {{ line.net_total|money:event.currency }} + {% if line.tax_rate and line.total %} +
+ + {% blocktrans trimmed with rate=line.tax_rate|floatformat:-2 taxname=line.tax_rule.name|default:s_taxes %} + plus {{ rate }}% {{ taxname }} + {% endblocktrans %} + + {% endif %} {% else %} - {{ line.price|money:event.currency }} - {% endif %} - {% if line.discount and line.line_price_gross != line.price %} - -
- - {% trans "Discounted" %} -
+ {{ line.total|money:event.currency }} + {% if line.tax_rate and line.total %} +
+ + {% blocktrans trimmed with rate=line.tax_rate|floatformat:-2 taxname=line.tax_rule.name|default:s_taxes %} + incl. {{ rate }}% {{ taxname }} + {% endblocktrans %} + + {% endif %} {% endif %}
{% endif %} -
- {% if event.settings.display_net_prices %} - {{ line.net_total|money:event.currency }} - {% if line.tax_rate and line.total %} -
- - {% blocktrans trimmed with rate=line.tax_rate|floatformat:-2 taxname=line.tax_rule.name|default:s_taxes %} - plus {{ rate }}% {{ taxname }} - {% endblocktrans %} - - {% endif %} - {% else %} - {{ line.total|money:event.currency }} - {% if line.tax_rate and line.total %} -
- - {% blocktrans trimmed with rate=line.tax_rate|floatformat:-2 taxname=line.tax_rule.name|default:s_taxes %} - incl. {{ rate }}% {{ taxname }} - {% endblocktrans %} - - {% endif %} - {% endif %} -
{% endfor %} @@ -366,85 +374,89 @@
{{ fee.get_fee_type_display }}
-
- {% if event.settings.display_net_prices %} - {{ fee.net_value|money:event.currency }} - {% if fee.tax_rate %} -
- - {% blocktrans trimmed with rate=fee.tax_rate|floatformat:-2 taxname=fee.tax_rule.name|default:s_taxes %} - plus {{ rate }}% {{ taxname }} - {% endblocktrans %} - + {% if not hide_prices %} +
+ {% if event.settings.display_net_prices %} + {{ fee.net_value|money:event.currency }} + {% if fee.tax_rate %} +
+ + {% blocktrans trimmed with rate=fee.tax_rate|floatformat:-2 taxname=fee.tax_rule.name|default:s_taxes %} + plus {{ rate }}% {{ taxname }} + {% endblocktrans %} + + {% endif %} + {% else %} + {{ fee.value|money:event.currency }} + {% if fee.tax_rate %} +
+ + {% blocktrans trimmed with rate=fee.tax_rate|floatformat:-2 taxname=fee.tax_rule.name|default:s_taxes %} + incl. {{ rate }}% {{ taxname }} + {% endblocktrans %} + + {% endif %} {% endif %} - {% else %} - {{ fee.value|money:event.currency }} - {% if fee.tax_rate %} -
- - {% blocktrans trimmed with rate=fee.tax_rate|floatformat:-2 taxname=fee.tax_rule.name|default:s_taxes %} - incl. {{ rate }}% {{ taxname }} - {% endblocktrans %} - - {% endif %} - {% endif %} -
+
+ {% endif %}
{% endfor %}
-
- {% if event.settings.display_net_prices and cart.tax_total %} -
-
- {% trans "Net total" %} + {% if not hide_prices %} +
+ {% if event.settings.display_net_prices and cart.tax_total %} +
+
+ {% trans "Net total" %} +
+ +
+
+ {{ cart.net_total|money:event.currency }} +
+
- -
-
- {{ cart.net_total|money:event.currency }} +
+
+ {% trans "Taxes" %} +
+ +
+
+ {{ cart.tax_total|money:event.currency }} +
+
-
-
-
-
- {% trans "Taxes" %} + {% endif %} +
+
+ {% trans "Total" %}
+ + {% blocktrans trimmed count num=cart.itemcount %} + One product + {% plural %} + {{ num }} products + {% endblocktrans %} + +
+ +
+
+ {{ cart.total|money:event.currency }} + + {% if not event.settings.display_net_prices and cart.tax_total %} + + {% blocktrans trimmed with tax_sum=cart.tax_total|money:event.currency %} + incl. {{ tax_sum }} taxes + {% endblocktrans %} + + {% endif %} +
+
- -
-
- {{ cart.tax_total|money:event.currency }} -
-
{% endif %} -
-
- {% trans "Total" %}
- - {% blocktrans trimmed count num=cart.itemcount %} - One product - {% plural %} - {{ num }} products - {% endblocktrans %} - -
- -
-
- {{ cart.total|money:event.currency }} - - {% if not event.settings.display_net_prices and cart.tax_total %} - - {% blocktrans trimmed with tax_sum=cart.tax_total|money:event.currency %} - incl. {{ tax_sum }} taxes - {% endblocktrans %} - - {% endif %} -
-
-
-
diff --git a/src/pretix/presale/templates/pretixpresale/event/position.html b/src/pretix/presale/templates/pretixpresale/event/position.html index 7e3c5a17c..3d2f0632a 100644 --- a/src/pretix/presale/templates/pretixpresale/event/position.html +++ b/src/pretix/presale/templates/pretixpresale/event/position.html @@ -32,7 +32,7 @@
- {% include "pretixpresale/event/fragment_cart.html" with cart=cart event=request.event download=can_download position_page=True editable=False %} + {% include "pretixpresale/event/fragment_cart.html" with cart=cart event=request.event download=can_download position_page=True editable=False hide_prices=request.event.settings.hide_prices_from_attendees %}
diff --git a/src/pretix/static/pretixpresale/scss/_cart.scss b/src/pretix/static/pretixpresale/scss/_cart.scss index 2747e3cde..78f28db1f 100644 --- a/src/pretix/static/pretixpresale/scss/_cart.scss +++ b/src/pretix/static/pretixpresale/scss/_cart.scss @@ -64,9 +64,15 @@ .singleprice, .totalprice { width: percentage((3 / $grid-columns)); } + &.hide-prices .product { + width: percentage((10 / $grid-columns)); + } &.has-downloads .product { width: percentage((5 / $grid-columns)); } + &.has-downloads.hide-prices .product { + width: percentage((8 / $grid-columns)); + } .addon-signifier { display: inline-block; padding-left: 10px; @@ -103,7 +109,7 @@ .cart .firstchild-in-panel .cart-row:first-child { padding-top: 0; } -.cart [role=rowgroup]:last-child { +.cart .cart-rowgroup-total { border-top: 1px solid $table-border-color; } .cart .total strong { @@ -196,15 +202,23 @@ .totalprice { width: 50%; } - .product, &.has-downloads .product { + &.hide-prices .product { + width: 75%; + } + .product, &.has-downloads .product, &.has-downloads.hide-prices .product { width: 100%; } + &.has-downloads.hide-prices .download-desktop { + margin-left: 50%; + } &.total .product { width: 50%; } .count { - clear: both; width: 25%; + } + &:not(.hide-prices) .count { + clear: both; text-align: left; } .singleprice {