Skip to content

Commit 0502120

Browse files
authored
Merge pull request #1534 from ImagingDataCommons/release-50-sp
#1525
2 parents f5efdf6 + a706f38 commit 0502120

7 files changed

Lines changed: 134 additions & 28 deletions

File tree

static/css/search.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,9 @@ td.license, th.license {
449449
#studies_table_head th, #studies_table td {
450450
word-break: break-word; }
451451

452-
#studies_table_head th.project-name, th.case-id,
453-
#studies_table td.project-name, td.case-id {
454-
width: 12%;
452+
#studies_table_head th.case-id,
453+
#studies_table td.case-id {
454+
width: 16%;
455455
}
456456

457457
#studies_table_head th.study-id,
@@ -466,7 +466,7 @@ td.license, th.license {
466466

467467
#studies_table_head th.study-description,
468468
#studies_table td.study-description {
469-
width:45%;
469+
width:34%;
470470
}
471471

472472
#studies_table_head th.numrows,

static/js/collections_list.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ require(['jquery', 'datatables.net','jqueryui', 'bootstrap', 'base'],
3636
let collex_info = $(this).siblings('.collection-explore');
3737
let type = collex_info.data('collex-type');
3838
let desc = collection_descs[$(this).data('collex-id')];
39-
if(type === 'Analysis'){
39+
if(type === 'A'){
4040
desc += `<p><b>Collections:</b> `+collex_info.data('collex-collex').replaceAll(",", ", ")+`</p>`;
4141
}
4242
let sources = $(this).data('doi').split(" ").map(function(i){
@@ -51,7 +51,7 @@ require(['jquery', 'datatables.net','jqueryui', 'bootstrap', 'base'],
5151

5252
$('#collections-table tbody').on('click', 'td.collection-explore', function () {
5353
let url = '/explore/filters/?'
54-
+ ($(this).data('collex-type') === 'Analysis' ? "analysis_results_id" : "collection_id")
54+
+ ($(this).data('collex-type') === 'A' ? "analysis_results_id" : "collection_id")
5555
+ "=" + $(this).data('collex-id');
5656

5757
window.location.href = url;

static/js/tables.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ define(['cartutils','filterutils','tippy','jquery', 'base'], function(cartutils,
951951
}
952952
}, {
953953
"type": "text", "orderable": true, data: 'PatientID', render: function (data) {
954-
return data.length > 18 ? pretty_print_id(data, 16) : data;
954+
return data.length > 26 ? pretty_print_id(data, 21) : data;
955955
}
956956
}, {
957957
"type": "text", "orderable": true, data: 'StudyInstanceUID', render: function (data) {

static/js/tooltips.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,13 @@ require([
238238
};
239239

240240
const chromium_only = "Direct download is only available in Chromium browsers.";
241+
const plz_use = "Please use idc-index or a cohort/cart manifest to download these files.";
242+
241243
const disabled_download_tooltip = {
242244
plugins: [dynamicTipFuncDL],
243245
dynamicTip: function(ref){
244246
if($(ref).hasClass('download-size-disabled')) {
245-
return "This set of images is over 3TB in size. Please use manifest download to obtain these images.";
247+
return `This set of images is over 3TB in size. ${plz_use}`;
246248
}
247249
return chromium_only;
248250
},
@@ -291,8 +293,8 @@ require([
291293

292294
let disabled_messages = {
293295
'download-all-disabled': chromium_only,
294-
'download-size-disabled': "This set of files is over 3TB in size. Please use manifest download to obtain these files.",
295-
'download-count-disabled': "This set of files contains over 65000 records. Please use manifest download to obtain these files.",
296+
'download-size-disabled': `This set of files is over 3TB in size. ${plz_use}`,
297+
'download-count-disabled': `This set of files contains over 65000 records. ${plz_use}`,
296298
'download-cart-disabled': "Add items to the cart to enable this feature.",
297299
'download-cohort-disabled': "Select a filter to enable this feature."
298300
};
@@ -387,6 +389,18 @@ require([
387389
maxWidth: 800
388390
});
389391

392+
tippy.delegate('#collections-table', {
393+
content: function(reference) {
394+
return $(reference).attr("data-tooltip");
395+
},
396+
theme: 'dark',
397+
placement: 'right',
398+
arrow: false,
399+
target: '.collex-table-tip',
400+
interactive: true, // This is required for any table tooltip to show at the appropriate spot!
401+
maxWidth: 200
402+
});
403+
390404
tippy.delegate('#body', disabled_download_tooltip);
391405
tippy.delegate('#body', download_tooltip);
392406

templates/collections/collection_details.html

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,17 @@ <h3>{{ collection_type }} <i class="fa fa-solid fa-ellipsis-v collection-spacer"
3434
{% if size_warning %}data-toggle="modal" data-target="#download-warning"{% endif %}
3535
>
3636
Direct <i class="fa fa-solid fa-download"></i></a></li>
37-
<li class="collex-list-item"><a class="dropdown-item" href="#">idc-index <i class="fa fa-solid fa-list"></i></a></li>
38-
<li class="collex-list-item"><a class="dropdown-item" href="#">Manifest <i class="fa fa-solid fa-list"></i></a></li>
37+
<li class="collex-list-item">
38+
<a
39+
class="dropdown-item"
40+
role="button"
41+
data-toggle="modal"
42+
data-bs-toggle="modal"
43+
data-bs-target="#export-collex-manifest-modal"
44+
data-target="#export-collex-manifest-modal">idc-index <i class="fa fa-solid fa-list"></i>
45+
</a>
46+
</li>
47+
{# <li class="collex-list-item"><a class="dropdown-item" href="#">Manifest <i class="fa fa-solid fa-list"></i></a></li>#}
3948
{% endwith %}
4049
</ul>
4150
</div>
@@ -114,7 +123,9 @@ <h3>Description</h3>
114123

115124
{% include 'idc/citations-modal.html' %}
116125
{% include 'idc/download-modal.html' %}
117-
126+
{% with collection_type=collection_type collection_id=collection_id %}
127+
{% include 'idc/export-collex-modal.html' %}
128+
{% endwith %}
118129
{% endblock %}
119130

120131
{% block js_file %}

templates/collections/collections_list.html

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ <h3 class="pull-left">Collections</h3>
2424
<table id="collections-table" class="table collex-table sortable_table table-striped table-hover">
2525
<thead>
2626
<th></th>
27-
<th class="id-col">ID</th>
27+
<th class="id-col">Name</th>
28+
<th>Explore Images</th>
2829
<th class="collex-type-col">Collection Type</th>
2930
<th class="access-col">Access</th>
3031
<th class="cancer-type-col">Cancer Type</th>
@@ -35,41 +36,55 @@ <h3 class="pull-left">Collections</h3>
3536
</thead>
3637
<colgroup>
3738
<col style="width: 3%">
38-
<col style="width: 12%">
39+
<col style="width: 16%">
3940
<col style="width: 8%">
4041
<col style="width: 8%">
42+
<col style="width: 4%">
43+
<col style="width: 20%">
4144
<col style="width: 13%">
4245
<col style="width: 8%">
43-
<col style="width: 8%">
44-
<col style="width: 9%">
46+
<col style="width: 15%">
4547
<col style="width: 9%">
4648
</colgroup>
4749
<tbody>
4850
{% for collection in active_collections %}
49-
{% with collex_type=collection.get_collection_type %}
51+
{% with collex_type_display=collection.get_collection_type %}
5052
<tr>
5153
<td class="details-control" data-doi="{{ collection.doi }}"
5254
data-source-url="{{ collection.source_url }}"
5355
data-collex-id="{{ collection.collection_id }}"
5456
title="Click to display collection description."
5557
>
5658
<i class="fa-solid fa-circle-plus show-button"> </i><i class="fa-solid fa-circle-minus hide-button"> </i></td>
59+
<td class="collection-name"
60+
>
61+
<a class="collex-table-tip"
62+
data-tooltip="View this {{ collex_type_display }}'s page (opens a new tab)."
63+
{% if collection.collection_type == 'A' %}
64+
href="/analysis_results/{{ collection.collection_id }}" target="_blank" rel="nofollow noreferrer">
65+
{{ collection.collection_id }}
66+
{% else %}
67+
href="/collections/{{ collection.collection_id }}" target="_blank" rel="nofollow noreferrer">
68+
{% if collection.tcia_collection_id|length == 0 %}
69+
{{ collection.name }}
70+
{% else %}
71+
{{ collection.tcia_collection_id }}
72+
{% endif %}
73+
{% endif %}
74+
</a>
75+
</td>
5776
<td class="collection-explore"
5877
data-collex-id="{{ collection.collection_id }}"
5978
data-collex-collex="{{ collection.collections }}"
60-
data-collex-type="{{ collex_type }}"
79+
data-collex-type="{{ collection.collection_type }}"
6180
>
62-
<a role="button" >
63-
{% if collex_type == 'Analysis' %}
64-
{{ collection.collection_id }}
65-
{% elif collection.tcia_collection_id|length == 0 %}
66-
{{ collection.name }}
67-
{% else %}
68-
{{ collection.tcia_collection_id }}
69-
{% endif %}
81+
<a role="button" class="collex-table-tip"
82+
data-tooltip="Open the data explorer filtered to this {{ collex_type_display }}."
83+
>
84+
<i class="fa-solid fa-eye"></i>
7085
</a>
7186
</td>
72-
<td>{{ collection.get_collection_type }}</td>
87+
<td>{{ collex_type_display }}</td>
7388
<td>{{ collection.access }}</td>
7489
<td>{{ collection.cancer_type }}</td>
7590
<td>{{ collection.image_types }}</td>
@@ -94,6 +109,7 @@ <h3 class="pull-left">Collections</h3>
94109
{{ active_collection_descs|json_script:"collection_descs" }}
95110
{{ block.super }}
96111
<script type="text/javascript" src="{% static 'js/collections_list.js' %}?v={{ APP_VERSION }}"></script>
112+
<script type="text/javascript" src="{% static 'js/tooltips.js' %}?v={{ APP_VERSION }}"></script>
97113
<script>
98114
const collection_descs = JSON.parse(document.getElementById('collection_descs').textContent);
99115
</script>
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<!-- Export Collection Manifest Modal -->
2+
<div class="modal fade" id="export-collex-manifest-modal" tabindex="-1" role="dialog"
3+
aria-labelledby="exportCollexManifestModal" aria-hidden="true" data-file-timestamp="{% now "Ymd_Gis" %}">
4+
<div class="modal-dialog">
5+
<div class="modal-content">
6+
<div class="modal-header">
7+
<h4 class="modal-title" id="exportCollexManifestModal">{{ collection_type }} Export</h4>
8+
<button type="button" class="close btn-close" data-dismiss="modal" data-bs-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
9+
</div>
10+
<div class="modal-body">
11+
<div class="form-group list-group">
12+
<ul class="nav nav-tabs manifest">
13+
<li class="filter-tab active manifest-idc-index" role="presentation">
14+
<a href="#manifest-idc-index" role="tab" data-toggle="tab" title="idc-index manifest"
15+
aria-expanded="true"
16+
>
17+
idc-index
18+
</a>
19+
</li>
20+
</ul>
21+
<div class="tab-content">
22+
<div id="manifest-idc-index" class="tab-pane manifest active" role="tab-panel">
23+
<p>
24+
<br />
25+
To obtain these images, install the
26+
<a class="external-link" url="https://github.com/ImagingDataCommons/idc-index"
27+
data-toggle="modal" data-target="#external-web-warning">idc-index
28+
<i class="fa-solid fa-external-link external-link-icon" aria-hidden="true"></i>
29+
</a> python package:</p>
30+
<p>
31+
<span class="code">
32+
pip install --upgrade idc-index
33+
</span> <a
34+
role="button" class="pip-install copy-this"
35+
content="pip install --upgrade idc-index"
36+
title="Copy command to clipboard">
37+
<i class="fa-solid fa-copy" aria-hidden="true"></i>
38+
</a>
39+
</p>
40+
<p>
41+
Then run the following command:
42+
</p>
43+
<p>
44+
<span class="code idc-index-text">
45+
idc download {{ collection_id }}
46+
</span> <a
47+
role="button" class="idc-index copy-this"
48+
content="idc download {{ collection_id }}"
49+
title="Copy command to clipboard">
50+
<i class="fa-solid fa-copy" aria-hidden="true"></i>
51+
</a>
52+
</p>
53+
<p>To learn about more ways to download IDC data, please <a
54+
class="external-link" href="" url="https://learn.canceridc.dev/data/downloading-data"
55+
data-toggle="modal" data-target="#external-web-warning"
56+
>
57+
see IDC download instructions page. <i class="fa-solid fa-external-link external-link-icon" aria-hidden="true"></i></a>
58+
</p>
59+
</div>
60+
</div>
61+
</div>
62+
</div>
63+
</div>
64+
</div>
65+
</div>

0 commit comments

Comments
 (0)