|
4 | 4 | });
|
5 | 5 | </script>
|
6 | 6 |
|
7 |
| - |
8 |
| -{% from future.utils import viewitems %} |
9 | 7 | <div class="panel panel-default">
|
10 | 8 | <div class="panel-heading">
|
11 | 9 | Information summary
|
12 | 10 | </div>
|
13 | 11 | <div id="summary-table-div">
|
| 12 | + |
14 | 13 | <table class="table">
|
15 | 14 | {% for i, (category, summary) in enumerate(stats, -1) %}
|
16 | 15 | <tr id="row_{{i}}">
|
17 | 16 | <td>
|
18 |
| - <a class="btn btn-danger" onclick="delete_prep_column({{pid}}, '{{category}}', {{i}});"><span class="glyphicon glyphicon-trash"></span></a> |
19 |
| - </td> |
20 |
| - {% if len(summary) == 1 %} |
21 |
| - <td colspan="2"> |
22 |
| - <b>{{category}}</b>: <tt>{{summary[0][0]}}</tt> is repeated in all rows. |
| 17 | + {% if editable %} |
| 18 | + <a class="btn btn-danger" onclick="delete_prep_column({{pid}}, '{{category}}', {{i}});"><span class="glyphicon glyphicon-trash"></span></a> |
| 19 | + {% else %} |
| 20 | + |
| 21 | + {% end %} |
23 | 22 | </td>
|
24 |
| - {% elif len(set([row[1] for row in summary])) == 1 %} |
25 | 23 | <td colspan="2">
|
26 |
| - <b>{{category}}</b>: All the values in this category are different. |
27 |
| - </td> |
28 |
| - {% else %} |
29 |
| - <th colspan="2" align="center">{{category}}</th> |
30 |
| - {% for row in summary %} |
31 |
| - <tr> |
32 |
| - <td width="5px"> </td> |
33 |
| - <td>{{row[0]}}</td> |
34 |
| - <td>{{row[1]}}</td> |
35 |
| - </tr> |
| 24 | + {% if len(summary) == 1 %} |
| 25 | + <b>{{category}}</b>: <tt>{{summary[0][0]}}</tt> is repeated in all rows. |
| 26 | + </td> |
| 27 | + {% elif len(summary) == num_samples %} |
| 28 | + <b>{{category}}</b>: All the values in this category are different. |
| 29 | + </td> |
| 30 | + {% else %} |
| 31 | + <b>{{category}}<b> |
| 32 | + |
| 33 | + <button type="button" class="btn" data-toggle="collapse" data-target=".{{i}}collapsed">values</button> |
| 34 | + </td> |
| 35 | + {% for row in summary %} |
| 36 | + </tr> |
| 37 | + <tr class="collapse {{i}}collapsed"> |
| 38 | + <td> </td> |
| 39 | + <td>{{row[0]}}</td> |
| 40 | + <td>{{row[1]}}</td> |
| 41 | + {% end %} |
36 | 42 | {% end %}
|
37 |
| - {% end %} |
38 | 43 | </tr>
|
39 | 44 | {% end %}
|
40 | 45 | </table>
|
| 46 | + |
41 | 47 | </div>
|
42 | 48 | </div>
|
0 commit comments