display log info

This commit is contained in:
vabene1111
2020-05-02 21:44:12 +02:00
parent 6abe6f2ee4
commit f00ee7d9fa
3 changed files with 57 additions and 15 deletions

View File

@@ -48,7 +48,8 @@
{% block content %}
<div class="row">
<div class="col col-md-8">
<h3>{{ recipe.name }} <a href="{% url 'edit_recipe' recipe.pk %}" class="d-print-none"><i
{% recipe_rating recipe request.user as rating %}
<h3>{{ recipe.name }} {{ rating|safe }} <a href="{% url 'edit_recipe' recipe.pk %}" class="d-print-none"><i
class="fas fa-pencil-alt"></i></a></h3>
</div>
<div class="col col-md-4 d-print-none" style="text-align: right">
@@ -64,7 +65,8 @@
data-placement="top" title="{% trans 'Add to Mealplan' %}"><i
class="fas fa-calendar"></i></a>
<button class="btn btn-warning" onclick="openCookLogModal({{ recipe.pk }})" data-toggle="tooltip"
data-placement="top" title="{% trans 'Log Cooking' %}"><i class="fas fa-clipboard-list"></i></button>
data-placement="top" title="{% trans 'Log Cooking' %}"><i class="fas fa-clipboard-list"></i>
</button>
<a class="btn btn-light" onclick="window.print()" data-toggle="tooltip"
data-placement="top" title="{% trans 'Print' %}"><i
class="fas fa-print"></i></a>
@@ -102,6 +104,10 @@
class="badge badge-secondary"><i
class="far fa-clock"></i> {% trans 'Waiting time ca.' %} {{ recipe.waiting_time }} min </span>
{% endif %}
{% recipe_last recipe request.user as last %}
{% if last %}
<span class="badge badge-primary">{% trans 'Last cooked' %} {{ last|date }}</span>
{% endif %}
{% if recipe.waiting_time and recipe.waiting_time != 0 or recipe.working_time and recipe.working_time != 0 %}
<br/>
@@ -382,7 +388,7 @@
});
function roundToTwo(num) {
return +(Math.round(num + "e+2") + "e-2");
return +(Math.round(num + "e+2") + "e-2");
}
function reloadIngredients() {

View File

@@ -20,14 +20,17 @@
{% else %}
<img src="{% static 'recipe_no_image.svg' %}"
alt="{% trans 'Recipe Image' %}"
class="card-img d-none d-lg-block" style="object-fit: inherit; height: 10vh">
class="card-img d-none d-lg-block"
style="object-fit: inherit; height: 10vh">
{% endif %}
</div>
<div class="col-md-8">
<div class="card-body">
<h5 class="card-title">{{ row.cells.name }}</h5>
<h5 class="card-title">{{ row.cells.name }}
{% recipe_rating row.record request.user as rating %}
{{ rating|safe }}
</h5>
<p class="card-text{% if not row.record.all_tags %} d-none d-lg-block{% endif %}">
{{ row.cells.all_tags }}
</p>
@@ -41,11 +44,17 @@
<span
class="badge badge-secondary"><i
class="far fa-clock"></i> {% trans 'Waiting time ca.' %} {{ row.cells.waiting_time }} min </span>
{% endif %}{% if not row.record.internal %}
<span class="badge badge-info">{% trans 'External' %} </span>
{% endif %}
{% endif %}
{% if not row.record.internal %}
<span class="badge badge-info">{% trans 'External' %} </span>
{% endif %}
{% recipe_last row.record request.user as last %}
{% if last %}
<span class="badge badge-primary">{% trans 'Last cooked' %} {{ last|date }}</span>
{% endif %}
<span class="badge badge-light">{{ row.cells.edit }}</span>
<span class="badge badge-warning"><a href="#" style="color: inherit" onclick="openCookLogModal({{ row.record.pk }})">{% trans 'Log' %}</a></span>
<span class="badge badge-warning"><a href="#" style="color: inherit"
onclick="openCookLogModal({{ row.record.pk }})">{% trans 'Log' %}</a></span>
</small></p>
</div>