several recipe view improvements

This commit is contained in:
vabene1111 2020-07-15 18:05:12 +02:00
parent 1cea0350c9
commit c9f1576b24

View File

@ -218,9 +218,11 @@
{% endif %} {% endif %}
</div> </div>
<hr> <div v-if="recipe !== undefined && recipe.steps.length > 0">
<h3>{% trans 'Instructions' %}</h3> <hr>
<hr> <h3>{% trans 'Instructions' %}</h3>
<hr>
</div>
<div style="font-size: large;" v-if="recipe"> <div style="font-size: large;" v-if="recipe">
{% for s in recipe.steps.all %} {% for s in recipe.steps.all %}
@ -229,25 +231,23 @@
{% if recipe.steps.all|length > 1 %} {% if recipe.steps.all|length > 1 %}
<div class="card-title"> <div class="card-title">
<div class="row"> <div class="row d-flex">
<div class="col-md-12 text-muted d-flex"> <div class="col-md-8 text-muted ">
<div class="flex-fill"> {% if s.type == 'TEXT' %}
{% if s.type == 'TEXT' %} <i class="fas fa-paragraph fa-fw"></i>
<i class="fas fa-paragraph fa-fw"></i> {% elif s.type == 'TIME' %}
{% elif s.type == 'TIME' %} <i class="fas fa-clock fa-fw"></i>
<i class="fas fa-clock fa-fw"></i> {% endif %}
{% endif %} {% if s.name %}{{ s.name }}{% else %}{% trans 'Step' %}
{% if s.name %}{{ s.name }}{% else %}{% trans 'Step' %} {{ forloop.counter }}{% endif %}
{{ forloop.counter }}{% endif %} {% if s.time != 0 %}
{% if s.time != 0 %} - {{ s.time }} {% trans 'Minutes' %}
- {{ s.time }} {% trans 'Minutes' %} {% endif %}
{% endif %} </div>
</div> <div class="col-md-4 col-12 justify-content-end" v-if="has_times">
<div class="flex-grow-0 justify-content-end"> <input type="datetime-local" class="form-control"
<input type="datetime-local" class="form-control" @change="updateTimes(recipe.steps[{{ forloop.counter0 }}])"
@change="updateTimes(recipe.steps[{{ forloop.counter0 }}])" v-model="recipe.steps[{{ forloop.counter0 }}].time_finished">
v-model="recipe.steps[{{ forloop.counter0 }}].time_finished">
</div>
</div> </div>
</div> </div>
</div> </div>