better handling for errors, don't send filler text to server
[scpubgit/stemmaweb.git] / root / src / stexaminer.tt
CommitLineData
d5514865 1[% WRAPPER header.tt
fb6e49b3 2 pagetitle = "Stexaminer - $text_title"
f007ac1e 3 applicationjs = c.uri_for('/js/stexaminer.js')
4 applicationstyle = c.uri_for('/css/stexaminer.css')
fb6e49b3 5%]
d5514865 6<script type="text/javascript">
7var readingstats = [% reading_statistics %];
8function 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 -%]
fb6e49b3 17 <h1>Stexaminer</h1>
18 <h2>[% text_title %]</h2>
fb6e49b3 19 <div id="variants_table">
20 <table>
21[% FOREACH row IN variants -%]
22[% INCLUDE variantrow %]
23[% END -%]
24 </table>
25 </div>
19a64545 26 <div id="stemma_graph">
27 [% svg %]
28 </div>
d5514865 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
fb6e49b3 42[% PROCESS footer.tt %]
43
b8a92065 44
45[% BLOCK variantrow -%]
46[% SET rowclass = 'class="genealogical"' IF row.genealogical -%]
47[% SET rowclass = 'class="coincidental"' UNLESS row.genealogical -%]
48 <tr [% rowclass %]>
d5514865 49 <th><span class="rowid" onclick="color_row($(this));show_stats($(this).parent().parent().index())">[% row.id %]</span></th>
b8a92065 50[% FOREACH reading IN row.readings -%]
51[% SET cellclass = 'clickable conflict' IF reading.conflict -%]
52[% SET cellclass = 'clickable' IF !reading.conflict -%]
0737e7dd 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>
b8a92065 54[% END -%]
55[% FILTER repeat( row.empty ) -%]
56 <td/>
57[% END -%]
58 </tr>
59[% END -%]