Calendar is now displayed on home page and recipes can be scheduled without being logged
This commit is contained in:
parent
ccb1248da3
commit
37721ac3ea
22 changed files with 538 additions and 166 deletions
|
|
@ -1,5 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="{{ tr.current_lang_and_territory_code() }}">
|
||||
<html lang="{{ tr.current_lang_and_territory_code() }}" data-user-logged="{{ user.is_some() }}" >
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
|
|
|||
|
|
@ -45,4 +45,8 @@
|
|||
{% endfor %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<div id="hidden-templates-calendar">
|
||||
<div class="scheduled-recipe"><a></a><span class="remove-scheduled-recipe">X</span></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
{% block content %}
|
||||
|
||||
<div class="content" id="home">
|
||||
HOME: TODO
|
||||
{% include "calendar.html" %}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
|
@ -9,9 +9,10 @@
|
|||
{% 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">{{ tr.t(Sentence::CalendarAddToPlanner) }}</span>
|
||||
{% endif %}
|
||||
|
||||
<span class="add-to-planner">{{ tr.t(Sentence::CalendarAddToPlanner) }}</span>
|
||||
|
||||
<div class="tags">
|
||||
{% for tag in recipe.tags %}
|
||||
<span class="tag">{{ tag }}</span>
|
||||
|
|
@ -81,17 +82,21 @@
|
|||
|
||||
<div id="hidden-templates">
|
||||
{# To create a modal dialog to choose a date and and servings #}
|
||||
{% if let Some(user) = user %}
|
||||
<div class="date-and-servings" >
|
||||
{% include "calendar.html" %}
|
||||
<label for="input-servings">{{ tr.t(Sentence::RecipeServings) }}</label>
|
||||
<input
|
||||
id="input-servings"
|
||||
type="number"
|
||||
step="1" min="1" max="100"
|
||||
value="{{ user.default_servings }}"/>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="date-and-servings" >
|
||||
{% include "calendar.html" %}
|
||||
<label for="input-servings">{{ tr.t(Sentence::RecipeServings) }}</label>
|
||||
<input
|
||||
id="input-servings"
|
||||
type="number"
|
||||
step="1" min="1" max="100"
|
||||
value="
|
||||
{% if let Some(user) = user %}
|
||||
{{ user.default_servings }}
|
||||
{% else %}
|
||||
4
|
||||
{% endif %}
|
||||
"/>
|
||||
</div>
|
||||
|
||||
<span class="calendar-add-to-planner-success">{{ tr.t(Sentence::CalendarAddToPlannerSuccess) }}</span>
|
||||
<span class="calendar-add-to-planner-already-exists">{{ tr.t(Sentence::CalendarAddToPlannerAlreadyExists) }}</span>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue