diff --git a/cookbook/tables.py b/cookbook/tables.py index 5c1fdde1..57ffa94f 100644 --- a/cookbook/tables.py +++ b/cookbook/tables.py @@ -14,7 +14,7 @@ class ImageUrlColumn(tables.Column): class RecipeTable(tables.Table): - id = tables.LinkColumn('edit_recipe', args=[A('id')]) + edit = tables.TemplateColumn("" + _('Edit') + "") name = tables.LinkColumn('view_recipe', args=[A('id')]) all_tags = tables.Column( attrs={'td': {'class': 'd-none d-lg-table-cell'}, 'th': {'class': 'd-none d-lg-table-cell'}}) @@ -23,7 +23,7 @@ class RecipeTable(tables.Table): class Meta: model = Recipe template_name = 'recipes_table.html' - fields = ('id', 'name', 'all_tags', 'image', 'instructions') + fields = ('id', 'name', 'all_tags', 'image', 'instructions', 'working_time', 'waiting_time') class KeywordTable(tables.Table): diff --git a/cookbook/templates/recipes_table.html b/cookbook/templates/recipes_table.html index 151ef966..9f7f3535 100644 --- a/cookbook/templates/recipes_table.html +++ b/cookbook/templates/recipes_table.html @@ -2,6 +2,7 @@ {% load i18n %} {% load django_tables2 %} {% load static %} +{% load custom_tags %} {% block content %}
@@ -25,11 +26,20 @@
{{ row.cells.name }}
-

This is a wider card with supporting text below as a - natural - lead-in to additional content. This content is a little bit longer.

-

Last updated 3 mins - ago

+

{{ row.cells.all_tags }} +

+

+ {% if row.cells.working_time != 0 %} + {% trans 'Preparation time ca.' %} {{ row.cells.working_time }} min + {% endif %} + + {% if row.cells.waiting_time != 0 %} + {% trans 'Waiting time ca.' %} {{ row.cells.waiting_time }} min + {% endif %} {{ row.cells.edit }}

+