From 229098856cfdf90a285fa55684c1c6eb23187b4f Mon Sep 17 00:00:00 2001 From: Paul Marillonnet Date: Mon, 29 Jan 2018 19:31:44 +0100 Subject: [PATCH] add additional read-only information in main table (#21486) --- fargo/fargo/tables.py | 3 +-- fargo/templates/fargo/table.html | 13 +++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/fargo/fargo/tables.py b/fargo/fargo/tables.py index 11ea936..1a3ab42 100644 --- a/fargo/fargo/tables.py +++ b/fargo/fargo/tables.py @@ -7,7 +7,6 @@ from . import models class DocumentTable(tables.Table): '''Display the list of documents of the user''' - filename = tables.Column(verbose_name=_('filename').title()) size = tables.TemplateColumn(template_code='{{ record.document.content.size|filesizeformat }}', orderable=False, verbose_name=_('size').title()) @@ -15,5 +14,5 @@ class DocumentTable(tables.Table): class Meta: model = models.Document - fields = ('filename', 'size', 'created') + fields = ('size', 'created') empty_text = _('You currently have no documents') diff --git a/fargo/templates/fargo/table.html b/fargo/templates/fargo/table.html index a2d002c..0bb0dc0 100644 --- a/fargo/templates/fargo/table.html +++ b/fargo/templates/fargo/table.html @@ -5,6 +5,7 @@ {% block table.thead %} + Title {% for column in table.columns %} {% if column.orderable %} @@ -24,13 +25,16 @@ {# avoid cycle for Django 1.2-1.6 compatibility #} + + {% if row.record.title %}{{ row.record.title }}{% else %}{{ row.record.filename }}{% endif %} + {% for column, cell in row.items %} {% if column.localize == None %}{{ cell }}{% else %}{% if column.localize %}{{ cell|localize }}{% else %}{{ cell|unlocalize }}{% endif %}{% endif %} {% endfor %} {% with url=row.record.get_thumbnail_url %} - {% if url %}{% endif %} + {% if url %}{% endif %} {% endwith %} - + {% block action-column %} {% if include_edit_link %} @@ -44,6 +48,11 @@ {% endblock %} + {% if row.record.description %} + + {{row.record.description}} + + {% endif %} {% endblock table.tbody.row %} {% block pagination.cardinality %} -- 2.16.2