From ac3a57a2e87d8ab78b25fc61eb0e8207556f43a5 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Tue, 29 Nov 2022 07:20:39 +0000 Subject: [PATCH] Begin implementing smarter WM system for multi-type objects --- core/templates/base.html | 12 +- core/templates/index.html | 190 ++++++++++++++---- core/templates/partials/close-modal.html | 1 + core/templates/partials/close-widget.html | 3 + core/templates/partials/close-window.html | 3 + .../results_load.html} | 16 +- .../results_table.html} | 34 +--- .../sentiment_chart.html} | 0 core/templates/ui/drilldown/drilldown.html | 163 --------------- core/templates/window-content/context.html | 122 ----------- .../window-content/context_table.html | 177 ---------------- core/templates/window-content/results.html | 26 +++ .../search.html} | 8 +- core/templates/windows/drilldown.html | 2 +- core/templates/wm/modal.html | 3 +- core/templates/wm/page.html | 6 + core/templates/wm/panel.html | 4 +- core/templates/wm/widget.html | 10 +- .../templates/wm/{magnet.html => window.html} | 2 + core/views/ui/drilldown.py | 183 ++++++++++++----- docker/Dockerfile | 18 ++ stack.env | 2 +- 22 files changed, 377 insertions(+), 608 deletions(-) create mode 100644 core/templates/partials/close-modal.html create mode 100644 core/templates/partials/close-widget.html create mode 100644 core/templates/partials/close-window.html rename core/templates/{widgets/table_results.html => partials/results_load.html} (66%) rename core/templates/{ui/drilldown/table_results_partial.html => partials/results_table.html} (95%) rename core/templates/{ui/drilldown/sentiment_partial.html => partials/sentiment_chart.html} (100%) delete mode 100644 core/templates/ui/drilldown/drilldown.html delete mode 100644 core/templates/window-content/context.html delete mode 100644 core/templates/window-content/context_table.html create mode 100644 core/templates/window-content/results.html rename core/templates/{ui/drilldown/search_partial.html => window-content/search.html} (99%) create mode 100644 core/templates/wm/page.html rename core/templates/wm/{magnet.html => window.html} (81%) create mode 100644 docker/Dockerfile diff --git a/core/templates/base.html b/core/templates/base.html index a2df37f..e87fe6d 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -320,8 +320,18 @@ {% endblock %}
- {% block content %} + {% block content_wrapper %} + {% block content %} + {% endblock %} {% endblock %} +
+
+
+
+
diff --git a/core/templates/index.html b/core/templates/index.html index d8b4138..3073d47 100644 --- a/core/templates/index.html +++ b/core/templates/index.html @@ -1,48 +1,152 @@ -{% extends "base.html" %} +{% extends 'base.html' %} {% load static %} +{% load joinsep %} +{% block outer_content %} + {% if params.modal == 'context' %} +
+
+ {% endif %} + + + + +
+
+
+
- {% endfor %} +
+ + + {% endblock %} +{% block widgets %} + {% if table %} + {% include 'partials/results_load.html' %} + {% endif %} +{% endblock %} \ No newline at end of file diff --git a/core/templates/partials/close-modal.html b/core/templates/partials/close-modal.html new file mode 100644 index 0000000..6c0173c --- /dev/null +++ b/core/templates/partials/close-modal.html @@ -0,0 +1 @@ + diff --git a/core/templates/partials/close-widget.html b/core/templates/partials/close-widget.html new file mode 100644 index 0000000..0c66e85 --- /dev/null +++ b/core/templates/partials/close-widget.html @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/core/templates/partials/close-window.html b/core/templates/partials/close-window.html new file mode 100644 index 0000000..894974c --- /dev/null +++ b/core/templates/partials/close-window.html @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/core/templates/widgets/table_results.html b/core/templates/partials/results_load.html similarity index 66% rename from core/templates/widgets/table_results.html rename to core/templates/partials/results_load.html index d0d5481..5f6903d 100644 --- a/core/templates/widgets/table_results.html +++ b/core/templates/partials/results_load.html @@ -1,20 +1,10 @@ {% extends 'wm/widget.html' %} {% load static %} -{% block widget_options %} - gs-w="10" gs-h="1" gs-y="10" gs-x="1" -{% endblock %} - {% block heading %} Results {% endblock %} -{% block close_button %} - -{% endblock %} - {% block panel_content %} {% include 'partials/notify.html' %} @@ -38,6 +28,6 @@ {% endif %} {% endif %} - {% include 'ui/drilldown/table_results_partial.html' %} - {% include 'ui/drilldown/sentiment_partial.html' %} -{% endblock %} + {% include 'partials/results_table.html' %} + {% include 'partials/sentiment_chart.html' %} +{% endblock %} \ No newline at end of file diff --git a/core/templates/ui/drilldown/table_results_partial.html b/core/templates/partials/results_table.html similarity index 95% rename from core/templates/ui/drilldown/table_results_partial.html rename to core/templates/partials/results_table.html index 64a37de..125bff5 100644 --- a/core/templates/ui/drilldown/table_results_partial.html +++ b/core/templates/partials/results_table.html @@ -141,10 +141,6 @@ - {% elif column.name == 'tokens' %} - - {{ cell|joinsep:',' }} - {% elif column.name == 'src' %} @@ -364,25 +360,17 @@ {% endif %} - {% elif column.name|slice:":6" == "words_" %} + {% elif column.name == "tokens" %} - {% if cell.0.1|length == 0 %} - - {{ cell }} - - {% else %} -
- {% for word in cell %} - - {{ word }} - - {% endfor %} -
- {% endif %} +
+ {% for word in cell %} + + {{ word }} + + {% endfor %} +
{% else %} diff --git a/core/templates/ui/drilldown/sentiment_partial.html b/core/templates/partials/sentiment_chart.html similarity index 100% rename from core/templates/ui/drilldown/sentiment_partial.html rename to core/templates/partials/sentiment_chart.html diff --git a/core/templates/ui/drilldown/drilldown.html b/core/templates/ui/drilldown/drilldown.html deleted file mode 100644 index 5a87b8b..0000000 --- a/core/templates/ui/drilldown/drilldown.html +++ /dev/null @@ -1,163 +0,0 @@ -{% extends "base.html" %} -{% load static %} -{% load joinsep %} -{% block outer_content %} - {% if params.modal == 'context' %} -
-
- {% endif %} - - - - -
-
-
- -
-
-
- - - -
-
-
-
- - - - -{% endblock %} diff --git a/core/templates/window-content/context.html b/core/templates/window-content/context.html deleted file mode 100644 index 3fb6811..0000000 --- a/core/templates/window-content/context.html +++ /dev/null @@ -1,122 +0,0 @@ -{% load index %} -{% load static %} - - - - - - - diff --git a/core/templates/window-content/context_table.html b/core/templates/window-content/context_table.html deleted file mode 100644 index f4e8958..0000000 --- a/core/templates/window-content/context_table.html +++ /dev/null @@ -1,177 +0,0 @@ - - - \ No newline at end of file diff --git a/core/templates/window-content/results.html b/core/templates/window-content/results.html new file mode 100644 index 0000000..f40e59a --- /dev/null +++ b/core/templates/window-content/results.html @@ -0,0 +1,26 @@ +{% load static %} + +{% include 'partials/notify.html' %} + +{% if cache is not None %} + + + +{% endif %} + +fetched {{ table.data|length }} hits in {{ took }}ms + +{% if exemption is not None %} + + + +{% else %} + {% if redacted is not None %} + + + + {% endif %} +{% endif %} + +{% include 'partials/results_table.html' %} +{% include 'partials/sentiment_chart.html' %} diff --git a/core/templates/ui/drilldown/search_partial.html b/core/templates/window-content/search.html similarity index 99% rename from core/templates/ui/drilldown/search_partial.html rename to core/templates/window-content/search.html index a70d436..cb4b50a 100644 --- a/core/templates/ui/drilldown/search_partial.html +++ b/core/templates/window-content/search.html @@ -1,6 +1,6 @@
{% csrf_token %} @@ -11,7 +11,7 @@ Search @@ -394,7 +394,7 @@
{% block modal_content %} + {% include window_content %} {% endblock %} - + {% include 'partials/close-modal.html' %}
\ No newline at end of file diff --git a/core/templates/wm/page.html b/core/templates/wm/page.html new file mode 100644 index 0000000..93ea8c1 --- /dev/null +++ b/core/templates/wm/page.html @@ -0,0 +1,6 @@ +{% extends "base.html" %} + + +{% block content %} + {% include window_content %} +{% endblock %} diff --git a/core/templates/wm/panel.html b/core/templates/wm/panel.html index e57d573..b180b38 100644 --- a/core/templates/wm/panel.html +++ b/core/templates/wm/panel.html @@ -3,9 +3,7 @@

{% block close_button %} - + {% include 'partials/close-window.html' %} {% endblock %} {% block heading %} {% endblock %} diff --git a/core/templates/wm/widget.html b/core/templates/wm/widget.html index 9bf413f..9ef8154 100644 --- a/core/templates/wm/widget.html +++ b/core/templates/wm/widget.html @@ -1,24 +1,24 @@ -

-
+
+