From 89b38111cd13f866e95ad1a8a2acd78e370af248 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Tue, 9 Aug 2022 07:20:30 +0100 Subject: [PATCH] Make more fields searchable and fix tags loading without results --- core/templates/ui/drilldown/drilldown.html | 12 ++++---- .../ui/drilldown/table_results_partial.html | 29 ++++++++++++++++++- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/core/templates/ui/drilldown/drilldown.html b/core/templates/ui/drilldown/drilldown.html index 86270b9..38bf0ee 100644 --- a/core/templates/ui/drilldown/drilldown.html +++ b/core/templates/ui/drilldown/drilldown.html @@ -26,11 +26,7 @@ inputTags.BulmaTagsInput().on('after.remove', function(item) { var spl = item.split(": "); var field = spl[0]; - try { - var value = JSON.parse(spl[1]); - } catch { - var value = spl[1].trim(); - } + var value = spl[1].trim(); populateSearch(field, value); }); } @@ -76,7 +72,7 @@ // } if (field == "src") { - document.getElementById("source").selectedIndex = 0; + document.getElementById("source").selectedIndex = 2; } if (queryElement.value.startsWith(" AND ")) { queryElement.value = queryElement.value.replace(" AND ", ""); @@ -370,6 +366,10 @@ {% endif %} --> {% if table %} {% include 'ui/drilldown/table_results.html' %} + {% else %} + {% endif %} diff --git a/core/templates/ui/drilldown/table_results_partial.html b/core/templates/ui/drilldown/table_results_partial.html index bfe764e..daecdbd 100644 --- a/core/templates/ui/drilldown/table_results_partial.html +++ b/core/templates/ui/drilldown/table_results_partial.html @@ -78,7 +78,13 @@ {% for column, cell in row.items %} {% if column.name in show and not column.name in hide %} {% block table.tbody.td %} - {% if column.name == 'src' %} + {% if cell == '—' %} + + + + + + {% elif column.name == 'src' %} @@ -218,6 +224,27 @@ {{ cell }} + {% elif column.name == 'nick_id' %} + + + {{ cell }} + + + {% elif column.name == 'user_id' %} + + + {{ cell }} + + + {% elif column.name == 'channel_id' %} + + + {{ cell }} + + {% elif cell == True or cell == False %} {% if cell == True %}