From da2ca9b8f1d259ba32650ccb7a759f0e34320759 Mon Sep 17 00:00:00 2001 From: Paul Marillonnet Date: Mon, 29 Jan 2018 19:31:44 +0100 Subject: [PATCH] WIP add additional read-only information in main table (#21486) --- fargo/fargo/tables.py | 4 ++-- fargo/templates/fargo/table.html | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/fargo/fargo/tables.py b/fargo/fargo/tables.py index 11ea936..3b0864d 100644 --- a/fargo/fargo/tables.py +++ b/fargo/fargo/tables.py @@ -7,7 +7,7 @@ from . import models class DocumentTable(tables.Table): '''Display the list of documents of the user''' - filename = tables.Column(verbose_name=_('filename').title()) + title = tables.Column(verbose_name=_('title').title()) size = tables.TemplateColumn(template_code='{{ record.document.content.size|filesizeformat }}', orderable=False, verbose_name=_('size').title()) @@ -15,5 +15,5 @@ class DocumentTable(tables.Table): class Meta: model = models.Document - fields = ('filename', 'size', 'created') + fields = ('title', '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..9859eed 100644 --- a/fargo/templates/fargo/table.html +++ b/fargo/templates/fargo/table.html @@ -28,9 +28,9 @@ {% 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 +44,12 @@ {% endblock %} + + + {% if row.record.description %}{{row.record.description}}{% else %}{% trans "No description available." %}{% endif %} + ({% trans "filename: " %}{{row.record.filename}}{% if row.record.expiration_date %} ; {% trans "valid until: " %}{{row.record.expiration_date}}{% endif %}) + + {% endblock table.tbody.row %} {% block pagination.cardinality %} -- 2.16.2