stemmaweb bugfixes and style fixes; add 'punctuation' relationship type
[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         <div id="topbanner">
12                 <div id="bannerinfo">
13                         <a href="help" title="Stexaminer help" class="helptag">Help / About</a>
14                 </div>
15             <h1>Stexaminer</h1>
16         <h2>[% text_title %]</h2>
17     </div>
18     <div id="options">
19         <h3>Analysis options:</h3>
20         <form id="use_variants_form" name="use_variants_form" class="clearfix" method="POST">
21                 <div class="optionformelement">
22                         <input type="radio" name="ignore_variant" value="none" [% 'checked="true"' IF ignore_variant == 'none' %]>Analyze all variation</input><br/>
23                         <input type="radio" name="ignore_variant" value="orthographic" [% 'checked="true"' IF ignore_variant == 'orthographic' %]>Ignore orthographic variation</input><br/>
24                         <input type="radio" name="ignore_variant" value="spelling" [% 'checked="true"' IF ignore_variant == 'spelling' %]>Ignore orthographic and spelling variation</input>
25                 </div>
26                 <div class="optionformelement">
27                         <input type="checkbox" name="show_type1" [% 'checked="true"' IF show_type1 %]>Include type-1 variation</input>
28                 </div>
29                 <div id="options_button" class="button optionformelement" onclick="$('#use_variants_form').submit()">
30                         <span>Re-analyze</span>
31                 </div>
32         </form>
33     </div>
34     <div id="variants_table">
35       <table>
36 [% FOREACH row IN variants -%]
37 [% INCLUDE variantrow %]
38 [% END -%]
39      </table>
40     </div>
41     <div>
42                 <div id="stemma_graph">
43                   [% svg %]
44                 </div>
45                 <div id="row_statistics">
46                   <h3>Aggregate text statistics</h3>
47                   <ul>
48                         <li>Total number of variant locations analyzed: [% total %]</li>
49                         <li>Number of fully genealogical locations: [% genealogical %]</li>
50                         <li>Number of readings that conflict with the stemma: [% conflict %]</li>
51                         <li>Genealogical reading transitions by relationship type: [% todo %]</li>
52                   </ul>
53                   <p>(Choose a row in the table to display statistics about individual readings.)</p>
54                 </div>
55     </div>
56     
57     <div id="stats_template" class="template">
58             <h3>Statistics for readings at <span id="statrank"></span>:</h3>
59             <!-- reading_template will be appended here for each reading -->
60     </div>
61     
62         <div id="reading_template" class="template">
63                 <div class="reading_statistics">
64                         <span class="readinglabel"></span> - copied <span class="reading_copied"></span> time(s), changed <span class="reading_changed"></span> time(s)<br/>
65                         Reading root(s) at <span class="readingroots"></span><br/>
66                         <!-- reading_parent_template will be appended here if there are parents -->
67                 </div>
68     </div>
69     
70         <div id="reading_parent_template" class="template">
71                 <div class="parent_statistics">
72                         Reading parent(s):
73                         <ul class="reading_parent_list"></ul>
74                 </div>
75         </div>
76
77 [% PROCESS footer.tt %]
78     
79
80 [% BLOCK variantrow -%]
81 [% SET rowclass = 'class="genealogical"' IF row.genealogical -%]
82 [% SET rowclass = 'class="coincidental"' UNLESS row.genealogical -%]
83         <tr [% rowclass %]>
84           <th><span class="rowid" onclick="handle_row_click($(this))">[% row.id %]</span></th>
85 [% FOREACH reading IN row.readings -%]
86 [% SET cellclass = 'clickable conflict' IF reading.conflict -%]
87 [% SET cellclass = 'clickable' IF !reading.conflict -%]
88           <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>
89 [% END -%]
90 [% FILTER repeat( row.empty ) -%]
91           <td/>
92 [% END -%]
93         </tr>
94 [% END -%]