rating/last cooked display

This commit is contained in:
vabene1111
2020-05-02 21:54:38 +02:00
parent 598387efc8
commit 76e1274ba5
3 changed files with 16 additions and 7 deletions

View File

@@ -1,4 +1,5 @@
{% extends "base.html" %}
{% load custom_tags %}
{% load i18n %}
{% block title %}{% trans 'Recipe Books' %}{% endblock %}
@@ -37,7 +38,15 @@
<li class="list-group-item">
<div class="row">
<div class="col-10">
{% recipe_last r.recipe request.user as last_cooked %}
<a href="{% url 'view_recipe' r.recipe.pk %}">{{ r.recipe.name }}</a>
{% recipe_rating r.recipe request.user as rating %}
{{ rating|safe }}
{% if last_cooked %}
&nbsp;
<span class="badge badge-primary">{% trans 'Last cooked' %} {{ last_cooked|date }}</span>
{% endif %}
</div>
<div class="col-2" style="text-align: right">
<a href="{% url 'delete_recipe_book_entry' r.pk %}"

View File

@@ -104,12 +104,12 @@
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>
{% recipe_last recipe request.user as last_cooked %}
{% if last_cooked %}
<span class="badge badge-primary">{% trans 'Last cooked' %} {{ last_cooked|date }}</span>
{% endif %}
{% if recipe.waiting_time and recipe.waiting_time != 0 or recipe.working_time and recipe.working_time != 0 %}
{% if recipe.waiting_time and recipe.waiting_time != 0 or recipe.working_time and recipe.working_time != 0 or last_cooked%}
<br/>
<br/>
{% endif %}

View File

@@ -48,9 +48,9 @@
{% 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>
{% recipe_last row.record request.user as last_cooked %}
{% if last_cooked %}
<span class="badge badge-primary">{% trans 'Last cooked' %} {{ last_cooked|date }}</span>
{% endif %}
<span class="badge badge-light">{{ row.cells.edit }}</span>
<span class="badge badge-warning"><a href="#" style="color: inherit"