Apply suggestions from code review

Co-authored-by: Richard Schreiber <schreiber@rami.io>
This commit is contained in:
Mira
2024-10-11 11:11:08 +02:00
committed by GitHub
parent 0191d258ab
commit 6c52cc8157
5 changed files with 13 additions and 3 deletions

View File

@@ -28,10 +28,11 @@ cross_selling_mode string If ``null``, cr
step. step.
If ``"both"``, it is visible on the normal index page If ``"both"``, it is visible on the normal index page
as well. as well.
Only available if ``is_addon`` is ``false``.
cross_selling_condition string Only relevant if ``cross_selling_mode`` is not ``null``. cross_selling_condition string Only relevant if ``cross_selling_mode`` is not ``null``.
If ``"always"``, always show in cross-selling step. If ``"always"``, always show in cross-selling step.
If ``"products"``, only show if the cart contains one of If ``"products"``, only show if the cart contains one of
these products. the products listed in ``cross_selling_match_products``.
If ``"discounts"``, only show products that qualify for If ``"discounts"``, only show products that qualify for
a discount according to discount rules. a discount according to discount rules.
cross_selling_match_products list of integer Only relevant if ``cross_selling_condition`` is cross_selling_match_products list of integer Only relevant if ``cross_selling_condition`` is

View File

@@ -122,8 +122,8 @@ class ItemCategory(LoggedModel):
) )
CROSS_SELLING_CONDITION = ( CROSS_SELLING_CONDITION = (
('always', _('Always show in cross-selling step')), ('always', _('Always show in cross-selling step')),
('products', _('Only if the cart contains one of these products')),
('discounts', _('Only show products that qualify for a discount according to discount rules')), ('discounts', _('Only show products that qualify for a discount according to discount rules')),
('products', _('Only show if the cart contains one of the following products')),
) )
cross_selling_condition = models.CharField( cross_selling_condition = models.CharField(
verbose_name=_("Cross-selling condition"), verbose_name=_("Cross-selling condition"),

View File

@@ -1617,6 +1617,7 @@ def set_cart_addons(self, event: Event, addons: List[dict], add_to_cart_items: L
ensure the requested addon state. ensure the requested addon state.
:param event: The event ID in question :param event: The event ID in question
:param addons: A list of dicts with the keys addon_to, item, variation :param addons: A list of dicts with the keys addon_to, item, variation
:param add_to_cart_items: A list of dicts with the keys item, variation, count, custom_price, voucher, seat ID
:param cart_id: The cart ID of the cart to modify :param cart_id: The cart ID of the cart to modify
""" """
with language(locale), time_machine_now_assigned(override_now_dt): with language(locale), time_machine_now_assigned(override_now_dt):

View File

@@ -102,7 +102,7 @@ class CategoryForm(I18nModelForm):
_('Cross-selling category'), _('Products in this category are regular products, but are only shown ' _('Cross-selling category'), _('Products in this category are regular products, but are only shown '
'in the cross-selling step, according to the configuration below.'))),), 'in the cross-selling step, according to the configuration below.'))),),
('both', mark_safe('{} &nbsp; <span class="text-muted">{}</span>'.format( ('both', mark_safe('{} &nbsp; <span class="text-muted">{}</span>'.format(
_('Combined category'), _('Products in this category are regular products displayed on the front page, ' _('Normal + cross-selling category'), _('Products in this category are regular products displayed on the front page, '
'but are additionally shown in the cross-selling step, according to the configuration below.'))),), 'but are additionally shown in the cross-selling step, according to the configuration below.'))),),
)) ))
self.fields['category_type'].initial = self.instance.category_type self.fields['category_type'].initial = self.instance.category_type

View File

@@ -588,8 +588,16 @@ table td > .checkbox input[type="checkbox"] {
border-bottom: 1px solid #ccc; border-bottom: 1px solid #ccc;
} }
} }
.form-horizontal .control-label:has(+.big-radio-wrapper),
.form-horizontal .control-label:has(+div > .big-radio) {
padding-top: 16px;
}
.form-horizontal .big-radio-wrapper .radio label {
font-weight: bold;
}
.form-horizontal .big-radio-wrapper .radio label > span { .form-horizontal .big-radio-wrapper .radio label > span {
display: block; display: block;
font-weight: normal;
} }
.accordion-radio { .accordion-radio {
display: block; display: block;