|
66 | 66 | })
|
67 | 67 | }
|
68 | 68 |
|
| 69 | + function update_sample_prep(){ |
| 70 | + show_loading('sample-prep-information'); |
| 71 | + $.get('{% raw qiita_config.portal_dir %}/study/description/sample_summary/', { study_id: {{study_id}} }) |
| 72 | + .done(function(data) { |
| 73 | + $("#sample-prep-information").html(data); |
| 74 | + }); |
| 75 | + } |
| 76 | + |
69 | 77 | $(document).ready(function() {
|
70 | 78 | $('#file-btn').prop('disabled', true);
|
71 | 79 | $("#file-selector").change(function (event){
|
@@ -155,44 +163,58 @@ <h4>
|
155 | 163 | </div>
|
156 | 164 | {% end %}
|
157 | 165 |
|
| 166 | + |
158 | 167 | {% if stats %}
|
159 |
| - <div class="panel panel-default" id="summary"> |
160 |
| - <div class="panel-heading"> |
161 |
| - Sample information summary |
| 168 | + |
| 169 | +<div class="container"> |
| 170 | + <ul class="nav nav-pills"> |
| 171 | + <li class="active"> |
| 172 | + <a href="#sample-information" data-toggle="tab">Sample information</a> |
| 173 | + </li> |
| 174 | + <li class="nav-item"> |
| 175 | + <a href="#sample-prep-information" data-toggle="tab" onclick="update_sample_prep();">Sample and preparation summary</a> |
| 176 | + </li> |
| 177 | + </ul> |
| 178 | + |
| 179 | + <div class="tab-content clearfix"> |
| 180 | + <div class="tab-pane" id="sample-prep-information"> |
162 | 181 | </div>
|
163 | 182 |
|
164 |
| - <table class="table"> |
165 |
| - {% for i, (category, summary) in enumerate(viewitems(stats), -1) %} |
166 |
| - <tr id="row_{{i}}"> |
167 |
| - <td> |
168 |
| - {% if editable %} |
169 |
| - <a class="btn btn-danger" onclick="delete_column('{{category}}', {{i}});"><span class="glyphicon glyphicon-trash"></span></a> |
170 |
| - {% else %} |
171 |
| - |
172 |
| - {% end %} |
173 |
| - </td> |
174 |
| - <td colspan="2"> |
175 |
| - {% if len(summary) == 1 %} |
176 |
| - <b>{{category}}</b>: <tt>{{summary[0][0]}}</tt> is repeated in all rows. |
| 183 | + <div class="tab-pane active" id="sample-information"> |
| 184 | + <table class="table"> |
| 185 | + {% for i, (category, summary) in enumerate(viewitems(stats), -1) %} |
| 186 | + <tr id="row_{{i}}"> |
| 187 | + <td> |
| 188 | + {% if editable %} |
| 189 | + <a class="btn btn-danger" onclick="delete_column('{{category}}', {{i}});"><span class="glyphicon glyphicon-trash"></span></a> |
| 190 | + {% else %} |
| 191 | + |
| 192 | + {% end %} |
177 | 193 | </td>
|
178 |
| - {% elif len(summary) == num_samples %} |
179 |
| - <b>{{category}}</b>: All the values in this category are different. |
| 194 | + <td colspan="2"> |
| 195 | + {% if len(summary) == 1 %} |
| 196 | + <b>{{category}}</b>: <tt>{{summary[0][0]}}</tt> is repeated in all rows. |
180 | 197 | </td>
|
181 |
| - {% else %} |
182 |
| - <b>{{category}}<b> |
183 |
| - |
184 |
| - <button type="button" class="btn" data-toggle="collapse" data-target=".{{i}}collapsed">values</button> |
185 |
| - </td> |
186 |
| - {% for row in summary %} |
187 |
| - </tr> |
188 |
| - <tr class="collapse {{i}}collapsed"> |
189 |
| - <td> </td> |
190 |
| - <td>{{row[0]}}</td> |
191 |
| - <td>{{row[1]}}</td> |
192 |
| - {% end %} |
193 |
| - {% end %} |
194 |
| - </tr> |
195 |
| - {% end %} |
196 |
| - </table> |
| 198 | + {% elif len(summary) == num_samples %} |
| 199 | + <b>{{category}}</b>: All the values in this category are different. |
| 200 | + </td> |
| 201 | + {% else %} |
| 202 | + <b>{{category}}<b> |
| 203 | + |
| 204 | + <button type="button" class="btn" data-toggle="collapse" data-target=".{{i}}collapsed">values</button> |
| 205 | + </td> |
| 206 | + {% for row in summary %} |
| 207 | + </tr> |
| 208 | + <tr class="collapse {{i}}collapsed"> |
| 209 | + <td> </td> |
| 210 | + <td>{{row[0]}}</td> |
| 211 | + <td>{{row[1]}}</td> |
| 212 | + {% end %} |
| 213 | + {% end %} |
| 214 | + </tr> |
| 215 | + {% end %} |
| 216 | + </table> |
| 217 | + </div> |
197 | 218 | </div>
|
| 219 | +</div> |
198 | 220 | {% end %}
|
0 commit comments