Compare commits

...

16 Commits

Author SHA1 Message Date
Mira
3f40f44a12 Update src/pretix/static/pretixpresale/js/ui/main.js 2024-03-11 18:02:59 +01:00
Richard Schreiber
8821afb8cf fix plus/minus-stepper buttons bubbling 2024-03-11 12:01:56 +01:00
Richard Schreiber
648682c89d add max_count check 2024-03-11 12:01:37 +01:00
Richard Schreiber
28db030908 fix add-on-exclusive 2024-03-11 11:22:30 +01:00
Richard Schreiber
282b8a7abf move exclusive to containing fieldset 2024-03-11 09:19:41 +01:00
Richard Schreiber
9b94e0f918 combine exclusive items + variations 2024-03-11 09:14:23 +01:00
Mira Weller
eae2d04884 Use exclusive checkboxes for addon items with max_count == 1 and !multi_allowed 2024-03-08 19:34:54 +01:00
Mira Weller
ef3420f761 Fix typo in error message 2024-03-08 19:34:18 +01:00
Richard Schreiber
3e2c12cdb0 Presale: fix auto-unchecked button-checkboxes (#3968) 2024-03-08 19:33:06 +01:00
Raphael Michel
a3ce3b9af3 Select2: Fix multi-select styling for events 2024-03-08 10:09:11 +01:00
Raphael Michel
b6461e9303 Select2: Set closeOnSelect for event selection 2024-03-08 10:08:44 +01:00
Raphael Michel
f7dfd51c2c Open invoices on new page 2024-03-07 10:57:41 +01:00
dependabot[bot]
3b98d87a26 Update python-dateutil requirement from ==2.8.* to ==2.9.* (#3950)
Updates the requirements on [python-dateutil](https://github.com/dateutil/dateutil) to permit the latest version.
- [Release notes](https://github.com/dateutil/dateutil/releases)
- [Changelog](https://github.com/dateutil/dateutil/blob/master/NEWS)
- [Commits](https://github.com/dateutil/dateutil/compare/2.8.0...2.9.0)

---
updated-dependencies:
- dependency-name: python-dateutil
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-05 12:21:12 +01:00
dependabot[bot]
f045062055 Bump @babel/preset-env from 7.23.9 to 7.24.0 in /src/pretix/static/npm_dir (#3952)
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.23.9 to 7.24.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.24.0/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-05 12:17:23 +01:00
Felix Schäfer
eb501dd1ea Correct config key in docs (#3955) 2024-03-05 12:17:17 +01:00
Dean Wyns
2d8793c355 Translations: Update Dutch
Currently translated at 88.7% (4938 of 5565 strings)

Translation: pretix/pretix
Translate-URL: https://translate.pretix.eu/projects/pretix/pretix/nl/

powered by weblate
2024-03-05 12:16:58 +01:00
12 changed files with 485 additions and 143 deletions

View File

@@ -345,7 +345,7 @@ to speed up various operations::
The location of redis, as a URL of the form ``redis://[:password]@localhost:6379/0``
or ``unix://[:password]@/path/to/socket.sock?db=0``
``session``
``sessions``
When this is set to ``True``, redis will be used as the session storage.
``sentinels``
@@ -521,4 +521,4 @@ pretix can optionally make use of a GeoIP database for some features. It needs a
.. _GeoAcumen: https://github.com/geoacumen/geoacumen-country
.. _GeoLite2: https://dev.maxmind.com/geoip/geolite2-free-geolocation-data
.. _GeoLite2: https://dev.maxmind.com/geoip/geolite2-free-geolocation-data

View File

@@ -84,7 +84,7 @@ dependencies = [
"pycryptodome==3.20.*",
"pypdf==3.9.*",
"python-bidi==0.4.*", # Support for Arabic in reportlab
"python-dateutil==2.8.*",
"python-dateutil==2.9.*",
"pytz",
"pytz-deprecation-shim==0.1.*",
"pyuca",

View File

@@ -203,7 +203,7 @@ error_messages = {
'You need to select at least %(min)s add-ons from the category %(cat)s for the product %(base)s.',
'min'
),
'addon_no_multi': gettext_lazy('You can select every add-ons from the category %(cat)s for the product %(base)s at most once.'),
'addon_no_multi': gettext_lazy('You can select every add-on from the category %(cat)s for the product %(base)s at most once.'),
'addon_only': gettext_lazy('One of the products you selected can only be bought as an add-on to another product.'),
'bundled_only': gettext_lazy('One of the products you selected can only be bought part of a bundle.'),
'seat_required': gettext_lazy('You need to select a specific seat.'),

View File

@@ -197,7 +197,7 @@ error_messages = {
'You need to select at least %(min)s add-ons from the category %(cat)s for the product %(base)s.',
'min'
),
'addon_no_multi': gettext_lazy('You can select every add-ons from the category %(cat)s for the product %(base)s at most once.'),
'addon_no_multi': gettext_lazy('You can select every add-on from the category %(cat)s for the product %(base)s at most once.'),
'addon_already_checked_in': gettext_lazy('You cannot remove the position %(addon)s since it has already been checked in.'),
}

File diff suppressed because it is too large Load Diff

View File

@@ -6,13 +6,13 @@
{% load eventsignal %}
{% load rich_text %}
{% for c in form.categories %}
<fieldset>
<fieldset data-addon-max-count="{{ c.max_count }}"{% if c.multi_allowed %} data-addon-multi-allowed{% endif %}>
<legend>{{ c.category.name }}</legend>
{% if c.category.description %}
{{ c.category.description|rich_text }}
{% endif %}
{% if c.min_count == c.max_count %}
<p>
<p class="addon-count-desc">
{% blocktrans trimmed count min_count=c.min_count %}
You need to choose exactly one option from this category.
{% plural %}
@@ -21,7 +21,7 @@
</p>
{% elif c.min_count == 0 and c.max_count >= c.items|length and not c.multi_allowed %}
{% elif c.min_count == 0 %}
<p>
<p class="addon-count-desc">
{% blocktrans trimmed count max_count=c.max_count %}
You can choose {{ max_count }} option from this category.
{% plural %}
@@ -29,7 +29,7 @@
{% endblocktrans %}
</p>
{% else %}
<p>
<p class="addon-count-desc">
{% blocktrans trimmed with min_count=c.min_count max_count=c.max_count %}
You can choose between {{ min_count }} and {{ max_count }} options from
this category.
@@ -193,7 +193,6 @@
{% endif %}
id="cp_{{ form.pos.pk }}_variation_{{ item.id }}_{{ var.id }}"
name="cp_{{ form.pos.pk }}_variation_{{ item.id }}_{{ var.id }}"
data-exclusive-prefix="cp_{{ form.pos.pk }}_variation_{{ item.id }}_"
aria-label="{% blocktrans with item=item.name var=var %}Add {{ item }}, {{ var }} to cart{% endblocktrans %}">
<i class="fa fa-shopping-cart" aria-hidden="true"></i>
{% trans "Select" context "checkbox" %}

View File

@@ -239,7 +239,7 @@
<ul>
{% for i in invoices %}
<li>
<a href="{% eventurl event "presale:event.invoice.download" invoice=i.pk secret=order.secret order=order.code %}">
<a href="{% eventurl event "presale:event.invoice.download" invoice=i.pk secret=order.secret order=order.code %}" target="_blank">
{% if i.is_cancellation %}{% trans "Cancellation" context "invoice" %}{% else %}{% trans "Invoice" %}{% endif %}
{{ i.number }}</a> ({{ i.date|date:"SHORT_DATE_FORMAT" }})
</li>

View File

@@ -9,7 +9,7 @@
"version": "0.0.0",
"dependencies": {
"@babel/core": "^7.23.9",
"@babel/preset-env": "^7.23.9",
"@babel/preset-env": "^7.24.0",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-node-resolve": "^15.2.3",
"rollup": "^2.79.1",
@@ -335,9 +335,9 @@
}
},
"node_modules/@babel/helper-plugin-utils": {
"version": "7.22.5",
"resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz",
"integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==",
"version": "7.24.0",
"resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.0.tgz",
"integrity": "sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w==",
"engines": {
"node": ">=6.9.0"
}
@@ -1196,13 +1196,13 @@
}
},
"node_modules/@babel/plugin-transform-object-rest-spread": {
"version": "7.23.4",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.23.4.tgz",
"integrity": "sha512-9x9K1YyeQVw0iOXJlIzwm8ltobIIv7j2iLyP2jIhEbqPRQ7ScNgwQufU2I0Gq11VjyG4gI4yMXt2VFags+1N3g==",
"version": "7.24.0",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.24.0.tgz",
"integrity": "sha512-y/yKMm7buHpFFXfxVFS4Vk1ToRJDilIa6fKRioB9Vjichv58TDGXTvqV0dN7plobAmTW5eSEGXDngE+Mm+uO+w==",
"dependencies": {
"@babel/compat-data": "^7.23.3",
"@babel/helper-compilation-targets": "^7.22.15",
"@babel/helper-plugin-utils": "^7.22.5",
"@babel/compat-data": "^7.23.5",
"@babel/helper-compilation-targets": "^7.23.6",
"@babel/helper-plugin-utils": "^7.24.0",
"@babel/plugin-syntax-object-rest-spread": "^7.8.3",
"@babel/plugin-transform-parameters": "^7.23.3"
},
@@ -1479,13 +1479,13 @@
}
},
"node_modules/@babel/preset-env": {
"version": "7.23.9",
"resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.23.9.tgz",
"integrity": "sha512-3kBGTNBBk9DQiPoXYS0g0BYlwTQYUTifqgKTjxUwEUkduRT2QOa0FPGBJ+NROQhGyYO5BuTJwGvBnqKDykac6A==",
"version": "7.24.0",
"resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.24.0.tgz",
"integrity": "sha512-ZxPEzV9IgvGn73iK0E6VB9/95Nd7aMFpbE0l8KQFDG70cOV9IxRP7Y2FUPmlK0v6ImlLqYX50iuZ3ZTVhOF2lA==",
"dependencies": {
"@babel/compat-data": "^7.23.5",
"@babel/helper-compilation-targets": "^7.23.6",
"@babel/helper-plugin-utils": "^7.22.5",
"@babel/helper-plugin-utils": "^7.24.0",
"@babel/helper-validator-option": "^7.23.5",
"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.23.3",
"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.23.3",
@@ -1538,7 +1538,7 @@
"@babel/plugin-transform-new-target": "^7.23.3",
"@babel/plugin-transform-nullish-coalescing-operator": "^7.23.4",
"@babel/plugin-transform-numeric-separator": "^7.23.4",
"@babel/plugin-transform-object-rest-spread": "^7.23.4",
"@babel/plugin-transform-object-rest-spread": "^7.24.0",
"@babel/plugin-transform-object-super": "^7.23.3",
"@babel/plugin-transform-optional-catch-binding": "^7.23.4",
"@babel/plugin-transform-optional-chaining": "^7.23.4",
@@ -4378,9 +4378,9 @@
}
},
"@babel/helper-plugin-utils": {
"version": "7.22.5",
"resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz",
"integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg=="
"version": "7.24.0",
"resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.0.tgz",
"integrity": "sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w=="
},
"@babel/helper-remap-async-to-generator": {
"version": "7.22.20",
@@ -4922,13 +4922,13 @@
}
},
"@babel/plugin-transform-object-rest-spread": {
"version": "7.23.4",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.23.4.tgz",
"integrity": "sha512-9x9K1YyeQVw0iOXJlIzwm8ltobIIv7j2iLyP2jIhEbqPRQ7ScNgwQufU2I0Gq11VjyG4gI4yMXt2VFags+1N3g==",
"version": "7.24.0",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.24.0.tgz",
"integrity": "sha512-y/yKMm7buHpFFXfxVFS4Vk1ToRJDilIa6fKRioB9Vjichv58TDGXTvqV0dN7plobAmTW5eSEGXDngE+Mm+uO+w==",
"requires": {
"@babel/compat-data": "^7.23.3",
"@babel/helper-compilation-targets": "^7.22.15",
"@babel/helper-plugin-utils": "^7.22.5",
"@babel/compat-data": "^7.23.5",
"@babel/helper-compilation-targets": "^7.23.6",
"@babel/helper-plugin-utils": "^7.24.0",
"@babel/plugin-syntax-object-rest-spread": "^7.8.3",
"@babel/plugin-transform-parameters": "^7.23.3"
}
@@ -5091,13 +5091,13 @@
}
},
"@babel/preset-env": {
"version": "7.23.9",
"resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.23.9.tgz",
"integrity": "sha512-3kBGTNBBk9DQiPoXYS0g0BYlwTQYUTifqgKTjxUwEUkduRT2QOa0FPGBJ+NROQhGyYO5BuTJwGvBnqKDykac6A==",
"version": "7.24.0",
"resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.24.0.tgz",
"integrity": "sha512-ZxPEzV9IgvGn73iK0E6VB9/95Nd7aMFpbE0l8KQFDG70cOV9IxRP7Y2FUPmlK0v6ImlLqYX50iuZ3ZTVhOF2lA==",
"requires": {
"@babel/compat-data": "^7.23.5",
"@babel/helper-compilation-targets": "^7.23.6",
"@babel/helper-plugin-utils": "^7.22.5",
"@babel/helper-plugin-utils": "^7.24.0",
"@babel/helper-validator-option": "^7.23.5",
"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.23.3",
"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.23.3",
@@ -5150,7 +5150,7 @@
"@babel/plugin-transform-new-target": "^7.23.3",
"@babel/plugin-transform-nullish-coalescing-operator": "^7.23.4",
"@babel/plugin-transform-numeric-separator": "^7.23.4",
"@babel/plugin-transform-object-rest-spread": "^7.23.4",
"@babel/plugin-transform-object-rest-spread": "^7.24.0",
"@babel/plugin-transform-object-super": "^7.23.3",
"@babel/plugin-transform-optional-catch-binding": "^7.23.4",
"@babel/plugin-transform-optional-chaining": "^7.23.4",

View File

@@ -5,7 +5,7 @@
"scripts": {},
"dependencies": {
"@babel/core": "^7.23.9",
"@babel/preset-env": "^7.23.9",
"@babel/preset-env": "^7.24.0",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-node-resolve": "^15.2.3",
"vue": "^2.7.16",

View File

@@ -625,6 +625,7 @@ var form_handlers = function (el) {
el.find('[data-model-select2=event]').each(function () {
var $s = $(this);
$s.select2({
closeOnSelect: !this.hasAttribute('multiple'),
theme: "bootstrap",
delay: 100,
allowClear: !$s.prop("required"),

View File

@@ -904,8 +904,8 @@ details {
}
}
.select2-container [aria-multiselectable] .select2-results__option span strike::before,
.select2-container [aria-multiselectable] .select2-results__option span span::before {
.select2-container [aria-multiselectable] .select2-results__option > span > strike:first-child::before,
.select2-container [aria-multiselectable] .select2-results__option > span > span:first-child::before {
content: "";
font-family: FontAwesome;
display: inline-block;
@@ -913,8 +913,8 @@ details {
width: 1.28571em;
text-align: center;
}
.select2-container [aria-multiselectable] .select2-results__option[aria-selected=true] span strike::before,
.select2-container [aria-multiselectable] .select2-results__option[aria-selected=true] span span::before {
.select2-container [aria-multiselectable] .select2-results__option[aria-selected=true] > span > strike:first-child::before,
.select2-container [aria-multiselectable] .select2-results__option[aria-selected=true] > span > span:first-child::before {
content: ""
}

View File

@@ -123,7 +123,7 @@ var form_handlers = function (el) {
var controls = document.getElementById(this.getAttribute("data-controls"));
var currentValue = parseFloat(controls.value);
controls.value = Math.max(controls.min, Math.min(controls.max || Number.MAX_SAFE_INTEGER, (currentValue || 0) + step));
controls.dispatchEvent(new Event("change"));
controls.dispatchEvent(new Event("change", { bubbles: true }));
});
el.find(".btn-checkbox input").on("change", function (e) {
$(this).closest(".btn-checkbox")
@@ -149,11 +149,41 @@ var form_handlers = function (el) {
).find("canvas").attr("role", "img").attr("aria-label", this.getAttribute("data-desc"));
});
el.find("input[data-exclusive-prefix]").each(function () {
var $others = $("input[name^=" + $(this).attr("data-exclusive-prefix") + "]:not([name=" + $(this).attr("name") + "])");
$(this).on('click change', function () {
if ($(this).prop('checked')) {
$others.prop('checked', false);
el.find("fieldset[data-addon-max-count]").each(function() {
// usually addons are only allowed once one per item
var multipleAllowed = this.hasAttribute("data-addon-multi-allowed");
var $inputs = $(".availability-box input", this);
var max = parseInt(this.getAttribute("data-addon-max-count"));
var desc = $(".addon-count-desc", this).text().trim();
this.addEventListener("change", function (e) {
var variations = e.target.closest(".variations");
if (variations && !multipleAllowed && e.target.checked) {
// uncheck all other checkboxes inside this variations
$(".availability-box input:checked", variations).not(e.target).prop("checked", false).trigger("change");
}
if (max === 1) {
if (e.target.checked) {
$inputs.filter(":checked").not(e.target).prop("checked", false).trigger("change");
}
return;
}
var total = $inputs.toArray().reduce(function(a, e) {
return a + (e.type == "checkbox" ? (e.checked ? parseInt(e.value) : 0) : parseInt(e.value) || 0);
}, 0);
if (total > max) {
if (e.target.type == "checkbox") {
e.target.checked = false;
} else {
e.target.value = e.target.value - (total - max);
}
$(e.target).trigger("change").closest(".availability-box").tooltip({
"title": desc,
}).tooltip('show');
e.preventDefault();
} else {
$(".availability-box", this).tooltip('destroy')
}
});
});