From bf47da521c743118c5b24b45b6277644f1ead7e4 Mon Sep 17 00:00:00 2001 From: Richard Schreiber Date: Wed, 21 May 2025 13:31:05 +0200 Subject: [PATCH] [A11y] add heading-level to product list (#5121) --- .../static/pretixpresale/js/widget/widget.js | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/pretix/static/pretixpresale/js/widget/widget.js b/src/pretix/static/pretixpresale/js/widget/widget.js index baacf1c139..260606e946 100644 --- a/src/pretix/static/pretixpresale/js/widget/widget.js +++ b/src/pretix/static/pretixpresale/js/widget/widget.js @@ -471,7 +471,7 @@ Vue.component('variation', { // Variation description + '
' + '
' - + '{{ variation.value }}' + + '{{ variation.value }}' + '
' + '

' @@ -500,6 +500,7 @@ Vue.component('variation', { props: { variation: Object, item: Object, + category: Object, }, computed: { orig_price: function () { @@ -523,6 +524,9 @@ Vue.component('variation', { aria_labelledby: function () { return [this.variation_label_id, this.variation_price_id].join(" "); }, + headingLevel: function () { + return this.category.name ? '5' : '4'; + }, } }); Vue.component('item', { @@ -533,12 +537,12 @@ Vue.component('item', { + '

' + '' + '
' - + '' + '{{ item.name }}' + '' - + '{{ item.name }}' + + '{{ item.name }}' + '
' + '

' + '{{ min_order_str }}' @@ -572,13 +576,14 @@ Vue.component('item', { // Variations + '

' - + '' + + '' + '' + '
' + '
'), props: { item: Object, + category: Object, }, data: function () { return { @@ -636,6 +641,9 @@ Vue.component('item', { picture_alt_text: function () { return django.interpolate(strings["image_of"], [this.item.name]); }, + headingLevel: function () { + return this.category.name ? '4' : '3'; + }, item_label_id: function () { return this.$root.html_id + '-item-label-' + this.item.id; }, @@ -687,7 +695,7 @@ Vue.component('category', { + '
' + '
' + '
' - + '' + + '' + '
' + '
'), props: { @@ -1002,7 +1010,7 @@ Vue.component('pretix-widget-event-form', { // Event name + '
' - + '{{ $root.name }}' + + '{{ $root.name }}' + '
' // Date range