stexaminer now working to my satisfaction
[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 var graphdot = '[% graphdot %]';
9 </script>
10 [% END -%]
11     <h1>Stexaminer</h1>
12     <h2>[% text_title %]</h2>
13     <div id="variants_table">
14       <table>
15 [% FOREACH row IN variants -%]
16 [% INCLUDE variantrow %]
17 [% END -%]
18      </table>
19     </div>
20     <div>
21                 <div id="stemma_graph">
22                   [% svg %]
23                 </div>
24                 <div id="row_statistics">
25                   <h3>Aggregate text statistics</h3>
26                   <ul>
27                         <li>Total number of variant locations analyzed: [% total %]</li>
28                         <li>Number of fully genealogical locations: [% genealogical %]</li>
29                         <li>Number of readings that conflict with the stemma: [% conflict %]</li>
30                         <li>Genealogical reading transitions by relationship type: [% todo %]</li>
31                   </ul>
32                   <p>(Choose a row in the table to display statistics about individual readings.)</p>
33                 </div>
34     </div>
35     
36     <div id="stats_template" class="template">
37             <h3>Statistics for readings at <span id="statrank"></span>:</h3>
38             <!-- reading_template will be appended here for each reading -->
39     </div>
40     
41         <div id="reading_template" class="template">
42                 <div class="reading_statistics">
43                         <span class="readinglabel"></span> - copied <span class="reading_copied"></span> time(s), changed <span class="reading_changed"></span> time(s)<br/>
44                         Reading root(s) at <span class="readingroots"></span><br/>
45                         <!-- reading_parent_template will be appended here if there are parents -->
46                 </div>
47     </div>
48     
49         <div id="reading_parent_template" class="template">
50                 <div class="parent_statistics">
51                         Reading parent(s):
52                         <ul class="reading_parent_list"></ul>
53                 </div>
54         </div>
55
56 [% PROCESS footer.tt %]
57     
58
59 [% BLOCK variantrow -%]
60 [% SET rowclass = 'class="genealogical"' IF row.genealogical -%]
61 [% SET rowclass = 'class="coincidental"' UNLESS row.genealogical -%]
62         <tr [% rowclass %]>
63           <th><span class="rowid" onclick="handle_row_click($(this))">[% row.id %]</span></th>
64 [% FOREACH reading IN row.readings -%]
65 [% SET cellclass = 'clickable conflict' IF reading.conflict -%]
66 [% SET cellclass = 'clickable' IF !reading.conflict -%]
67           <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>
68 [% END -%]
69 [% FILTER repeat( row.empty ) -%]
70           <td/>
71 [% END -%]
72         </tr>
73 [% END -%]