From 455da73b95654ed4d2e278498aaadf22ca7e4e03 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Thu, 9 Feb 2023 19:09:32 +0000 Subject: [PATCH] Improve results rendering --- core/templates/base.html | 6 ++++ core/templates/partials/results_table.html | 33 +++++++++++++++++++++- core/templatetags/splitstr.py | 8 ++++++ 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 core/templatetags/splitstr.py diff --git a/core/templates/base.html b/core/templates/base.html index e5b6a83..83e6282 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -212,6 +212,12 @@ z-index: 39 !important; } + .small-field { + overflow: hidden; + text-overflow: ellipsis; + overflow-y: hidden; + } + {# Yes it's in the source, fight me #}
@@ -168,6 +170,13 @@

{{ row.cells.date }}

{{ row.cells.time }}

+ {% elif column.name == 'match_ts' %} + + {% with match_ts=cell|splitstr:'T' %} +

{{ match_ts.0 }}

+

{{ match_ts.1 }}

+ {% endwith %} + {% elif column.name == 'type' or column.name == 'mtype' %} {% elif column.name == "meta" %} -
{{ cell|pretty }}
+
{{ cell|pretty }}
+ + {% elif 'id' in column.name %} + +
{% else %} diff --git a/core/templatetags/splitstr.py b/core/templatetags/splitstr.py new file mode 100644 index 0000000..fa0d11c --- /dev/null +++ b/core/templatetags/splitstr.py @@ -0,0 +1,8 @@ +from django import template + +register = template.Library() + + +@register.filter +def splitstr(value, arg): + return value.split(arg) \ No newline at end of file