Skip to content

Commit 6568fa5

Browse files
committed
Fixed heather's requirements
1 parent 2970eda commit 6568fa5

14 files changed

+150
-24
lines changed

INSTALL.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
To run Labcas's (EDRN's or MCL's) Portal 2.0+, you'll need the following:
66

77
• A Docker environment
8-
• The Labcas 2.0 code, ``https://github.com/EDRN/labcas-ui.git``
8+
• The Labcas 2.1 code, ``https://github.com/EDRN/labcas-ui.git``
99
• Docker has access to a labcas JWT/Solr API (Currently edrn/mcl/labcas-dev apis
1010
are available within JPL servers)
1111
• A public web server (such as Apache HTTPD, NGINX, AWS Elastic Load Balancer,

a/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<link rel="apple-touch-icon" sizes="76x76" href="/labcas-ui/assets/img/apple-icon.png">
77
<link rel="icon" type="image/png" href="/labcas-ui/assets/img/favicon.png">
88
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
9-
<title>Labcas 2.0</title>
9+
<title>Labcas 2.1</title>
1010
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no' name='viewport' />
1111
<!-- Fonts and icons -->
1212
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700,200" rel="stylesheet" />
@@ -294,7 +294,7 @@ <h4 class="card-title"><div id="datasettitle"></div></h4>
294294
U.S. Government Sponsorship Acknowledged.
295295
</p>
296296
<p>
297-
Labcas version 2.0, Licensed under <a href='https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html'>GPLv2</a>.
297+
Labcas version 2.1, Licensed under <a href='https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html'>GPLv2</a>.
298298
<a href='https://mcl-labcas.jpl.nasa.gov/ui/static/plupload-2.1.9.zip'>Get Plupload</a>.
299299
</p>
300300

assets/conf/edrn-environment.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"collection_header_extend_Team_37_CTIIP_Animal_Models":"Study,DataGroup",
1616
"dataset_header_extend_MD_Anderson_Pancreas_IPMN_images":"Race,Age,Gender,Diagnosis,SizeOfCyst,Pane1,Panel2,Instrument,FileType",
1717
"dataset_header_extend_Team_37_CTIIP_Animal_Models":"StudyStatus,Cohort,Sub-Cohort,Experiment,ExperimentStatus,GeneticDescription_1,GeneticDescription_2,Gender,labcas.pathology:NCITDiagnosisCode,labcas.pathology:NCITOrganCode,labcas.pathology:NCITProcedure,labcas.pathology:Stain,FileType",
18-
"collapsible_headers":"CollectionDescription,DataDisclaimer,MethodDetails,ResultsAndConclusionSummary",
18+
"collapsible_headers":"CollectionDescription,DataDisclaimer,MethodDetails,ResultsAndConclusionSummary,OwnerPrincipal",
1919
"collection_id_append":"LeadPI,Institution,Organ,Protocol",
2020
"escape_characters":"+,-,&,|,!,(,),{,},[,],^,\",~,*,?",
2121
"filters":"Core,Pathology,Aperio",

assets/conf/environment.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"collection_header_extend_Team_37_CTIIP_Animal_Models":"Study,DataGroup",
1818
"dataset_header_extend_MD_Anderson_Pancreas_IPMN_images":"Race,Age,Gender,Diagnosis,SizeOfCyst,Pane1,Panel2,Instrument,FileType",
1919
"dataset_header_extend_Team_37_CTIIP_Animal_Models":"StudyStatus,Cohort,Sub-Cohort,Experiment,ExperimentStatus,GeneticDescription_1,GeneticDescription_2,Gender,labcas.pathology:NCITDiagnosisCode,labcas.pathology:NCITOrganCode,labcas.pathology:NCITProcedure,labcas.pathology:Stain,FileType",
20-
"collapsible_headers":"CollectionDescription,DataDisclaimer,MethodDetails,ResultsAndConclusionSummary",
20+
"collapsible_headers":"CollectionDescription,DataDisclaimer,MethodDetails,ResultsAndConclusionSummary,OwnerPrincipal",
2121
"collection_id_append":"LeadPI,Institution,Organ,Protocol",
2222
"escape_characters":"+,-,&,|,!,(,),{,},[,],^,\",~,*,?",
2323
"filters":"Core,Pathology,Aperio",

assets/conf/mcl-environment.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"collection_header_extend_Team_37_CTIIP_Animal_Models":"Study,DataGroup",
1616
"dataset_header_extend_MD_Anderson_Pancreas_IPMN_images":"Race,Age,Gender,Diagnosis,SizeOfCyst,Pane1,Panel2,Instrument,FileType",
1717
"dataset_header_extend_Team_37_CTIIP_Animal_Models":"StudyStatus,Cohort,Sub-Cohort,Experiment,ExperimentStatus,GeneticDescription_1,GeneticDescription_2,Gender,labcas.pathology:NCITDiagnosisCode,labcas.pathology:NCITOrganCode,labcas.pathology:NCITProcedure,labcas.pathology:Stain,FileType",
18-
"collapsible_headers":"CollectionDescription,DataDisclaimer,MethodDetails,ResultsAndConclusionSummary",
18+
"collapsible_headers":"CollectionDescription,DataDisclaimer,MethodDetails,ResultsAndConclusionSummary,OwnerPrincipal",
1919
"collection_id_append":"LeadPI,Institution,Organ,Protocol",
2020
"escape_characters":"+,-,&,|,!,(,),{,},[,],^,\",~,*,?",
2121
"filters":"Core,Pathology,Aperio",

assets/js/labcas/authentication.js

Lines changed: 86 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,8 @@ function fill_collection_details_data(data){
310310
});
311311

