Add a calendar to schedule a recipe to a chosen date (WIP)
This commit is contained in:
parent
d9449de02b
commit
9d3f9e9c60
15 changed files with 441 additions and 62 deletions
45
backend/templates/calendar.html
Normal file
45
backend/templates/calendar.html
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
<div class="calendar">
|
||||
<div class="month-selector">
|
||||
<span class="prev">PREV</span>
|
||||
<span class="year" ></span>
|
||||
|
||||
{% for month in [
|
||||
Sentence::CalendarJanuary,
|
||||
Sentence::CalendarFebruary,
|
||||
Sentence::CalendarMarch,
|
||||
Sentence::CalendarApril,
|
||||
Sentence::CalendarMay,
|
||||
Sentence::CalendarJune,
|
||||
Sentence::CalendarJuly,
|
||||
Sentence::CalendarAugust,
|
||||
Sentence::CalendarSeptember,
|
||||
Sentence::CalendarOctober,
|
||||
Sentence::CalendarNovember,
|
||||
Sentence::CalendarDecember,
|
||||
] %}
|
||||
<span class="month">{{ tr.t(*month) }}</span>
|
||||
{% endfor %}
|
||||
|
||||
<span class="next">NEXT</span>
|
||||
</div>
|
||||
<ul class="weekdays">
|
||||
{% for day in [
|
||||
Sentence::CalendarMondayAbbreviation,
|
||||
Sentence::CalendarTuesdayAbbreviation,
|
||||
Sentence::CalendarWednesdayAbbreviation,
|
||||
Sentence::CalendarThursdayAbbreviation,
|
||||
Sentence::CalendarFridayAbbreviation,
|
||||
Sentence::CalendarSaturdayAbbreviation,
|
||||
Sentence::CalendarSundayAbbreviation,
|
||||
] %}
|
||||
<li class="weekday">{{ tr.t(*day) }}</li>
|
||||
{% endfor %}
|
||||
|
||||
<ul class="days">
|
||||
{% for i in 0..7 %}
|
||||
{% for j in 0..5 %}
|
||||
<li id="day-{{i}}{{j}}"></li>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
|
@ -5,8 +5,11 @@
|
|||
<div class="content" id="recipe-view">
|
||||
<h2 class="recipe-title" >{{ recipe.title }}</h2>
|
||||
|
||||
{% if user.is_some() && crate::data::model::can_user_edit_recipe(&user.as_ref().unwrap(), &recipe) %}
|
||||
<a class="edit-recipe" href="/recipe/edit/{{ recipe.id }}" >Edit</a>
|
||||
{% if let Some(user) = user %}
|
||||
{% if crate::data::model::can_user_edit_recipe(user, recipe) %}
|
||||
<a class="edit-recipe" href="/recipe/edit/{{ recipe.id }}" >Edit</a>
|
||||
{% endif %}
|
||||
<span class="add-to-planner">Add to planner</span>
|
||||
{% endif %}
|
||||
|
||||
<div class="tags">
|
||||
|
|
@ -27,7 +30,6 @@
|
|||
{% else %}
|
||||
{% endmatch %}
|
||||
|
||||
|
||||
{% match recipe.estimated_time %}
|
||||
{% when Some(time) %}
|
||||
{{ time +}} {{+ tr.t(Sentence::RecipeEstimatedTimeMinAbbreviation) }}
|
||||
|
|
@ -76,6 +78,10 @@
|
|||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<div id="hidden-templates">
|
||||
{% include "calendar.html" %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue