Skip to content
Snippets Groups Projects
Commit aa04b14d authored by Nicole Finks's avatar Nicole Finks
Browse files

Update layouts/custom/repository.html

parent 9196c5f8
Branches
Tags
2 merge requests!9Develop,!8Repository
{{ partial "header.html" . }} {{ partial "header.html" . }}
<div class="header"> <div class="header">
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>
<h2>{{ .Description }}</h2> <h2>{{ .Description }}</h2>
</div> </div>
<div class="content"> <div class="content">
{{ .Content }} {{ .Content }}
<!-- Sidebar for Filters --> <!-- Sidebar for Filters -->
<div class= "sidenav"> <div class= "sidenav">
<button class="dropdown-btn"> <button class="dropdown-btn">
Type 2 Diabetes Type 2 Diabetes
<i class="fa fa-caret-down"></i> <i class="fa fa-caret-down"></i>
</button> </button>
<div id="filter"> <div id="filter">
<input type="checkbox" name="Type 2 diabetes" value="1"> T2 Diabetes</input> <input type="checkbox" name="Type 2 diabetes" value="1"> T2 Diabetes <span class="numbers" id="Type2diabetes1">#</span></input>
<p class="numbers" id="Type2diabetes1">#</p>
<br> <br>
<input type="checkbox" name="Type 2 diabetes" value="0"> No T2 Diabetes </input> <input type="checkbox" name="Type 2 diabetes" value="0"> No T2 Diabetes </input>
<p class = "numbers" id="Type2diabetes0">#</p> <p class = "numbers" id="Type2diabetes0">#</p>
</div> </div>
<button class="dropdown-btn"> <button class="dropdown-btn">
Age Age
<i class="fa fa-caret-down"></i> <i class="fa fa-caret-down"></i>
</button> </button>
<div id="filter"> <div id="filter">
<input value= "Enter Age Here"></input> <input value= "Enter Age Here"></input>
</div> </div>
<p id="displayFiles">0</p> <p id="displayFiles">0</p>
</div> </div>
<!-- Summary of Filtered Data --> <!-- Summary of Filtered Data -->
<div id="summary"> <div id="summary">
</div> </div>
<!-- Files of Filtered Data --> <!-- Files of Filtered Data -->
<div id="patientFiles"> <div id="patientFiles">
</div> </div>
</div> </div>
<head> <head>
<link rel="stylesheet" type="text/css" href="/css/sidenavRepository.css"/> <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/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="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="/js/repositoryJS.js"></script> <script src="/js/repositoryJS.js"></script>
</head> </head>
<body> <body>
<script> <script>
/*$(document).ready(function(){ /*$(document).ready(function(){
//declare global vars //declare global vars
var results = []; //array of records that match the filters var results = []; //array of records that match the filters
var data = {{ index .Site.Data.scRNAseq_huPr_D.updated_cleaned_json }}; 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 numbers = $("#filter").find(".numbers"); //array of all the places we want to update with the # of records that match the filters
var filters = []; var filters = [];
//filtering function //filtering function
$("input").click(function(){ $("input").click(function(){
// get specific vars // get specific vars
var name = $(this).attr("name"); var name = $(this).attr("name");
var value = $(this).attr("value"); var value = $(this).attr("value");
var id = name + value; var id = name + value;
id= id.replace(/\s+/g, ''); id= id.replace(/\s+/g, '');
// if checkbox is checked: add filter values to filter // if checkbox is checked: add filter values to filter
if ($(this).prop("checked") == true){ if ($(this).prop("checked") == true){
var i; var i;
for (i =0; i < data.length; i++){ for (i =0; i < data.length; i++){
if( data[i][name] == value){ if( data[i][name] == value){
results.push(data[i]); results.push(data[i]);
$("#"+id).text[numbers.length]; $("#"+id).text[numbers.length];
} }
} }
} }
//if checkbox is not checked: remove filter values from filter //if checkbox is not checked: remove filter values from filter
else if ($(this).prop("checked") == false){ else if ($(this).prop("checked") == false){
var i; var i;
for (i=0; i<results.length; i++){ for (i=0; i<results.length; i++){
if (results[i][name]== value){ if (results[i][name]== value){
results.splice(i, 1); results.splice(i, 1);
i--; i--;
} }
} }
} }
//check data to pull all records that match the current filters //check data to pull all records that match the current filters
var i; var i;
var j; var j;
for (i = 0; i<numbers.length; i++){ for (i = 0; i<numbers.length; i++){
var count = 0; var count = 0;
$('#displayFiles').text(numbers.length); $('#displayFiles').text(numbers.length);
for (j=0; j <results.length; j++){ for (j=0; j <results.length; j++){
var id2 = results[j][name]. + results[j][name]; var id2 = results[j][name]. + results[j][name];
// id2 = id2.replace(/\s+/g, ''); // id2 = id2.replace(/\s+/g, '');
// $('#displayFiles').text(id2); // $('#displayFiles').text(id2);
if (id2 == numbers[i][id]){ if (id2 == numbers[i][id]){
count++; count++;
$('#displayFiles').text(count); $('#displayFiles').text(count);
} }
} }
} }
}); });
}); });
*/ */
</script> </script>
</body> </body>
{{ partial "footer.html" . }} {{ partial "footer.html" . }}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment