-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Code and design improvements on event page * Rename day_badge template to day_card * Simplify context processors manipulation * Add (unused) custom-events controller * Add button/modal to add recipes directly from event overview * Change text * Add missing conftest import
- Loading branch information
1 parent
822dcc9
commit 7e2dcb8
Showing
23 changed files
with
171 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Controller } from "../../node_modules/@hotwired/stimulus" | ||
|
||
export default class extends Controller { | ||
static values = { "event": String } | ||
|
||
dispatch() { | ||
const event = new CustomEvent(this.eventValue) | ||
window.dispatchEvent(event) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<div class="modal fade" id="{{ modal_id }}" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true"> | ||
<div class="modal-dialog"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<h1 class="modal-title fs-5" id="exampleModalLabel">co si ještě dáme?</h1> | ||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> | ||
</div> | ||
<div class="modal-body"> | ||
<span class="col-6 mt-2"> | ||
<form class="form" action="{{ url_for('DailyPlanRecipeView:add_recipe', daily_plan_id=daily_plan.id) }}" method="post"> | ||
<div class="row"> | ||
<div class="col-8"> | ||
<select name="recipe_id" id="recipe_select" class="form-control"> | ||
{% include "daily_plans/_add_recipe_form_options.html.j2" %} | ||
</select> | ||
</div> | ||
<div class="col"> | ||
<input type="submit" class="form-control btn bg-color-primary-action color-white" value="přidat!"> | ||
</div> | ||
</div> | ||
</form> | ||
</span> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">zrušit</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{% if not day.is_active %} | ||
{% set color = "light-grey" %} | ||
{% elif day.weekday in ["neděle"] %} | ||
{% set color = "secondary-highlighted" %} | ||
{% else %} | ||
{% set color = "secondary" %} | ||
{% endif %} | ||
|
||
{% if not day.is_active %} | ||
{% set class = "opacity-50 d-none d-md-inline-block cursor-default" %} | ||
{% elif day.is_active %} | ||
{% set class = "clickable" %} | ||
{% endif %} | ||
|
||
# set daily_plan = day | ||
|
||
<div | ||
{% if day.is_active %} data-action="click->clicker#activateLink" {% endif %} | ||
class="col-12 col-md p-2 mb-2 mb-md-3 ms-2 me-2 bg-color-{{ color }} rounded text-center text-nobreak {{ class }} lh-2 text-truncate user-select-none"> | ||
|
||
<div><h2>{{ link_to(day, class="fs-5") }}</h2></div> | ||
|
||
{% if day.is_active %} | ||
|
||
<ul class="ps-0 ms-0" data-controller="sortable" | ||
data-sortable-group-value="daily-plan-recipes" | ||
data-sortable-list-id="{{day.id}}"> | ||
|
||
{% for daily_recipe in day.daily_recipes %} | ||
<li class="text-truncate" | ||
data-sortable-update-url="{{ url_for("DailyPlanRecipeView:sort", daily_recipe_id=daily_recipe.id)}}" | ||
data-sortable-move-url={{ url_for("DailyPlanRecipeView:change_daily_plan", daily_recipe_id=daily_recipe.id)}} | ||
> | ||
|
||
{% if not daily_recipe.recipe.is_shopping %} | ||
{{ link_to(daily_recipe.recipe, portion_count=daily_recipe.portion_count, style="user-select: none") }} | ||
{% else %} | ||
<span class="color-grey"> nákup </span> | ||
{% endif %} | ||
</li> | ||
{% else %} | ||
<span class="text-wrap"><em>zatím tu nejsou žádné recepty. nějaký přidej, nebo je přesuň z jiného dne</em></span> | ||
{% endfor %} | ||
|
||
</ul> | ||
|
||
<button type="button" class="btn bg-color-primary-action text-white" data-bs-toggle="modal" data-bs-target="#add-recipe-to-{{day.id}}-modal" data-controller="custom-events"> | ||
víc jídla! {{ icon("add") }} | ||
</button> | ||
|
||
{% endif %} | ||
|
||
{% if day.all_tasks %} | ||
<hr> | ||
{% for task in day.all_tasks %} | ||
{{ task }} <br> | ||
{% endfor %} | ||
{% endif %} | ||
|
||
</div> | ||
|
||
{% with modal_id="add-recipe-to-"~day.id~"-modal" %} | ||
{% include "daily_plans/_add_recipe_modal.html.j2" %} | ||
{% endwith %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.