From 404e915776da4f07c8dc33b901b91736d7b95f2b Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 29 Aug 2018 17:25:18 +0200 Subject: Ellipis plugin for datatable - truncate too long text --- ishtar_common/templates/base.html | 1 + ishtar_common/templates/blocks/DataTables.html | 5 +++-- .../templates/ishtar/blocks/window_tables/dynamic_documents.html | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'ishtar_common/templates') diff --git a/ishtar_common/templates/base.html b/ishtar_common/templates/base.html index 72c6a9b65..f2ed41243 100644 --- a/ishtar_common/templates/base.html +++ b/ishtar_common/templates/base.html @@ -19,6 +19,7 @@ src="{{STATIC_URL}}datatables/datatables.min.js?ver={{VERSION}}"> + diff --git a/ishtar_common/templates/blocks/DataTables.html b/ishtar_common/templates/blocks/DataTables.html index ef407d553..f2ae42412 100644 --- a/ishtar_common/templates/blocks/DataTables.html +++ b/ishtar_common/templates/blocks/DataTables.html @@ -166,7 +166,7 @@ jQuery(document).ready(function(){ 'selectAll', 'selectNone' ], - language: { + "language": { buttons: { selectAll: "{% trans 'Select all items' %}", selectNone: "{% trans 'Select none' %}" @@ -179,7 +179,8 @@ jQuery(document).ready(function(){ "columns": [ { "data": "id", "visible": false }, { "data": "link", "orderable": false },{% for col in extra_cols %} - { "data": "{{col}}", "defaultContent": "-"}{% if not forloop.last %},{% endif %}{% endfor %} + { "data": "{{col}}", "defaultContent": "-", + "render": $.fn.dataTable.render.ellipsis( 70, true ) }{% if not forloop.last %},{% endif %}{% endfor %} ] }; diff --git a/ishtar_common/templates/ishtar/blocks/window_tables/dynamic_documents.html b/ishtar_common/templates/ishtar/blocks/window_tables/dynamic_documents.html index 84a9b9b03..a9e58f3e8 100644 --- a/ishtar_common/templates/ishtar/blocks/window_tables/dynamic_documents.html +++ b/ishtar_common/templates/ishtar/blocks/window_tables/dynamic_documents.html @@ -68,7 +68,8 @@ setTimeout( "columns": [ { "data": "id", "visible": false }, { "data": "link", "orderable": false },{% for col in extra_cols %} - { "data": "{{col}}", "defaultContent": "-"}{% if not forloop.last %},{% endif %}{% endfor %} + { "data": "{{col}}", "defaultContent": "-", + "render": $.fn.dataTable.render.ellipsis( 70, true ) }{% if not forloop.last %},{% endif %}{% endfor %} ] }; $.extend(datatable_options, datatables_default); -- cgit v1.2.3