Recipe edit (WIP)
This commit is contained in:
parent
fce4eade73
commit
c6dfff065c
24 changed files with 1157 additions and 971 deletions
|
|
@ -1,23 +1,69 @@
|
|||
{% extends "base_with_list.html" %}
|
||||
|
||||
{% block content %}
|
||||
<label for="title_field">Title</label>
|
||||
<input
|
||||
id="title_field"
|
||||
type="text"
|
||||
name="title"
|
||||
value="{{ recipe.title }}"
|
||||
autocapitalize="none"
|
||||
autocomplete="title"
|
||||
autofocus="autofocus" />
|
||||
{% macro is_difficulty(diff) %}
|
||||
{% if recipe.difficulty == diff %}
|
||||
selected
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="content" id="recipe-edit">
|
||||
<label for="input-title">Title</label>
|
||||
<input
|
||||
id="input-title"
|
||||
type="text"
|
||||
name="title"
|
||||
value="{{ recipe.title }}"
|
||||
autocomplete="title"
|
||||
autofocus="true" />
|
||||
|
||||
<label for="input-description">Description</label>
|
||||
<input
|
||||
id="input-description"
|
||||
type="text"
|
||||
name="description"
|
||||
value="{{ recipe.description }}"
|
||||
autocomplete="title" />
|
||||
|
||||
<label for="input-description">Estimated time</label>
|
||||
<input
|
||||
id="input-estimated-time"
|
||||
type="number"
|
||||
name="estimated-time"
|
||||
value="
|
||||
{% match recipe.estimated_time %}
|
||||
{% when Some with (t) %}
|
||||
{{ t }}
|
||||
{% when None %}
|
||||
0
|
||||
{% endmatch %}"
|
||||
autocomplete="title" />
|
||||
|
||||
<label for="select-difficulty">Difficulty</label>
|
||||
<select id="select-difficulty" name="difficulty">
|
||||
<option value="0" {%+ call is_difficulty(crate::data::model::Difficulty::Unknown) %}> - </option>
|
||||
<option value="1" {%+ call is_difficulty(crate::data::model::Difficulty::Easy) %}>Easy</option>
|
||||
<option value="2" {%+ call is_difficulty(crate::data::model::Difficulty::Medium) %}>Medium</option>
|
||||
<option value="3" {%+ call is_difficulty(crate::data::model::Difficulty::Hard) %}>Hard</option>
|
||||
</select>
|
||||
|
||||
<label for="select-language">Language</label>
|
||||
<select id="select-language" name="language">
|
||||
{% for lang in languages %}
|
||||
<option value="{{ lang.1 }}">{{ lang.0 }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
<input
|
||||
id="input-is-published"
|
||||
type="checkbox"
|
||||
name="is-published"
|
||||
value="{{ recipe.is_published }}" />
|
||||
<label for="input-is-published">Is published</label>
|
||||
|
||||
<div id="groups-container">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label for="description_field">Description</label>
|
||||
<input
|
||||
id="title_field"
|
||||
type="text"
|
||||
name="title"
|
||||
value="{{ recipe.description }}"
|
||||
autocapitalize="none"
|
||||
autocomplete="title"
|
||||
autofocus="autofocus" />
|
||||
{% endblock %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue