10c4632c1998d8484affbb52831f15d865ff3f01
[scpubgit/stemmatology.git] / stemmaweb / root / src / stexaminer.tt
1 [% WRAPPER header.tt
2         pagetitle = "Stexaminer - $text_title"
3         applicationjs = c.uri_for('/js/stexaminer.js')
4         applicationstyle = c.uri_for('/css/stexaminer.css')
5 %]
6 <script type="text/javascript">
7 var readingstats = [% reading_statistics %];
8 </script>
9 [% END -%]
10     <h1>Stexaminer</h1>
11     <h2>[% text_title %]</h2>
12     <div id="variants_table">
13       <table>
14 [% FOREACH row IN variants -%]
15 [% INCLUDE variantrow %]
16 [% END -%]
17      </table>
18     </div>
19     <div id="stemma_graph">
20       [% svg %]
21     </div>
22     <div id="row_statistics">
23       <h3>Aggregate text statistics</h3>
24       <ul>
25         <li>Total number of variant locations analyzed: [% total %]</li>
26         <li>Number of fully genealogical locations: [% genealogical %]</li>
27         <li>Number of readings that conflict with the stemma: [% conflict %]</li>
28         <li>Genealogical reading transitions by relationship type: [% todo %]</li>
29       </ul>
30       <p>(Choose a row in the table to display statistics about individual readings.)</p>
31     </div>
32     
33     <div id="stats_template" class="template">
34             <h3>Statistics for readings at <span id="statrank"></span>:</h3>
35             <!-- reading_template will be appended here for each reading -->
36     </div>
37     
38         <div id="reading_template" class="template">  
39                 <div class="reading_statistics">
40                         <span class="readinglabel"></span> - copied <span class="reading_copied"></span> times, changed <span class="reading_changed"></span> times<br/>
41                         Reading root(s) at <span class="readingroots"></span><br/>
42                         <!-- reading_parent_template will be appended here if there are parents -->
43                 </div>
44     </div>
45     
46         <div id="reading_parent_template" class="template">
47                 <div class="parent_statistics">
48                         Reading parent(s):
49                         <ul class="reading_parent_list"></ul>
50                 </div>
51         </div>
52
53 [% PROCESS footer.tt %]
54     
55
56 [% BLOCK variantrow -%]
57 [% SET rowclass = 'class="genealogical"' IF row.genealogical -%]
58 [% SET rowclass = 'class="coincidental"' UNLESS row.genealogical -%]
59         <tr [% rowclass %]>
60           <th><span class="rowid" onclick="color_row($(this));show_stats($(this).parent().parent().index())">[% row.id %]</span></th>
61 [% FOREACH reading IN row.readings -%]
62 [% SET cellclass = 'clickable conflict' IF reading.conflict -%]
63 [% SET cellclass = 'clickable' IF !reading.conflict -%]
64           <td class="[% cellclass %]"><span onclick="color_nodes($(this).parent().index(), [% reading.group %], [% row.missing %]);$(this).parents('tr').addClass('active_variant_row');$(this).parent().addClass('active_variant_cell cellb'+($(this).parent().index()-1))">[% reading.text %]</span></td>
65 [% END -%]
66 [% FILTER repeat( row.empty ) -%]
67           <td/>
68 [% END -%]
69         </tr>
70 [% END -%]