Skip to content

Commit 0dca178

Browse files
authored
Merge pull request #1537 from ImagingDataCommons/release-50-sp
#1525
2 parents 29bbc78 + 80de254 commit 0dca178

3 files changed

Lines changed: 143 additions & 13 deletions

File tree

static/css/bootstrap-idc.css

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,51 @@
6363

6464
.collection-header .collection-buttons {
6565
margin-bottom: 20px;
66+
}
67+
68+
.collex-divider {
69+
margin: 25px 20px 25px 20px;
70+
border-bottom: 1px solid black;
71+
}
72+
73+
.is-hidden {
74+
display: none !important;
75+
}
76+
77+
.ar-collex-set {
78+
list-style-type: circle;
79+
}
80+
81+
.ar-collex-set li {
82+
list-style-type: circle;
83+
margin-left: 20px;
84+
}
85+
86+
.ar-collex-set li a {
87+
margin-left: -5px;
88+
}
89+
90+
.show-more, .show-less {
91+
cursor: pointer;
92+
font-weight: bold;
93+
font-size: smaller;
94+
}
95+
96+
.show-more:hover, .show-less:hover {
97+
text-decoration: none;
98+
}
99+
100+
.doi-section-title {
101+
font-weight: 500;
102+
}
103+
104+
.doi-list li {
105+
margin-top: 5px;
106+
margin-bottom: 5px;
107+
margin-left: 10px;
108+
}
109+
110+
.doi-list .fa-li i {
111+
font-size: 12px;
112+
vertical-align: middle;
66113
}

static/js/collection_details.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,19 @@ require(['jquery', 'datatables.net','jqueryui', 'bootstrap', 'base', 'tooltips']
2222
download_btn.attr('data-disabled-type','download-all-disabled');
2323
download_btn.addClass('is-disabled');
2424
}
25+
26+
$('#collection_details').on('click', '.show-more, .show-less', function(){
27+
const clicked = $(this);
28+
let xtra_vals = $(clicked.attr('data-toggle-target')).find('.extra-values');
29+
if(clicked.hasClass('show-more')) {
30+
xtra_vals.removeClass('is-hidden');
31+
$('.show-more-count').addClass('is-hidden');
32+
}
33+
if(clicked.hasClass('show-less')) {
34+
xtra_vals.addClass('is-hidden');
35+
$('.show-more-count').removeClass('is-hidden');
36+
}
37+
clicked.siblings('.show-sib').removeClass('is-hidden');
38+
clicked.addClass('is-hidden');
39+
});
2540
});

templates/collections/collection_details.html