312312
$('#loading_collection').hide(500);
313+
314+
313315
}
314316
function fill_dataset_details_data(data){
315317
var datasetname = data.response.docs[0].DatasetName;
@@ -468,15 +470,88 @@ function fill_datasets_children(data){
468470
}
469471
$("#children-datasets-section").append(dataset_html);
470472
}
471-
function fill_datasets_metadata(data){
473+
function fill_collection_level_files(data){
474+
console.log("Metadata size");
475+
var size = data.response.numFound;
476+
console.log(size);
477+
var cpage = data.response.start;
478+
load_pagination("files",size,cpage);
479+
$("#files-table tbody").empty();
480+
var download_list = JSON.parse(localStorage.getItem("download_list"));
481+
$.each(data.response.docs, function(key, value) {
482+
483+
var color = "btn-info";
484+
if(user_data["FavoriteFiles"].includes(value.id)){
485+
color = "btn-success";
486+
}
487+
488+
var thumb = "";
489+
var filetype = value.FileType ? value.FileType.join(",") : "";
490+
var site = value.Site ? value.Site.join(",") : "";
491+
var description = value.Description? value.Description.join(",") : "";
492+
if ('ThumbnailRelativePath' in value){
493+
thumb = "<img width='50' height='50' src='/labcas-ui/assets/"+value.ThumbnailRelativePath+"'/>";
494+
}
495+
var html_safe_id = encodeURI(escapeRegExp(value.id));
496+
var filesize = "";
497+
var filesizenum = 0;
498+
if (value.FileSize){
499+
filesize = humanFileSize(value.FileSize, true);
500+
filesizenum = value.FileSize;
501+
}
502+
var checked = "";
503+
if ( download_list && download_list.includes(html_safe_id) ){
504+
checked = "checked";
505+
}
506+
$("#files-table tbody").append(
507+
"<tr>"+
508+
"<td><center><input type='checkbox' class='form-check-input' value='"+html_safe_id+"' "+checked+" data-valuesize='"+filesizenum+"'></center></td>"+
509+
"<td class='text-left'>"+
510+
"<a href=\"/labcas-ui/f/index.html?file_id="+
511+
html_safe_id+"\">"+
512+
value.FileName+
513+
"</a>"+
514+
"</td>"+
515+
"<td class='text-left'>"+
516+
site +
517+
"</td>"+
518+
"<td class='text-left'>"+
519+
filetype +
520+
"</td>"+
521+
"<td class='text-left'>"+
522+
description +
523+
"</td>"+
524+
"<td class='text-left'>"+
525+
thumb+
526+
"</td>"+
527+
"<td class='text-left'>"+
528+
filesize+
529+
"</td>"+
530+
"<td class=\"td-actions text-right\">"+
531+
"<button type=\"button\" rel=\"favoritebutton\" title=\"Favorite\" onclick=\"save_favorite('"+value.id+"', 'FavoriteFiles')\" class=\"btn "+color+" btn-simple btn-link\">"+
532+
"<i class=\"fa fa-star\"></i>"+
533+
"</button>"+
534+
"<button type=\"button\" rel=\"downloadbutton\" title=\"Download\" class=\"btn btn-danger btn-simple btn-link\" onclick=\"download_file('"+html_safe_id+"','single')\">"+
535+
"<i class=\"fa fa-download\"></i>"+
536+
"</button>"+
537+
"</td>"+
538+
"</tr>");
539+
});
540+
if (size > 0){
541+
$("#children-files").show();
542+
}
543+
$('#loading_file').hide(500);
544+
}
545+
function fill_collection_metadata(data){
472546
var dataset_metadata_html = '<table class="table" id="metadatadetails-table" style="table-layout: fixed;">';
473547
$.each(data.response.docs, function(key, value) {
474548
console.log(key);
475549
console.log(value.id);
476550
var html_safe_id = encodeURI(escapeRegExp(value.id));
477551
console.log(html_safe_id);
478552
dataset_metadata_html+="<tr>"+
479-
"<td valign='top' style='padding: 2px 8px;' width='100%'>"+"<center><a href='#' onclick=\"download_file('"+html_safe_id+"','single');\">"+value.FileName+"</a></center>"+"</td>"+
553+
"<td valign='top' style='padding: 2px 8px;' width='80%'>"+"<center><a href='/labcas-ui/f/index.html?file_id="+html_safe_id+"'>"+value.FileName+"</a></center>"+"</td>"+
554+
"<td valign='top' style='padding: 2px 8px;' width='20%'>"+"<center><a href='#' onclick=\"download_file('"+html_safe_id+"','single');\">"+"<i class=\"fa fa-download\"></i>"+"</a></center>"+"</td>"+
480555
"</tr>"
481556
size += 1;
482557
});
@@ -495,11 +570,15 @@ function fill_datasets_data(data){
495570

496571
var get_var = get_url_vars();
497572
var metadata_exists = false;
573+
var collection_file_exists = false;
498574
$.each(data.response.docs, function(key, value) {
499575
if (value.id.split(/\//)[1] == get_var["collection_id"]){
500-
query_labcas_api(localStorage.getItem('environment')+"/data-access-api/files/select?q=DatasetId:"+value.id+"&wt=json&indent=true", fill_datasets_metadata);
501-
metadata_exists = true;
576+
query_labcas_api(localStorage.getItem('environment')+"/data-access-api/files/select?q=DatasetId:"+value.id+"&wt=json&indent=true", fill_collection_level_files);
577+
collection_file_exists = true;
502578
return;
579+
} else if(value.id.split(/\//)[1].toLowerCase() == "documentation"){
580+
query_labcas_api(localStorage.getItem('environment')+"/data-access-api/files/select?q=DatasetId:"+value.id+"&wt=json&indent=true", fill_collection_metadata);
581+
metadata_exists = true;
503582
}
504583
var html_safe_id = encodeURI(escapeRegExp(value.id));
505584
var color = "#0000FF";
@@ -547,6 +626,9 @@ function fill_datasets_data(data){
547626
if (!metadata_exists){
548627
$('#collection_level_files').hide();
549628
}
629+
if (!collection_file_exists){
630+
$('#children-files').hide();
631+
}
550632
if ( dataset_html == "" ){
551633
$('#datasets_in_collection').hide();
552634
}

assets/js/labcas/utils.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ function checkWindow(win){
452452
}
453453

454454
function checkSize(filecount, filesize, threshold){
455-
$('#sizeHTML').html("There are <B><font color='red'>"+filecount+"</font></B> files with total size of <B><font color='red'>"+filesize+"</font></B>. This is more than the <B><font color='red'>"+threshold+"</font></B> recommended download size from a web browser. If you'd like to proceed, the browser will initiate a series of download, please ensure to keep your browser and internet connection open over the duration of the download. Alternatively, you may download the below script (requires curl pre-installed) that can be run through your command prompt/terminal instead with minimal interferance.");
455+
$('#sizeHTML').html("There are <B><font color='red'>"+filecount+"</font></B> files with total size of <B><font color='red'>"+filesize+"</font></B>. This is more than the <B><font color='red'>"+threshold+"</font></B> recommended download size from a web browser. If you'd like to proceed, the browser will initiate a series of downloads, please keep your browser and internet connection open for the duration of the download. Alternatively, you may download the below script that can be run through your command prompt/terminal instead with minimal interferance.");
456456
$('#sizeModal').modal({backdrop: 'static', keyboard: false});
457457
$('#sizeModal').modal('show');
458458
}
@@ -554,7 +554,8 @@ function download_script_files() {
554554
document.body.removeChild(element);
555555

556556
localStorage.setItem("download_list",JSON.stringify([]));
557-
window.location.reload();
557+
$('#download_list_link').hide();
558+
//window.location.reload();
558559

559560
}
560561

c/index.html

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,48 @@ <h4 class="card-title">Datasets in this Collection</h4>
8787
</div>
8888
</div>
8989
</div>
90+
91+
<div id='children-files' style="display: none" class="col-md-12 ml-auto mr-auto">
92+
<div class="card card-tasks">
93+
<div class="card-header ">
94+
<h4 class="card-title" id="files-title">Files in this Collection</h4>
95+
96+
</div>
97+
<div class="card-body">
98+
<button type="submit" onclick="download_files('files-table');" class="btn btn-primary">Download Selected</button>
99+
<button type="submit" onclick="download_dataset(dataset_id)" class="btn btn-primary">Download All</button>
100+
<ul class="pagination pagination-no-border" id='files_pagination_top' style="float: right;"></ul>
101+
<div class="table-full-width">
102+
<table class="table" id="files-table">
103+
<thead>
104+
<th>Select</th>
105+
<th>Name</th>
106+
<th>Site</th>
107+
<th>Type</th>
108+
<th>Description</th>
109+
<th>Thumbnail</th>
110+
<th>Size</th>
111+
<th>Action</th>
112+
</thead>
113+
<tbody>
114+
<center><img id="loading_file" class="collapse show" height="50px" width="50px" src="/labcas-ui/assets/img/loading.gif"></center>
115+
</tbody>
116+
</table>
117+
</div>
118+
</div>
119+
<div class="card-footer ">
120+
<hr>
121+
<div class="stats">
122+
<i class="now-ui-icons loader_refresh spin"></i>
123+
<ul class="pagination pagination-no-border" id='files_pagination_bottom' style="float: right;"></ul>
124+
125+
</div>
126+
</div>
127+
</div>
128+
</div>
129+
130+
131+
90132
</div>
91133
</div>
92134
</div>
@@ -139,7 +181,7 @@ <h4 class="card-title">Datasets in this Collection</h4>
139181
<!--<script src="/labcas-ui/assets/js/demo.js"></script>-->
140182
<script src="/labcas-ui/assets/js/plugins/js.cookie.js"></script>
141183
<script src="/labcas-ui/assets/js/labcas/labcas-sidebar.js"></script>
142-
<script src="/labcas-ui/assets/js/labcas/authentication.js?109"></script>
184+
<script src="/labcas-ui/assets/js/labcas/authentication.js?112"></script>
143185
<script src="/labcas-ui/assets/js/labcas/utils.js?101"></script>
144186
<script src="/labcas-ui/assets/js/labcas/search.js?100"></script>
145187
<script type="text/javascript">

download.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<link rel="apple-touch-icon" sizes="76x76" href="/labcas-ui/assets/img/apple-icon.png">
55
<link rel="icon" type="image/png" href="/labcas-ui/assets/img/favicon.png">
66
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
7-
<title>Labcas 2.0</title>
7+
<title>Labcas 2.1</title>
88
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no' name='viewport' />
99
<!-- Fonts and icons -->
1010
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700,200" rel="stylesheet" />
@@ -101,7 +101,8 @@
101101
<div id="fileHTML"></div>
102102
</div>
103103
<div class="modal-footer">
104-
<center><button type="button" class="btn btn-link btn-simple" onclick='download_script_files("data_download.ps1",);' data-dismiss="modal">Download Script File List</button></center>
104+
<center><button type="button" id="download_list_link" class="btn btn-link btn-simple" onclick='download_script_files("data_download.ps1",);' >Download Script File List</button></center>
105+
<center><button type="button" class="btn btn-link btn-simple" onclick='window.location.reload();' data-dismiss="modal">Done</button></center>
105106
</div>
106107
</div>
107108
</div>

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<link rel="apple-touch-icon" sizes="76x76" href="img/apple-icon.png">
2222
<link rel="icon" type="image/png" href="img/favicon.png">
2323
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
24-
<title>Labcas 2.0</title>
24+
<title>Labcas 2.1</title>
2525
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no' name='viewport' />
2626
<!-- Fonts and icons -->
2727
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700,200" rel="stylesheet" />
@@ -56,7 +56,7 @@
5656
<nav class="navbar navbar-expand-lg navbar-transparent navbar-absolute">
5757
<div class="container">
5858
<div class="navbar-wrapper">
59-
<a class="navbar-brand" href="#pablo">Labcas 2.0</a>
59+
<a class="navbar-brand" href="#pablo">Labcas 2.1</a>
6060
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" aria-controls="navigation-index" aria-expanded="false" aria-label="Toggle navigation">
6161
<span class="navbar-toggler-bar burger-lines"></span>
6262
<span class="navbar-toggler-bar burger-lines"></span>

notes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Architectural notes coming soon
1919
Assets
2020
------
2121
assets/conf contains json configuration files specific for each environment the
22-
labcas-ui 2.0 portal is deployed in. EDRN, MCL, and Labcas-dev are the three versions
22+
labcas-ui 2.1 portal is deployed in. EDRN, MCL, and Labcas-dev are the three versions
2323
currently deployed which displays each consortium's relevant data within the portal.
2424
Configurations include base url links, sort/show/hide fields for each of the three
2525
hierarchical detail pages (collection, dataset, file), search filter fields, and

p/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<link rel="apple-touch-icon" sizes="76x76" href="/labcas-ui/assets/img/apple-icon.png">
77
<link rel="icon" type="image/png" href="/labcas-ui/assets/img/favicon.png">
88
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
9-
<title>Labcas 2.0</title>
9+
<title>Labcas 2.1</title>
1010
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no' name='viewport' />
1111
<!-- Fonts and icons -->
1212
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700,200" rel="stylesheet" />
@@ -167,7 +167,7 @@
167167
U.S. Government Sponsorship Acknowledged.
168168
</p>
169169
<p>
170-
Labcas version 2.0, Licensed under <a href='https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html'>GPLv2</a>.
170+
Labcas version 2.1, Licensed under <a href='https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html'>GPLv2</a>.
171171
<a href='https://mcl-labcas.jpl.nasa.gov/ui/static/plupload-2.1.9.zip'>Get Plupload</a>.
172172
</p>
173173

0 commit comments

Comments
 (0)