be3f0add16109e7ce0b456684ac95788c4c2cb32
[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 function show_stats( row_index ) {
9         var rs = readingstats[row_index];
10         var rshtml = $('#stats_template').clone();
11         rshtml.find('#statrank').append( rs.id );
12         $('#row_statistics').empty();
13         $('#row_statistics').append( rshtml.contents() );
14 };
15 </script>
16 [% END -%]
17     <h1>Stexaminer</h1>
18     <h2>[% text_title %]</h2>
19     <div id="variants_table">
20       <table>
21 [% FOREACH row IN variants -%]
22 [% INCLUDE variantrow %]
23 [% END -%]
24      </table>
25     </div>
26     <div id="stemma_graph">
27       [% svg %]
28     </div>
29     <div id="row_statistics">
30       <h3>Aggregate text statistics</h3>
31       <ul>
32         <li>Total number of variant locations analyzed: [% total %]</li>
33         <li>Number of fully genealogical locations: [% genealogical %]</li>
34         <li>Number of readings that conflict with the stemma: [% conflict %]</li>
35       </ul>
36       <p>(Choose a row in the table to display statistics about individual readings.)</p>
37     </div>
38     <div id="stats_template">
39             <h3>Statistics for readings at <span id="statrank"></span></h3>
40     </div>
41
42 [% PROCESS footer.tt %]
43     
44
45 [% BLOCK variantrow -%]
46 [% SET rowclass = 'class="genealogical"' IF row.genealogical -%]
47 [% SET rowclass = 'class="coincidental"' UNLESS row.genealogical -%]
48         <tr [% rowclass %]>
49           <th><span class="rowid" onclick="color_row($(this));show_stats($(this).parent().parent().index())">[% row.id %]</span></th>
50 [% FOREACH reading IN row.readings -%]
51 [% SET cellclass = 'clickable conflict' IF reading.conflict -%]
52 [% SET cellclass = 'clickable' IF !reading.conflict -%]
53           <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>
54 [% END -%]
55 [% FILTER repeat( row.empty ) -%]
56           <td/>
57 [% END -%]
58         </tr>
59 [% END -%]