Skip to content

Commit

Permalink
Remove event zero ingredient warning (#561)
Browse files Browse the repository at this point in the history
  • Loading branch information
janpeterka committed Aug 12, 2023
1 parent 1945ad0 commit 1b462a7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
4 changes: 0 additions & 4 deletions app/models/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,6 @@ def daily_recipes_split_by_shopping(self) -> list:

return split_recipes

@property
def zero_amount_ingredient_recipes(self) -> list:
return [r for r in self.active_recipes if r.has_zero_amount_ingredient]

@property
def no_measurement_ingredient_recipes(self) -> list:
return [r for r in self.active_recipes if r.has_no_measurement_ingredient]
Expand Down
9 changes: 1 addition & 8 deletions app/templates/events/_warnings.html.j2
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
<turbo-frame id="event-warnings">
{% if event.zero_amount_ingredient_recipes
or event.empty_recipes
{% if event.empty_recipes
or event.no_measurement_ingredient_recipes
or event.no_category_ingredient_recipes
or event.recipes_without_category %}

<div class="warning m-2 mt-4 p-2 pb-3 pt-3 text-center">
<h3 class="text-uppercase font-comfortaa"> Upozornění </h3>

{% if event.zero_amount_ingredient_recipes %}
{% for recipe in event.zero_amount_ingredient_recipes %}
<li> {{ link_to(recipe, turbo=False) }} má surovinu s nulovou hodnotou </li>
{% endfor %}
{% endif %}

{% if event.empty_recipes %}
{% for recipe in event.empty_recipes %}
<li> {{ link_to(recipe, turbo=False) }} nemá suroviny </li>
Expand Down

0 comments on commit 1b462a7

Please sign in to comment.