From de97b55bc330568ca68a50a252cccbb240480f9c Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 4 Nov 2021 11:56:09 +0100 Subject: Syndication - stats UI --- .../templates/blocks/DataTables-stats-detail.html | 79 ++++++++++++++++++++ .../templates/blocks/DataTables-stats.html | 85 +++------------------- ishtar_common/templates/blocks/DataTables.html | 16 ++++ 3 files changed, 104 insertions(+), 76 deletions(-) create mode 100644 ishtar_common/templates/blocks/DataTables-stats-detail.html (limited to 'ishtar_common/templates') diff --git a/ishtar_common/templates/blocks/DataTables-stats-detail.html b/ishtar_common/templates/blocks/DataTables-stats-detail.html new file mode 100644 index 000000000..9dcb04ae4 --- /dev/null +++ b/ishtar_common/templates/blocks/DataTables-stats-detail.html @@ -0,0 +1,79 @@ +{% load i18n %} +
+
+
+
+
+
+
+

+   + {% trans 'Draw rectangle on the graph to zoom. Double-click to reinitialize.' %} +

+
+
+ +
+
+
+
+
+
+
+   + {% trans 'Right-click on this image to save it.' %} +
+
+
+
+
+
+ +
+

+   + {% trans "No data" %} +

+
+
+
+   + {% trans "Too many values for the selected modalities, graph cannot be displayed. You can: " %} +
    +
  • {% trans 'Select "table" type.'%}
  • +
  • {% trans 'Refine the search to limit the results.'%}
  • +
+
+
+
+ + diff --git a/ishtar_common/templates/blocks/DataTables-stats.html b/ishtar_common/templates/blocks/DataTables-stats.html index 342051d19..aae2bb91f 100644 --- a/ishtar_common/templates/blocks/DataTables-stats.html +++ b/ishtar_common/templates/blocks/DataTables-stats.html @@ -36,80 +36,13 @@


-
-
-
-
-
-
-

-   - {% trans 'Draw rectangle on the graph to zoom. Double-click to reinitialize.' %} -

-
-
- -
-
-
-
-
-
-
-   - {% trans 'Right-click on this image to save it.' %} -
-
-
-
-
-
-
-
-
- -
-
-

-   - {% trans "No data" %} -

-
-
-
-   - {% trans "Too many values for the selected modalities, graph cannot be displayed. You can: " %} -
    -
  • {% trans 'Select "table" type.'%}
  • -
  • {% trans 'Refine the search to limit the results.'%}
  • -
-
-
- - \ No newline at end of file + {% with stats_name=name %}{% with extra="default" %} + {% include "blocks/DataTables-stats-detail.html" %} + {% endwith %}{% endwith %} + {% if external_sources %}{% for source_id, source_label, source_url in external_sources %} + {% with stats_name=name %}{% with extra=source_id %} + {% include "blocks/DataTables-stats-detail.html" %} + {% endwith %}{% endwith %} + {% endfor %}{% endif %} + diff --git a/ishtar_common/templates/blocks/DataTables.html b/ishtar_common/templates/blocks/DataTables.html index 3d1b817a8..199cd3af2 100644 --- a/ishtar_common/templates/blocks/DataTables.html +++ b/ishtar_common/templates/blocks/DataTables.html @@ -94,7 +94,21 @@ map_submit_search = function(){ return _map_submit_search(query_vars, "{{name}}", "{{source}}"); }; {% endif %} + +extra_list = [ + "default"{% for source_id, source_label, source_url in external_sources %}, +"{{source_id}}"{% endfor %} +]; + +sources = [ + "{{source}}"{% for source_id, source_label, source_url in external_sources %}, + "{{source_url}}"{% endfor %} +]; + stats_submit_search = function(){ + {% if external_sources %}{% for source_id, source_label, source_url in external_sources %} + _stats_submit_search(query_vars, "{{name}}", "{{source_url}}", "{{source_id}}"); + {% endfor %}{% endif %} return _stats_submit_search(query_vars, "{{name}}", "{{source}}"); }; @@ -157,6 +171,7 @@ jQuery(document).ready(function(){ function(){ $(".sources").hide(); $(".sources-default").show(); + redraw_plots("{{name}}", "default"); } ); {% for source_id, source_label, source_url in external_sources %} @@ -164,6 +179,7 @@ jQuery(document).ready(function(){ function(){ $(".sources").hide(); $(".sources-{{source_id}}").show(); + redraw_plots("{{name}}", "{{source_id}}"); } ); {% endfor %} -- cgit v1.2.3