Skip to content

Commit 80de254

Browse files
committed
-> #1525
1 parent 1d789c1 commit 80de254

3 files changed

Lines changed: 94 additions & 13 deletions

File tree

static/css/bootstrap-idc.css

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,19 @@
7474
display: none !important;
7575
}
7676

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+
7790
.show-more, .show-less {
7891
cursor: pointer;
7992
font-weight: bold;
@@ -82,4 +95,19 @@
8295

8396
.show-more:hover, .show-less:hover {
8497
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;
85113
}

static/js/collection_details.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,14 @@ require(['jquery', 'datatables.net','jqueryui', 'bootstrap', 'base', 'tooltips']
2525

2626
$('#collection_details').on('click', '.show-more, .show-less', function(){
2727
const clicked = $(this);
28+
let xtra_vals = $(clicked.attr('data-toggle-target')).find('.extra-values');
2829
if(clicked.hasClass('show-more')) {
29-
let xtra_vals = $(clicked.attr('data-show-target')).find('.extra-values');
3030
xtra_vals.removeClass('is-hidden');
31-
$('.show-more-count').hide();
31+
$('.show-more-count').addClass('is-hidden');
3232
}
3333
if(clicked.hasClass('show-less')) {
34-
let xtra_vals = $(clicked.attr('data-hide-target')).find('.extra-values');
3534
xtra_vals.addClass('is-hidden');
36-
$('.show-more-count').show();
35+
$('.show-more-count').removeClass('is-hidden');
3736
}
3837
clicked.siblings('.show-sib').removeClass('is-hidden');
3938
clicked.addClass('is-hidden');

templates/collections/collection_details.html

Lines changed: 63 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,28 +101,82 @@ <h4>Details</h4>
101101
{% with col_count=collections|length %}
102102
{% if col_count > 5 %}
103103
<p>
104-
<a class="show-more show-sib" data-show-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-hide-target=".ar-collex-set"><i class="fa-solid fa-minus-circle"></i> show less</a>
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>
106106
</p>
107107
{% endif %}
108108
<ul class="ar-collex-set">
109109
{% for col in collections %}
110110
<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>
111111
{% if forloop.counter == 6 %}
112-
<li class="show-more-count">... {{ col_count|add:-5 }} more collections</li>
112+
<span class="show-more-count">... {{ col_count|add:-5 }} more collections</span>
113113
{% endif %}
114114
{% endfor %}
115115
</ul>
116-
{% endwith %}
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 %}
117139
</p>
118140
{% endif %}
119141
<p class="collex-divider"></p>
120-
{% for doi in dois %}
121-
<p><i class="fa fa-solid fa-globe"></i> <a href="https://doi.org/{{ doi }}" target="_blank" rel="nofollow noreferrer">{{ doi }}</a></p>
122-
{% endfor %}
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 %}
123177
<p>
124-
<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
125-
</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>
126180
</p>
127181
</div>
128182
</div>

0 commit comments

Comments
 (0)