[879b32]: / qiita_pet / templates / analysis_description.html

Download this file

303 lines (290 with data), 10.8 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
{% extends sitebase.html %} {% block head %}
<link
rel="stylesheet"
href="{% raw qiita_config.portal_dir %}/static/vendor/css/select2.min.css"
type="text/css"
/>
<script
type="text/javascript"
src="{% raw qiita_config.portal_dir %}/static/vendor/js/select2.min.js"
></script>
<script
type="text/javascript"
src="{% raw qiita_config.portal_dir %}/static/js/sharing.js"
></script>
<script type="text/javascript">
/*
* update_analysis_reservation will update the analysis resevation
*
* @param analysis_id: The id of the analysis to update
* @param reservation: The reservation
*
*/
function update_analysis_reservation(analysis_id, reservation) {
$.ajax({
url: '{% raw qiita_config.portal_dir %}/analysis/description/{{analysis_id}}/',
type: 'PATCH',
data: {'op': 'replace', 'path': 'reservation', 'value': reservation},
success: function(data) {
$('#analysis-reservation-modal-view').modal('hide');
if(data.status == 'error') {
bootstrapAlert(data.message, "danger");
} else {
$('#reservation').val(reservation);
$('#analysis-reservation-modal-data').text("Reservation: " + reservation);
}
}
});
}
$(document).ready(function(){
// Create the processing network view object
newProcessingNetworkVue("#analysis-graph-vue");
// Show the alert message, if any
{% if alert_msg %}
bootstrapAlert("{{alert_msg}}", "{{alert_type}}");
{% end %}
// starting share
init_sharing("{% raw qiita_config.portal_dir %}");
update_share();
$('#studies-artifacts-table').dataTable();
});
</script>
<style>
.graph {
width: 80%;
height: 400px;
border: 1px solid #ccc;
}
</style>
{% end %} {% block content %}
<div class="row">
<div class="col">
<form
action="{% raw qiita_config.portal_dir %}/analysis/description/{{analysis_id}}/"
method="post"
id="make-public"
>
<input name="analysis_id" value="{{analysis_id}}" type="hidden" />
</form>
<h2>
{{analysis_name}} - ID {{analysis_id}}
<small>
({{analysis_description}}) - {% if analysis_is_public %}
<b>Public</b>
{% else %}
<b>Private</b>
{% end %} {% if analysis_mapping_id is not None %}
<a
class="btn btn-default"
href="{% raw qiita_config.portal_dir %}/download/{{analysis_mapping_id}}"
><span class="glyphicon glyphicon-download-alt"></span>
Mapping file</a
>
{% end %} {% if not analysis_is_public %}
<a
class="btn btn-default"
onclick="if (confirm('Are you sure you want to make this analysis public? Note that this will not allow you to delete your analysis later.')) { $('#make-public').submit(); }"
><span class="glyphicon glyphicon-globe"></span> Make
analysis public</a
>
{% end %}
<a
class="btn btn-default"
data-toggle="modal"
data-target="#analysis-reservation-modal-view"
><span
class="glyphicon glyphicon-pencil"
name="analysis-reservation-modal-data"
id="analysis-reservation-modal-data"
>
Reservation: {% raw analysis_reservation %}</span
></a
>
</small>
</h2>
Owner:
<a href="mailto:{{analysis_owner}}">{{analysis_owner}}</a>
<br />
<a
class="btn btn-info"
data-toggle="modal"
data-target="#share-analysis-modal-view"
onclick="modify_sharing({{analysis_id}});"
><span class="glyphicon glyphicon-share"></span
></a>
Shared with: <span id="shared_html_{{analysis_id}}"></span>
<div class="row">
<div class="col-md-12">
<b>Studies and artifacts used in this analysis:</b>
<button
class="btn btn-default"
data-toggle="collapse"
data-target="#studies-artifacts-div"
>
<span class="glyphicon glyphicon-eye-open"></span>
Show/Hide
</button>
<div
id="studies-artifacts-div"
class="collapse"
style="
padding: 10px 10px 10px 10px;
border-radius: 10px;
background: #eee;
"
>
<table
id="studies-artifacts-table"
class="display table-bordered table-hover"
style="width: 100%"
>
<thead>
<tr>
<th>Artifact ID</th>
<th>Study IDs</th>
<th>Prep IDs</th>
<th>Study Title</th>
<th>Parent Processing</th>
<th>Merging Scheme</th>
<th>Total Samples Selected</th>
</tr>
</thead>
<tbody>
{% for aid, data in artifacts.items() %}
<tr>
<td>{{aid}}</td>
<td>{{data[0]}}</td>
<td>{{', '.join(data[4])}}</td>
<td>
<a
href="{% raw qiita_config.portal_dir %}/study/description/{{data[0]}}"
target="_blank"
>{{data[1]}}</a
>
</td>
<td>{{data[2][1]}}</td>
<td>{{data[2][0]}}</td>
<td>{{ len(data[3]) }}</td>
</tr>
{% end %}
</tbody>
</table>
</div>
</div>
</div>
</div>
<hr />
</div>
<div id="analysis-graph-vue" style="margin-left: 15px">
<processing-graph
v-bind:is-analysis-pipeline="true"
ref="procGraph"
portal="{% raw qiita_config.portal_dir %}"
graph-endpoint="/analysis/description/{{analysis_id}}/graph/"
jobs-endpoint="/analysis/description/{{analysis_id}}/jobs/"
element-id="{{analysis_id}}"
></processing-graph>
</div>
<div class="row" id="processing-content-div"></div>
<!-- Modal used to share the analysis -->
<div
class="modal fade"
id="share-analysis-modal-view"
tabindex="-1"
role="dialog"
aria-labelledby="myModalLabel"
aria-hidden="true"
>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button
type="button"
class="close"
data-dismiss="modal"
aria-hidden="true"
>
&times;
</button>
<h4 class="modal-title" id="myModalLabel">
Modify Sharing Settings
</h4>
</div>
<div class="modal-body">
<div>
<div class="form-group">
<label for="shares-select">Add/Remove Users</label>
<select
multiple
class="analysis"
id="shares-select"
data-share-url="{% raw qiita_config.portal_dir %}/analysis/sharing/"
data-current-id="{{analysis_id}}"
style="width: 50%"
></select>
<br />
<br />
Adding or removing email addresses automatically updates
who the analysis is shared with. Once you click the `X`
or give mouse focus to the analysis page you'll see your
new sharing settings.
</div>
</div>
</div>
<div class="modal-footer"></div>
</div>
</div>
</div>
<!-- Modal used to change reservation -->
<div
class="modal fade"
id="analysis-reservation-modal-view"
tabindex="-1"
role="dialog"
aria-labelledby="myModalLabel"
aria-hidden="true"
>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button
type="button"
class="close"
data-dismiss="modal"
aria-hidden="true"
>
&times;
</button>
<h4 class="modal-title" id="myModalLabel">
Modify Reservation Setting
</h4>
</div>
<div class="modal-body">
<div>
<div class="form-group">
<label for="shares-select"
>Reservation (optional)</label
>
<input
type="text"
class="form-control"
id="reservation"
name="reservation"
value="{{ analysis_reservation }}"
placeholder="Reservation (optional)"
/>
<button
id="update-reservation-btn"
class="btn btn-default"
onclick="update_analysis_reservation({{analysis_id}}, $('#reservation').val());"
>
Update
</button>
</div>
</div>
</div>
<div class="modal-footer"></div>
</div>
</div>
</div>
{% end %}