diff --git a/magstock/config.py b/magstock/config.py index 4e77844..51da7e1 100644 --- a/magstock/config.py +++ b/magstock/config.py @@ -26,7 +26,6 @@ class ExtraConfig: @property def FORMATTED_CAMPING_TYPES(self): # Returns camping type options for the 'card_select' form macro. - return [ {'name': 'Tent', 'icon': '', 'link': '', 'value': c.TENT, 'price': c.CAMPING_TYPE_PRICES[c.TENT], 'desc': 'Included in your registration! Tent camping is first come, first serve.'}, @@ -38,7 +37,18 @@ def FORMATTED_CAMPING_TYPES(self): 'price': 0, 'desc': 'Select a cabin option below. Cabins are limited availability.'} ] - + + @property + def SOLD_OUT_CAMPING_TYPES(self): + sold_out_types = [] + if c.CAR_STOCK and c.CAMPING_TYPES_BOUGHT[c.CAR] <= int(c.CAR_STOCK): + sold_out_types.append(c.CAR) + if c.RV_STOCK and c.CAMPING_TYPES_BOUGHT[c.RV] <= int(c.RV_STOCK): + sold_out_types.append(c.RV) + if not any(c.CABIN_AVAILABILITY_MATRIX.values()): + sold_out_types.append(c.CABIN) + return sold_out_types + @property def FORMATTED_MEAL_PLANS(self): return [ diff --git a/magstock/templates/forms/attendee/badge_extras.html b/magstock/templates/forms/attendee/badge_extras.html index 4fae4d4..0b1ecc3 100644 --- a/magstock/templates/forms/attendee/badge_extras.html +++ b/magstock/templates/forms/attendee/badge_extras.html @@ -10,7 +10,7 @@ {% if not receipt or upgrade_modal %}