From 0dfdbcbb83ffe9b349c870d02a5812bcb296a74b Mon Sep 17 00:00:00 2001 From: zsloan Date: Fri, 4 Dec 2020 14:57:02 -0600 Subject: Added option to toggle columns on show_trait page, including case attribute columns --- wqflask/wqflask/templates/show_trait.html | 27 +++++++++++++++++++ .../wqflask/templates/show_trait_edit_data.html | 30 ++++++++++++++++++++++ 2 files changed, 57 insertions(+) (limited to 'wqflask') diff --git a/wqflask/wqflask/templates/show_trait.html b/wqflask/wqflask/templates/show_trait.html index 7b74a3f6..3923ad2f 100644 --- a/wqflask/wqflask/templates/show_trait.html +++ b/wqflask/wqflask/templates/show_trait.html @@ -221,6 +221,33 @@ primary_table.search($(this).val()).draw(); } ); + $('.toggle-vis').on('click', function (e) { + e.preventDefault(); + + function toggle_column(column) { + //ZS: Toggle column visibility + column.visible( ! column.visible() ); + if (column.visible()){ + $(this).removeClass("active"); + } else { + $(this).addClass("active"); + } + } + + // Get the column API object + var target_cols = $(this).attr('data-column').split(",") + for (let i = 0; i < target_cols.length; i++){ + console.log("THE COL:", target_cols[i]) + var column = primary_table.column( target_cols[i] ); + toggle_column(column); + + {% if sample_groups|length != 1 %} + var column2 = other_table.column( target_cols[i] ); + toggle_column(column2); + {% endif %} + } + } ); + {% if sample_groups|length != 1 %} $('#other_searchbox').on( 'keyup', function () { other_table.search($(this).val()).draw(); diff --git a/wqflask/wqflask/templates/show_trait_edit_data.html b/wqflask/wqflask/templates/show_trait_edit_data.html index 2e730248..4ad11a5e 100644 --- a/wqflask/wqflask/templates/show_trait_edit_data.html +++ b/wqflask/wqflask/templates/show_trait_edit_data.html @@ -1,6 +1,36 @@
{% for sample_type in sample_groups %}
+ {% if loop.index == 1 %} + Show/Hide Columns: +
+ + + + {% if sample_groups[0].se_exists %} + + {% if has_num_cases %} + + {% set attr_start_pos = 7 %} + {% else %} + {% set attr_start_pos = 6 %} + {% endif %} + {% else %} + {% if has_num_cases %} + + {% set attr_start_pos = 5 %} + {% else %} + {% set attr_start_pos = 4 %} + {% endif %} + {% endif %} + {% if sample_groups[0].attributes %} + {% for attribute in sample_groups[0].attributes %} + + {% endfor %} + {% endif %} +
+
+ {% endif %}
-- cgit v1.2.3 From e96b568adbb0e3ac2c3e0b1ab72d0bfd354db6a7 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Mon, 7 Dec 2020 13:00:42 +0300 Subject: replace cytoscape js in templates --- wqflask/wqflask/templates/ctl_results.html | 2 +- wqflask/wqflask/templates/network_graph.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/templates/ctl_results.html b/wqflask/wqflask/templates/ctl_results.html index e374eb4e..20935612 100644 --- a/wqflask/wqflask/templates/ctl_results.html +++ b/wqflask/wqflask/templates/ctl_results.html @@ -67,7 +67,7 @@ - + diff --git a/wqflask/wqflask/templates/network_graph.html b/wqflask/wqflask/templates/network_graph.html index be3d0402..017298b9 100644 --- a/wqflask/wqflask/templates/network_graph.html +++ b/wqflask/wqflask/templates/network_graph.html @@ -144,7 +144,7 @@ - + -- cgit v1.2.3 From 8666d17de2a0b9e20be82f115df9af8d5693dbae Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Mon, 7 Dec 2020 13:02:30 +0300 Subject: replace cytoscape-panzoom js in templates --- wqflask/wqflask/templates/ctl_results.html | 2 +- wqflask/wqflask/templates/network_graph.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/templates/ctl_results.html b/wqflask/wqflask/templates/ctl_results.html index 20935612..28d462ee 100644 --- a/wqflask/wqflask/templates/ctl_results.html +++ b/wqflask/wqflask/templates/ctl_results.html @@ -68,7 +68,7 @@ - + diff --git a/wqflask/wqflask/templates/network_graph.html b/wqflask/wqflask/templates/network_graph.html index 017298b9..1c0eabee 100644 --- a/wqflask/wqflask/templates/network_graph.html +++ b/wqflask/wqflask/templates/network_graph.html @@ -145,7 +145,7 @@ - + -- cgit v1.2.3 From 5ae193d969c0e21bdd02de577d00f8c8b8ba8148 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Mon, 7 Dec 2020 13:04:30 +0300 Subject: replace cytoscape panzoom css in templates --- wqflask/wqflask/templates/ctl_results.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/templates/ctl_results.html b/wqflask/wqflask/templates/ctl_results.html index 28d462ee..17390d96 100644 --- a/wqflask/wqflask/templates/ctl_results.html +++ b/wqflask/wqflask/templates/ctl_results.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block css %} - +