class SodaMenuItemStreamBlock(StructBlock): soda_item_name = CharBlock(required=True, blank=False) soda_item_description = CharBlock(required=False) soda_item_price = DecimalBlock(required=True, blank=False, min_value=0.01) class Meta: icon = "fa-glass-whiskey" template = "wagtailrestaurantmenus/beer_menu_item_block.html"
class WineMenuItemStreamBlock(StructBlock): wine_item_name = CharBlock(required=True, blank=False) wine_item_description = CharBlock(required=False) wine_item_price = DecimalBlock(required=True, blank=False, min_value=0.01) class Meta: icon = "fa-glass" template = "wagtailrestaurantmenus/wine_menu_item_block.html"
class HotDrinksMenuItemStreamBlock(StructBlock): hot_drinks_item_name = CharBlock(required=True, blank=False) hot_drinks_item_description = CharBlock(required=False) hot_drinks_item_price = DecimalBlock(required=True, blank=False, min_value=0.01) class Meta: icon = "fa-coffee" template = "wagtailrestaurantmenus/beer_menu_item_block.html"
class BeerMenuItemStreamBlock(StructBlock): beer_item_name = CharBlock(required=True, blank=False) beer_item_description = CharBlock(required=False) beer_item_price = DecimalBlock( required=True, blank=False, min_value=0.01, ) class Meta: icon = "fa-beer" template = "wagtailrestaurantmenus/beer_menu_item_block.html"
class ChefSpecialsItemStreamBlock(StructBlock): chef_special_item_name = CharBlock(required=True, blank=False) chef_special_item_description = CharBlock(required=True, blank=False) chef_special_item_price = DecimalBlock( required=True, blank=False, min_value=0.01, help_text="Item price in decimal format e.g. 19.50") class Meta: icon = "fa-star" template = "wagtailrestaurantmenus/chef_specials_block.html"
class DessertsMenuItemStreamBlock(StructBlock): desserts_item_name = CharBlock(required=True, blank=False) desserts_item_description = CharBlock(required=True, blank=False) desserts_item_price = DecimalBlock( required=True, blank=False, min_value=0.01, help_text="Item price in decimal format e.g. 7.50") class Meta: icon = "fa-spoon" template = "wagtailrestaurantmenus/desserts_menu_item_block.html"
class MainsMenuItemStreamBlock(StructBlock): menu_item_name = CharBlock(required=True, blank=False) menu_item_description = CharBlock(required=True, blank=False) menu_item_price = DecimalBlock( required=True, blank=False, min_value=0.01, help_text="Item price in decimal format e.g. 12.50") class Meta: icon = "fa-cutlery" template = "wagtailrestaurantmenus/mains_menu_item_block.html"
class AmountBlock(StreamBlock): amount = DecimalBlock(min_value=0, max_digits=7, decimal_places=2) class Meta: icon = 'cogs' max_num = 6