Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove event zero ingredient warning #561

Merged
merged 1 commit into from
Aug 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading