Widget: Deprecate "style" parameter, prefer "list-type"

"style" is problematic since it clashes with an HTML5 attribute
This commit is contained in:
Raphael Michel
2023-02-17 09:24:57 +01:00
parent 076f279a60
commit bb8657637f
2 changed files with 6 additions and 6 deletions

View File

@@ -153,9 +153,9 @@ If you want to include all your public events, you can just reference your organ
There is an optional ``style`` parameter that let's you choose between a monthly calendar view, a week view and a list There is an optional ``style`` parameter that let's you choose between a monthly calendar view, a week view and a list
view. If you do not set it, the choice will be taken from your organizer settings:: view. If you do not set it, the choice will be taken from your organizer settings::
<pretix-widget event="https://pretix.eu/demo/series/" style="list"></pretix-widget> <pretix-widget event="https://pretix.eu/demo/series/" list-type="list"></pretix-widget>
<pretix-widget event="https://pretix.eu/demo/series/" style="calendar"></pretix-widget> <pretix-widget event="https://pretix.eu/demo/series/" list-type="calendar"></pretix-widget>
<pretix-widget event="https://pretix.eu/demo/series/" style="week"></pretix-widget> <pretix-widget event="https://pretix.eu/demo/series/" list-type="week"></pretix-widget>
If you have more than 100 events, the system might refuse to show a list view and always show a calendar for performance If you have more than 100 events, the system might refuse to show a list view and always show a calendar for performance
reasons instead. reasons instead.
@@ -164,7 +164,7 @@ You can see an example here:
.. raw:: html .. raw:: html
<pretix-widget event="https://pretix.eu/demo/series/" style="calendar"></pretix-widget> <pretix-widget event="https://pretix.eu/demo/series/" list-type="calendar"></pretix-widget>
<noscript> <noscript>
<div class="pretix-widget"> <div class="pretix-widget">
<div class="pretix-widget-info-message"> <div class="pretix-widget-info-message">
@@ -176,7 +176,7 @@ You can see an example here:
You can filter events by meta data attributes. You can create those attributes in your order profile and set their values in both event and series date You can filter events by meta data attributes. You can create those attributes in your order profile and set their values in both event and series date
settings. For example, if you set up a meta data property called "Promoted" that you set to "Yes" on some events, you can pass a filter like this:: settings. For example, if you set up a meta data property called "Promoted" that you set to "Yes" on some events, you can pass a filter like this::
<pretix-widget event="https://pretix.eu/demo/series/" style="list" filter="attr[Promoted]=Yes"></pretix-widget> <pretix-widget event="https://pretix.eu/demo/series/" list-type="list" filter="attr[Promoted]=Yes"></pretix-widget>
pretix Button pretix Button
------------- -------------

View File

@@ -1732,7 +1732,7 @@ var create_widget = function (element) {
} }
var voucher = element.attributes.voucher ? element.attributes.voucher.value : null; var voucher = element.attributes.voucher ? element.attributes.voucher.value : null;
var subevent = element.attributes.subevent ? element.attributes.subevent.value : null; var subevent = element.attributes.subevent ? element.attributes.subevent.value : null;
var style = element.attributes.style ? element.attributes.style.value : null; var style = element.attributes["list-type"] ? element.attributes["list-type"].value : (element.attributes.style ? element.attributes.style.value : null);
var skip_ssl = element.attributes["skip-ssl-check"] ? true : false; var skip_ssl = element.attributes["skip-ssl-check"] ? true : false;
var disable_iframe = element.attributes["disable-iframe"] ? true : false; var disable_iframe = element.attributes["disable-iframe"] ? true : false;
var disable_vouchers = element.attributes["disable-vouchers"] ? true : false; var disable_vouchers = element.attributes["disable-vouchers"] ? true : false;