New implementation of sales channels (#4111)

Co-authored-by: Martin Gross <gross@rami.io>
This commit is contained in:
Raphael Michel
2024-06-30 19:24:30 +02:00
committed by GitHub
parent 95511b0330
commit 4fb5c6bef0
174 changed files with 2902 additions and 616 deletions

View File

@@ -45,9 +45,26 @@ $(function () {
$el.find(".variation-error").toggleClass("hidden", !(
$el.find(".alert-danger, .has-error").length
));
$el.find("input[name$=-sales_channels]").each(function () {
$el.find("input[name$=-limit_sales_channels]").each(function () {
console.log(
$(this).val(),
$el.find(".variation-channel-" + $(this).val()),
(
$(this).closest("[data-formset-form]").find("input[name$=-all_sales_channels]").prop("checked") ||
$(this).prop("checked")
), (
$("input[name=all_sales_channels]").prop("checked") ||
$("input[name=limit_sales_channels][value=" + $(this).val() + "]").prop("checked")
)
)
$el.find(".variation-channel-" + $(this).val()).toggleClass("variation-icon-hidden", !(
$(this).prop("checked") && $("input[name=sales_channels][value=" + $(this).val() + "]").prop("checked")
(
$(this).closest("[data-formset-form]").find("input[name$=-all_sales_channels]").prop("checked") ||
$(this).prop("checked")
) && (
$("input[name=all_sales_channels]").prop("checked") ||
$("input[name=limit_sales_channels][value=" + $(this).val() + "]").prop("checked")
)
));
})
}
@@ -57,7 +74,7 @@ $(function () {
update_variation_summary($el);
$(this).on("change dp.change", "input", function () {update_variation_summary($el)});
});
$("input[name=sales_channels]").on("change", function() {
$("input[name=limit_sales_channels] input[name=all_sales_channels]").on("change", function() {
$("#item_variations [data-formset-form]").each(function () {
update_variation_summary($(this));
});

View File

@@ -925,6 +925,11 @@ tbody th {
margin-left: -1px;
}
.fa-like-image {
width: 1.28571em;
height: auto;
}
@import "../../pretixbase/scss/_rtl.scss";
@import "../../bootstrap/scss/_rtl.scss";
@import "_rtl.scss";