Lines changed: 81 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ <h4>Details</h4>
8282
</p>
8383
{% endif %}
8484
<p>
85-
<b>Cancer Type: </b>{{ cancer_type }}
85+
<b>Cancer Type(s): </b>{{ cancer_type }}
8686
</p>
8787
{% if species != "" %}
8888
<p>
@@ -94,21 +94,89 @@ <h4>Details</h4>
9494
<b>Supporting Data: </b>{{ supporting_data }}
9595
</p>
9696
{% endif %}
97-
{% if collections != "" %}
98-
<p>
99-
<b>Collections: </b>
97+
{% if collections != "" %}
98+
<p class="collex-divider"></p>
99+
<p>
100+
<b>Collections</b>
101+
{% with col_count=collections|length %}
102+
{% if col_count > 5 %}
103+
<p>
104+
<a class="show-more show-sib" data-toggle-target=".ar-collex-set"><i class="fa-solid fa-plus-circle"></i> show more</a>
105+
<a class="show-less show-sib is-hidden" data-toggle-target=".ar-collex-set"><i class="fa-solid fa-minus-circle"></i> show less</a>
106+
</p>
107+
{% endif %}
108+
<ul class="ar-collex-set">
100109
{% for col in collections %}
101-
<a href="{% url 'collection_details' col %}">{{ col }}</a>
110+
<li class="ar-collex{% if forloop.counter > 5 %} extra-values is-hidden{% endif %}"><a href="{% url 'collection_details' col.collection_id %}">{{ col.collection_name }}</a></li>
111+
{% if forloop.counter == 6 %}
112+
<span class="show-more-count">... {{ col_count|add:-5 }} more collections</span>
113+
{% endif %}
102114
{% endfor %}
103-
</p>
104-
{% endif %}
105-
<p style="margin-left: 20px; margin-right: 20px; margin-top: 25px; margin-bottom: 25px; border-bottom: 1px solid black;"></p>
106-
{% for doi in dois %}
107-
<p><i class="fa fa-solid fa-globe"></i> <a href="https://doi.org/{{ doi }}" target="_blank" rel="nofollow noreferrer">{{ doi }}</a></p>
108-
{% endfor %}
115+
</ul>
116+
{% endwith %}
117+
</p>
118+
{% endif %}
119+
{% if analysis_results != "" %}
120+
<p class="collex-divider"></p>
121+
<p>
122+
<b>Analysis Results</b>
123+
{% with col_count=analysis_results|length %}
124+
{% if col_count > 5 %}
125+
<p>
126+
<a class="show-more show-sib" data-toggle-target=".ar-collex-set"><i class="fa-solid fa-plus-circle"></i> show more</a>
127+
<a class="show-less show-sib is-hidden" data-toggle-target=".ar-collex-set"><i class="fa-solid fa-minus-circle"></i> show less</a>
128+
</p>
129+
{% endif %}
130+
<ul class="ar-collex-set">
131+
{% for col in analysis_results %}
132+
<li class="ar-collex{% if forloop.counter > 5 %} extra-values is-hidden{% endif %}"><a href="{% url 'collection_details' col.collection_id %}">{{ col.collection_id }}</a></li>
133+
{% if forloop.counter == 6 %}
134+
<span class="show-more-count">... {{ col_count|add:-5 }} more analysis results</span>
135+
{% endif %}
136+
{% endfor %}
137+
</ul>
138+
{% endwith %}
139+
</p>
140+
{% endif %}
141+
<p class="collex-divider"></p>
142+
<p><b>DOIs</b></p>
143+
{% if collection_type == "Analysis Result" %}
144+
<p>
145+
<i class="fa-solid fa-globe"></i> {{ collection_id }} <a href="https://doi.org/{{ doi }}" target="_blank" rel="nofollow noreferrer">{{ doi }}</a>
146+
</p>
147+
<p>
148+
<span class="doi-section-title">Collections analyzed:</span>
149+
<ul class="doi-list fa-ul">
150+
{% for col in collections %}
151+
<li><span class="fa-li"><i class="fa-solid fa-globe"></i></span>{{ col.collection_name }}
152+
{% for doi in col.doi %} <a href="https://doi.org/{{ doi }}" target="_blank" rel="nofollow noreferrer">{{ doi }}</a>{% endfor %}
153+
</li>
154+
{% endfor %}
155+
</ul></p>
156+
</p>
157+
{% endif %}
158+
{% if collection_type == "Collection" %}
159+
<p>
160+
<span class="doi-section-title">{{ collection_name }} original data:</span>
161+
<ul class="doi-list fa-ul">
162+
{% for entry in doi %}
163+
<li><span class="fa-li"><i class="fa-solid fa-globe"></i></span><a href="https://doi.org/{{ entry }}" target="_blank" rel="nofollow noreferrer">{{ entry }}</a></li>
164+
{% endfor %}
165+
</ul>
166+
</p>
167+
{% endif %}
168+
{% if analysis_results != "" %}
169+
<p>
170+
<span class="doi-section-title">Analysis Results:</span>
171+
<ul class="doi-list fa-ul">
172+
{% for ar in analysis_results %}
173+
<li><span class="fa-li"><i class="fa-solid fa-globe"></i></span>{{ ar.collection_id }} <a href="https://doi.org/{{ ar.doi }}" target="_blank" rel="nofollow noreferrer">{{ ar.doi }}</a></li>
174+
{% endfor %}
175+
</ul></p>
176+
{% endif %}
109177
<p>
110-
<button type="button" role="button" class="btn btn-small btn-primary citations-button for-collection" data-bs-toggle="modal" data-bs-target="#citations-modal" data-toggle="modal" data-target="#citations-modal" aria-expanded="false" data-citations=""> View Citations
111-
</button>
178+
<button type="button" role="button" class="btn btn-small btn-primary citations-button for-collection" data-bs-toggle="modal" data-bs-target="#citations-modal" data-toggle="modal" data-target="#citations-modal" aria-expanded="false" data-citations=""> View Citations
179+
</button>
112180
</p>
113181
</div>
114182
</div>

0 commit comments

Comments
 (0)