diff --git a/layouts/custom/repository.html b/layouts/custom/repository.html index 92ae3eaf87cba8e9a76b70e016b32ab2248cb826..35d278c34e7f3a888a692bf513187741b39c7cd0 100644 --- a/layouts/custom/repository.html +++ b/layouts/custom/repository.html @@ -1,138 +1,138 @@ -{{ partial "header.html" . }} - -<div class="header"> - <h1>{{ .Title }}</h1> - <h2>{{ .Description }}</h2> -</div> - -<div class="content"> - {{ .Content }} - - - <!-- Sidebar for Filters --> - - <div class= "sidenav"> - <button class="dropdown-btn"> - Type 2 Diabetes - <i class="fa fa-caret-down"></i> - </button> - - <div id="filter"> - <input type="checkbox" name="Type 2 diabetes" value="1"> T2 Diabetes</input> - <p class="numbers" id="Type2diabetes1">#</p> - <br> - <input type="checkbox" name="Type 2 diabetes" value="0"> No T2 Diabetes </input> - <p class = "numbers" id="Type2diabetes0">#</p> - </div> - - <button class="dropdown-btn"> - Age - <i class="fa fa-caret-down"></i> - </button> - - <div id="filter"> - <input value= "Enter Age Here"></input> - - </div> - - <p id="displayFiles">0</p> - - -</div> - - - - <!-- Summary of Filtered Data --> - <div id="summary"> - </div> - - <!-- Files of Filtered Data --> - <div id="patientFiles"> - </div> - - -</div> - - -<head> - <link rel="stylesheet" type="text/css" href="/css/sidenavRepository.css"/> - <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> - <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script> - <script src="/js/repositoryJS.js"></script> -</head> - -<body> -<script> -/*$(document).ready(function(){ - -//declare global vars - var results = []; //array of records that match the filters - var data = {{ index .Site.Data.scRNAseq_huPr_D.updated_cleaned_json }}; - var numbers = $("#filter").find(".numbers"); //array of all the places we want to update with the # of records that match the filters - var filters = []; - -//filtering function - $("input").click(function(){ - - // get specific vars - var name = $(this).attr("name"); - var value = $(this).attr("value"); - var id = name + value; - id= id.replace(/\s+/g, ''); - -// if checkbox is checked: add filter values to filter - if ($(this).prop("checked") == true){ - - var i; - for (i =0; i < data.length; i++){ - if( data[i][name] == value){ - results.push(data[i]); - $("#"+id).text[numbers.length]; - } - } - } - -//if checkbox is not checked: remove filter values from filter - else if ($(this).prop("checked") == false){ - var i; - for (i=0; i<results.length; i++){ - if (results[i][name]== value){ - results.splice(i, 1); - i--; - } - } - - } - -//check data to pull all records that match the current filters - var i; - var j; - for (i = 0; i<numbers.length; i++){ - var count = 0; - $('#displayFiles').text(numbers.length); - - for (j=0; j <results.length; j++){ - var id2 = results[j][name]. + results[j][name]; - // id2 = id2.replace(/\s+/g, ''); - // $('#displayFiles').text(id2); - if (id2 == numbers[i][id]){ - count++; - $('#displayFiles').text(count); - } - } - } - }); -}); -*/ -</script> - -</body> - - - - - - - -{{ partial "footer.html" . }} - +{{ partial "header.html" . }} + +<div class="header"> + <h1>{{ .Title }}</h1> + <h2>{{ .Description }}</h2> +</div> + +<div class="content"> + {{ .Content }} + + + <!-- Sidebar for Filters --> + + <div class= "sidenav"> + <button class="dropdown-btn"> + Type 2 Diabetes + <i class="fa fa-caret-down"></i> + </button> + + <div id="filter"> + <input type="checkbox" name="Type 2 diabetes" value="1"> T2 Diabetes <span class="numbers" id="Type2diabetes1">#</span></input> + + <br> + <input type="checkbox" name="Type 2 diabetes" value="0"> No T2 Diabetes </input> + <p class = "numbers" id="Type2diabetes0">#</p> + </div> + + <button class="dropdown-btn"> + Age + <i class="fa fa-caret-down"></i> + </button> + + <div id="filter"> + <input value= "Enter Age Here"></input> + + </div> + + <p id="displayFiles">0</p> + + +</div> + + + + <!-- Summary of Filtered Data --> + <div id="summary"> + </div> + + <!-- Files of Filtered Data --> + <div id="patientFiles"> + </div> + + +</div> + + +<head> + <link rel="stylesheet" type="text/css" href="/css/sidenavRepository.css"/> + <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> + <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script> + <script src="/js/repositoryJS.js"></script> +</head> + +<body> +<script> +/*$(document).ready(function(){ + +//declare global vars + var results = []; //array of records that match the filters + var data = {{ index .Site.Data.scRNAseq_huPr_D.updated_cleaned_json }}; + var numbers = $("#filter").find(".numbers"); //array of all the places we want to update with the # of records that match the filters + var filters = []; + +//filtering function + $("input").click(function(){ + + // get specific vars + var name = $(this).attr("name"); + var value = $(this).attr("value"); + var id = name + value; + id= id.replace(/\s+/g, ''); + +// if checkbox is checked: add filter values to filter + if ($(this).prop("checked") == true){ + + var i; + for (i =0; i < data.length; i++){ + if( data[i][name] == value){ + results.push(data[i]); + $("#"+id).text[numbers.length]; + } + } + } + +//if checkbox is not checked: remove filter values from filter + else if ($(this).prop("checked") == false){ + var i; + for (i=0; i<results.length; i++){ + if (results[i][name]== value){ + results.splice(i, 1); + i--; + } + } + + } + +//check data to pull all records that match the current filters + var i; + var j; + for (i = 0; i<numbers.length; i++){ + var count = 0; + $('#displayFiles').text(numbers.length); + + for (j=0; j <results.length; j++){ + var id2 = results[j][name]. + results[j][name]; + // id2 = id2.replace(/\s+/g, ''); + // $('#displayFiles').text(id2); + if (id2 == numbers[i][id]){ + count++; + $('#displayFiles').text(count); + } + } + } + }); +}); +*/ +</script> + +</body> + + + + + + + +{{ partial "footer.html" . }} +