add browser compatibility check
[scpubgit/stemmaweb.git] / root / src / index.tt
1 [% WRAPPER header.tt
2         pagetitle = "Stemmaweb - Text tradition tools"
3         applicationjs = c.uri_for( 'js/componentload.js' )
4 %]
5     <script type="text/javascript">
6 // Set global variables that must be passed by the server
7 var basepath = "[% c.uri_for( '/' ) %]";
8 var textOnLoad = "[% withtradition %]";
9     </script>
10
11 [% END %]
12
13     <div id="topbanner">
14       <h1>Stemmaweb - a collection of tools for analysis of collated texts</h1>
15       <span class="mainnav">[% IF c.user_exists %]Hello! [% c.user.get_object.email %] <a class="navlink" href="[% c.uri_for( '/logout' ) %]">Sign out</a> | [% ELSE %]<a class="navlink" onclick="window.open('[% c.uri_for( '/login' ) %]', 'loginwindow', 'height=385,width=445')">Login</a> | [% END %]<a class="navlink" href="[% c.uri_for( '/about' ) %]">About</a> </span>
16       <p id="compatibility_check"><span class="error">This browser does not support 
17       the functions necessary for Stemmaweb to work properly. We recommend use of 
18       <a href="http://mozilla.org/firefox">Mozilla Firefox</a> or 
19       <a href="http://www.google.com/chrome">Google Chrome</a>.</span></p>
20     </div>
21     <div id="directory_container">
22       <h2>Text directory</h2>
23       <div id="directory"></div>
24 [% IF c.user_exists -%]
25           <div class="button" id="new_trad_button" onClick="$('#upload-collation-dialog').dialog('open')">
26             <span>Add a new text tradition</span>
27           </div>
28 [% END %]
29     </div>
30     <div id="textinfo_waitbox">
31         <h3>Loading tradition information, please wait...</h3>
32         <img src="[% c.uri_for( 'images', 'ajax-loader.gif' ) %]" alt="Loading tradition info..." />
33     </div>
34     <div id="textinfo_container">
35       <div id="textinfo_load_status"></div>
36       <h2>Text <span class="texttitle"></span></h2>
37       <form id="open_textinfo_edit" action="" method="GET" name="edit_textinfo">
38         <div class="button" id="edit_textinfo_button"
39                 onClick="$('#textinfo-edit-dialog').dialog('open')">
40           <span>Modify information about this tradition</span>
41         </div>
42       </form>
43       <ul>
44           <li>is owned by <span id="owner_id"></span></li>
45           <li>is <span id="not_public"></span>public</li>
46           <li>has <span id="marked_language"></span> as its primary language</li>
47               <li>has <span id="witness_num"></span> witnesses: <span id="witness_list"></span></li>
48       </ul>
49       
50       <div id="textinfo_container_buttons">
51           <form id="stemma_pager" action="" method="GET" name="stemma_pager">
52             <div id="stemma_pager_buttons">
53               <div class="pager_left_button" id="stemma_pager_left_button"></div>
54               <div class="pager_right_button" id="stemma_pager_right_button"></div>
55             </div>
56           </form>
57           <form id="open_stemma_add" action="" method="GET" name="add_new_stemma">
58             <div class="button" id="stemma_add_button" 
59                 onClick="$('#stemmaseq').val('n'); $('#stemma-edit-dialog').dialog('open');">
60                   <span>Add a new stemma</span>
61             </div>
62           </form>
63           <form id="open_stemma_edit" action="" method="GET" name="edit_current_stemma">
64             <div class="button" id="stemma_edit_button" 
65                 onClick="$('#stemmaseq').val(selectedStemmaID); $('#stemma-edit-dialog').dialog('open');">
66                   <span>Edit this stemma</span>
67             </div>
68           </form>
69           <form id="run_stexaminer" action="" method="GET" name="run_stexaminer">
70             <div class="button" id="stexaminer_button" onClick="$('#run_stexaminer').submit()">
71                   <span>Examine variants against this stemma</span>
72             </div>
73           </form>
74           <form id="run_relater" action="" method="GET" name="run_relater">
75             <div class="button" id="relater_button" onClick="$('#run_relater').submit()">
76               <span>Run relationship mapper</span>
77             </div>
78           </form>
79       </div>
80       <div id="stemma_graph"></div>
81     </div>
82
83     <!-- Interim 'loading' message for directory box -->
84     <div id="loading_message">
85         <h3>Loading texts, please wait...</h3>
86         <img src="[% c.uri_for( 'images', 'ajax-loader.gif' ) %]" alt="Loading tradition list..."/>
87     </div>
88     
89     <!-- Textinfo editor dialog -->
90     <div id="textinfo-edit-dialog" title="Edit information about this tradition">
91       <div id="textinfo_edit_container">
92         <form id="edit_textinfo">
93                 <label for="edit_name">Tradition name: </label>
94                 <input id="edit_name" type="text" size="30" name="name"/><br/>
95                 <label for="edit_language">Language: </label>
96                 <input id="edit_language" type="text" size="12" name="language"/>
97                 <label for="edit_public">Publicly viewable: </label>
98                 <input id="edit_public" type="checkbox" name="public"/><br/>
99 [% IF c.user_exists -%]
100 [% IF c.user.get_object.is_admin -%]
101                 <label for="edit_owner">Tradition owner: </label>
102                 <input id="edit_owner" type="text" size="30" name="owner"/><br/>
103 [% END -%]
104 [% END -%]
105                 </form>
106                 <div id="edit_textinfo_status"></div>
107           </div>
108     </div>
109     
110     <!-- Stemma dot editor dialog, simple textarea for now -->
111     <div id="stemma-edit-dialog">
112       <div id="stemma_edit_container">
113         <form id="edit_stemma">
114                 <label for="dot_field">Dot definition for this stemma: </label><br/>
115                 <textarea id="dot_field" rows="30" cols="40"></textarea>
116                 <input id="stemmaseq" type="hidden" name="stemmaseq" val="n"/>
117                         <div id="edit_instructions">
118                                 <p>All definitions begin with the line
119                                         <pre>digraph stemma {</pre>
120                                 and end with the line 
121                                         <pre>}</pre>Please do not change these lines.</p>
122                                 <p>First list each witness in your stemma, whether extant or lost /
123                                 reconstructed / hypothetical, and assign them a class of either "extant"
124                                 or "hypothetical". For example:</p><pre>  
125         α [ class=hypothetical ]
126         C [ class=extant ]
127                                 </pre>
128                                 <p>Next, list the direct links between witnesses, one per line. For example, if 
129                                 witness C descends directly from witness α, note it as follows:</p><pre>
130         α -> C
131                                 </pre>
132                                 <p>A witness may be the exemplar for any number of other witnesses, whether 
133                                 extant or not; likewise, a witness may inherit from any number of other 
134                                 witnesses. Use as may "A -> B" pairings as necessary to describe the links.</p>
135                         </div>
136         </form>
137         <div id="edit_stemma_status"></div>
138       </div>
139     </div>
140
141     <!-- File upload dialog box -->
142     <div id="upload-collation-dialog" title="Upload a collation">
143       <div id="upload_container">
144         <label for="new_file">Collation file: </label>
145                 <input id="new_file" name="file" type="file" onchange="file_selected(this)"><br/>
146         <form id="new_tradition">
147             <label for="new_name">Name of this text / tradition: </label>
148             <input id="new_name" type="text" name="name" size="40"/><br/>
149             <label for="new_lang">Primary language of the text: </label>
150             <input id="new_lang" type="text" name="language" size="20"/><br/>
151             <label for="new_public">Allow public display: </label>
152             <input id="new_public" name="public" type="checkbox"/><br/>
153         </form>
154         <div id="upload_status"></div>
155         <div>
156           <h4>Supported file types / extensions:</h4>
157           <ul>
158             <li>*.txt - spreadsheet collation, tab-separated values</li>
159             <li>*.csv - spreadsheet collation, comma-separated values</li>
160             <li>*.xls - spreadsheet collation, Excel 97-2004 format</li>
161             <li>*.xlsx - spreadsheet collation, Excel 2007 XML format</li>
162             <li>*.xml - TEI XML parallel segmentation format</li>
163             <li>*.xml - TEI XML export from Classical Text Editor</li>
164             <li>*.xml - GraphML export from the CollateX tool</li>
165           </ul>
166           <p>All spreadsheet collations should be arranged with the witness sigla in the first row, and the words aligned by row each in its correct witness column.</p>
167         </div>
168       </div>
169     </div>    
170 [% PROCESS footer.tt %]