From a57241a160757ac737658b33ea7cc8ad670a0e61 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Thu, 3 Dec 2020 00:01:52 +0300 Subject: add hide empty column in table script --- .../static/new/javascript/auto_hide_column.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 wqflask/wqflask/static/new/javascript/auto_hide_column.js (limited to 'wqflask') diff --git a/wqflask/wqflask/static/new/javascript/auto_hide_column.js b/wqflask/wqflask/static/new/javascript/auto_hide_column.js new file mode 100644 index 00000000..652b2ad7 --- /dev/null +++ b/wqflask/wqflask/static/new/javascript/auto_hide_column.js @@ -0,0 +1,22 @@ + +$(function (){ +$("table th").each(function(index,col_th){ + var filter_counter = 0; + // map each column to row ie column i to ith element + var column_tds = $(this).closest('table').find('tr td:nth-child(' + (index + 1) + ')') + column_tds.each(function(j,col_td){ + if(this.innerHTML==''||this.innerHTML=="N/A"){ + filter_counter+=1; + } + else{ + // break + return false; + } + }) + if (filter_counter == ($('table tr').length - 1)){ + $(this).hide(); + column_tds.hide(); + + } +}) +}) \ No newline at end of file -- cgit v1.2.3 From 8746f2e93fe889ac0ba9e801b3684764fffa2945 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Thu, 3 Dec 2020 00:04:52 +0300 Subject: add table row index --- wqflask/wqflask/static/new/javascript/auto_hide_column.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/static/new/javascript/auto_hide_column.js b/wqflask/wqflask/static/new/javascript/auto_hide_column.js index 652b2ad7..73b639dc 100644 --- a/wqflask/wqflask/static/new/javascript/auto_hide_column.js +++ b/wqflask/wqflask/static/new/javascript/auto_hide_column.js @@ -1,10 +1,10 @@ $(function (){ -$("table th").each(function(index,col_th){ +$("table th").each(function(th_index,col_th){ var filter_counter = 0; // map each column to row ie column i to ith element var column_tds = $(this).closest('table').find('tr td:nth-child(' + (index + 1) + ')') - column_tds.each(function(j,col_td){ + column_tds.each(function(td_index,col_td){ if(this.innerHTML==''||this.innerHTML=="N/A"){ filter_counter+=1; } -- cgit v1.2.3 From f199a59587bad2b20c4122562eb707931b045669 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Thu, 3 Dec 2020 00:47:54 +0300 Subject: add support for multiple tables --- .../static/new/javascript/auto_hide_column.js | 37 +++++++++++----------- 1 file changed, 18 insertions(+), 19 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/static/new/javascript/auto_hide_column.js b/wqflask/wqflask/static/new/javascript/auto_hide_column.js index 73b639dc..14348ccd 100644 --- a/wqflask/wqflask/static/new/javascript/auto_hide_column.js +++ b/wqflask/wqflask/static/new/javascript/auto_hide_column.js @@ -1,22 +1,21 @@ +$(function(){ + $("table").each(function(table){ + $(this).find("th").each(function(col_index,col_th){ + var filter_counter=0 + var col_td=$(this).closest('table').find('tr td:nth-child(' + (col_index + 1) + ')') + col_td.each(function(td_index,col_td){ + if(this.innerHTML==""||this.innerHTML=="N/A"){ + filter_counter+=1 + } + else{ + return false + } + }) + if (filter_counter==$(this).closest("table").find("tr").length-1){ + $(this).hide(); + col_td.hide(); -$(function (){ -$("table th").each(function(th_index,col_th){ - var filter_counter = 0; - // map each column to row ie column i to ith element - var column_tds = $(this).closest('table').find('tr td:nth-child(' + (index + 1) + ')') - column_tds.each(function(td_index,col_td){ - if(this.innerHTML==''||this.innerHTML=="N/A"){ - filter_counter+=1; - } - else{ - // break - return false; - } + } + }) }) - if (filter_counter == ($('table tr').length - 1)){ - $(this).hide(); - column_tds.hide(); - - } }) -}) \ No newline at end of file -- cgit v1.2.3 From 953727abb0b2c9075b486e3adfb13f029ebb00b1 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Thu, 3 Dec 2020 18:46:37 +0300 Subject: add datatable filter for empty columns --- .../static/new/javascript/auto_hide_column.js | 47 +++++++++++++--------- 1 file changed, 27 insertions(+), 20 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/static/new/javascript/auto_hide_column.js b/wqflask/wqflask/static/new/javascript/auto_hide_column.js index 14348ccd..94bb8a90 100644 --- a/wqflask/wqflask/static/new/javascript/auto_hide_column.js +++ b/wqflask/wqflask/static/new/javascript/auto_hide_column.js @@ -1,21 +1,28 @@ -$(function(){ - $("table").each(function(table){ - $(this).find("th").each(function(col_index,col_th){ - var filter_counter=0 - var col_td=$(this).closest('table').find('tr td:nth-child(' + (col_index + 1) + ')') - col_td.each(function(td_index,col_td){ - if(this.innerHTML==""||this.innerHTML=="N/A"){ - filter_counter+=1 - } - else{ - return false - } - }) - if (filter_counter==$(this).closest("table").find("tr").length-1){ - $(this).hide(); - col_td.hide(); +function filterDatable(datatable){ + let visitedColumns=[] + let columnCount=datatable.columns().header().length; + let numberOfRows=datatable.data().length; + for (let i=0;ivisitedColumns.indexOf(item)<0); + return datatable.columns(emptyColumns).visible(false); + +} -- cgit v1.2.3 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 18d01454548f7fb30f6fc24d9d8fb38840e76901 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Mon, 7 Dec 2020 12:18:26 +0300 Subject: replace datatatable/jquery.js in templates --- wqflask/wqflask/templates/admin/create_group.html | 4 +++- wqflask/wqflask/templates/admin/search_for_groups.html | 4 +++- wqflask/wqflask/templates/ctl_results.html | 4 +++- wqflask/wqflask/templates/network_graph.html | 4 +++- wqflask/wqflask/templates/pair_scan_results.html | 4 +++- 5 files changed, 15 insertions(+), 5 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/templates/admin/create_group.html b/wqflask/wqflask/templates/admin/create_group.html index 5a6929fb..4ab70007 100644 --- a/wqflask/wqflask/templates/admin/create_group.html +++ b/wqflask/wqflask/templates/admin/create_group.html @@ -80,7 +80,9 @@ {% endblock %} {% block js %} - + + + diff --git a/wqflask/wqflask/templates/admin/search_for_groups.html b/wqflask/wqflask/templates/admin/search_for_groups.html index f304a172..1df4d0a2 100644 --- a/wqflask/wqflask/templates/admin/search_for_groups.html +++ b/wqflask/wqflask/templates/admin/search_for_groups.html @@ -63,7 +63,9 @@ {% endblock %} {% block js %} - + + + diff --git a/wqflask/wqflask/templates/ctl_results.html b/wqflask/wqflask/templates/ctl_results.html index e374eb4e..7ce67d0e 100644 --- a/wqflask/wqflask/templates/ctl_results.html +++ b/wqflask/wqflask/templates/ctl_results.html @@ -64,7 +64,9 @@ gn2_url = "{{ gn2_url | safe }}" - + + + diff --git a/wqflask/wqflask/templates/network_graph.html b/wqflask/wqflask/templates/network_graph.html index be3d0402..33f0365b 100644 --- a/wqflask/wqflask/templates/network_graph.html +++ b/wqflask/wqflask/templates/network_graph.html @@ -140,7 +140,9 @@ gn2_url = "{{ gn2_url | safe }}" - + + + diff --git a/wqflask/wqflask/templates/pair_scan_results.html b/wqflask/wqflask/templates/pair_scan_results.html index f1646af7..14a62e0d 100644 --- a/wqflask/wqflask/templates/pair_scan_results.html +++ b/wqflask/wqflask/templates/pair_scan_results.html @@ -64,7 +64,9 @@ - + + + -- cgit v1.2.3 From 0319428bc26ba7d956dc7564ad69feeae7c9ef90 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Mon, 7 Dec 2020 12:23:01 +0300 Subject: replace js_alt/timeago in templates --- wqflask/wqflask/templates/admin/ind_user_manager.html | 2 +- wqflask/wqflask/templates/collections/list.html | 2 +- wqflask/wqflask/templates/collections/not_logged_in.html | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/templates/admin/ind_user_manager.html b/wqflask/wqflask/templates/admin/ind_user_manager.html index e859b442..b821e5d5 100644 --- a/wqflask/wqflask/templates/admin/ind_user_manager.html +++ b/wqflask/wqflask/templates/admin/ind_user_manager.html @@ -103,7 +103,7 @@ {% block js %} - + diff --git a/wqflask/wqflask/templates/collections/list.html b/wqflask/wqflask/templates/collections/list.html index 9e0c0f07..280ca6cc 100644 --- a/wqflask/wqflask/templates/collections/list.html +++ b/wqflask/wqflask/templates/collections/list.html @@ -66,7 +66,7 @@ {% endblock %} {% block js %} - + diff --git a/wqflask/wqflask/templates/collections/not_logged_in.html b/wqflask/wqflask/templates/collections/not_logged_in.html index a4c8747e..49b0e07d 100644 --- a/wqflask/wqflask/templates/collections/not_logged_in.html +++ b/wqflask/wqflask/templates/collections/not_logged_in.html @@ -5,7 +5,7 @@ {{ header("Not logged in") }} -
+
@@ -16,7 +16,7 @@ {% endblock %} {% block js %} - + -- cgit v1.2.3 From f9fd76752944e9952a48fd2fa3718db5b11fc40e Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Mon, 7 Dec 2020 12:25:35 +0300 Subject: replace js_alt/parsley in templates --- wqflask/wqflask/templates/base.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html index faa59deb..51a21324 100644 --- a/wqflask/wqflask/templates/base.html +++ b/wqflask/wqflask/templates/base.html @@ -257,7 +257,9 @@ - + + + {% block js %} {% endblock %} -- cgit v1.2.3 From 4f55eeda63106694f8fad1355b7ecef2baad257e Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Mon, 7 Dec 2020 12:27:26 +0300 Subject: replace jstat in templates --- wqflask/wqflask/templates/show_trait.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/templates/show_trait.html b/wqflask/wqflask/templates/show_trait.html index 7b74a3f6..918894f5 100644 --- a/wqflask/wqflask/templates/show_trait.html +++ b/wqflask/wqflask/templates/show_trait.html @@ -133,7 +133,7 @@ - + -- cgit v1.2.3 From 51b70d89d5b085b9f81e5da2b695873ca53e54f9 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Mon, 7 Dec 2020 12:31:24 +0300 Subject: replace jszip lib in templates --- wqflask/wqflask/templates/collections/list.html | 2 +- wqflask/wqflask/templates/collections/view.html | 2 +- wqflask/wqflask/templates/correlation_page.html | 2 +- wqflask/wqflask/templates/gsearch_gene.html | 2 +- wqflask/wqflask/templates/gsearch_pheno.html | 2 +- wqflask/wqflask/templates/search_result_page.html | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/templates/collections/list.html b/wqflask/wqflask/templates/collections/list.html index 9e0c0f07..b04672ec 100644 --- a/wqflask/wqflask/templates/collections/list.html +++ b/wqflask/wqflask/templates/collections/list.html @@ -69,7 +69,7 @@ - + + diff --git a/wqflask/wqflask/templates/correlation_page.html b/wqflask/wqflask/templates/correlation_page.html index 06ee9056..01789d67 100644 --- a/wqflask/wqflask/templates/correlation_page.html +++ b/wqflask/wqflask/templates/correlation_page.html @@ -171,7 +171,7 @@ - + diff --git a/wqflask/wqflask/templates/gsearch_gene.html b/wqflask/wqflask/templates/gsearch_gene.html index d5bc4141..6fd0abe8 100644 --- a/wqflask/wqflask/templates/gsearch_gene.html +++ b/wqflask/wqflask/templates/gsearch_gene.html @@ -48,7 +48,7 @@ {% block js %} - + diff --git a/wqflask/wqflask/templates/gsearch_pheno.html b/wqflask/wqflask/templates/gsearch_pheno.html index ccd4a9d9..0dc6fe5f 100644 --- a/wqflask/wqflask/templates/gsearch_pheno.html +++ b/wqflask/wqflask/templates/gsearch_pheno.html @@ -48,7 +48,7 @@ {% block js %} - + diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html index 87c97c50..1a2d2112 100644 --- a/wqflask/wqflask/templates/search_result_page.html +++ b/wqflask/wqflask/templates/search_result_page.html @@ -183,7 +183,7 @@ - + -- cgit v1.2.3 From 1c202735fc279f42e70d2cdef6ee8b9214ca0f44 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Mon, 7 Dec 2020 12:41:44 +0300 Subject: replace colorbox jquery.colorbox in templates --- wqflask/wqflask/templates/base.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html index faa59deb..5c8343d1 100644 --- a/wqflask/wqflask/templates/base.html +++ b/wqflask/wqflask/templates/base.html @@ -254,7 +254,9 @@ - + + + -- cgit v1.2.3 From 5fc3f0647beafc1290ede2f5242275c2f0e54ed9 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Mon, 7 Dec 2020 12:57:10 +0300 Subject: replace jscolor lib in templates --- wqflask/wqflask/templates/corr_scatterplot.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/templates/corr_scatterplot.html b/wqflask/wqflask/templates/corr_scatterplot.html index 1133fcd2..145cfcf7 100644 --- a/wqflask/wqflask/templates/corr_scatterplot.html +++ b/wqflask/wqflask/templates/corr_scatterplot.html @@ -349,7 +349,7 @@ - + -- 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 %} - +