84382b1ffde70785e215617fd65e62cdb377b206
[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    <div id="main_page" class="clearfix">
13    <div class="mainnav">
14         <span>[% IF c.user_exists %]Hello! [% c.user.get_object.email %]! &nbsp; <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 Stemmaweb</a> </span>
15    </div>
16     <div id="topbanner">
17       <h1 class="title">Stemmaweb - a collection of tools for analysis of collated texts</h1>
18       <p id="compatibility_check"><span class="error">This browser does not support 
19       the functions necessary for Stemmaweb to work properly. We recommend use of 
20       <a href="http://mozilla.org/firefox">Mozilla Firefox</a> or 
21       <a href="http://www.google.com/chrome">Google Chrome</a>.</span></p>
22     </div>
23     <div id="directory_container">
24       <h2>Text directory</h2>
25       <div id="directory"></div>
26 [% IF c.user_exists -%]
27           <div class="button" id="new_trad_button" onClick="$('#upload-collation-dialog').dialog('open')">
28             <span>Add a new text tradition</span>
29           </div>
30 [% END %]
31     </div>
32     <div id="textinfo_waitbox">
33         <h3>Loading tradition information, please wait...</h3>
34         <img src="[% c.uri_for( 'images', 'ajax-loader.gif' ) %]" alt="Loading tradition info..." />
35     </div>
36     <div id="textinfo_container" class="clearfix">
37       <div id="textinfo_load_status"></div>
38       <h2>Text <span class="texttitle"></span></h2>
39       <form id="open_textinfo_edit" action="" method="GET" name="edit_textinfo">
40         <div class="button" id="edit_textinfo_button"
41                 onClick="$('#textinfo-edit-dialog').dialog('open')">
42           <span>Modify information about this tradition</span>
43         </div>
44       </form>
45       <ul>
46           <li>is owned by <span id="owner_id"></span></li>
47           <li>is <span id="not_public"></span>public</li>
48           <li>has <span id="marked_language"></span> as its primary language</li>
49               <li>has <span id="witness_num"></span> witnesses: <span id="witness_list"></span></li>
50       </ul>
51       
52       <div id="textinfo_container_buttons">
53           <form id="stemma_pager" action="" method="GET" name="stemma_pager">
54             <div id="stemma_pager_buttons">
55               <div class="pager_left_button" id="stemma_pager_left_button"></div>
56               <div class="pager_right_button" id="stemma_pager_right_button"></div>
57             </div>
58           </form>
59           <form id="open_stemma_add" action="" method="GET" name="add_new_stemma">
60             <div class="button" id="stemma_add_button" 
61                 onClick="$('#stemmaseq').val('n'); $('#stemma-edit-dialog').dialog('open');">
62                   <span>Add a new stemma</span>
63             </div>
64           </form>
65           <form id="open_stemma_edit" action="" method="GET" name="edit_current_stemma">
66             <div class="button" id="stemma_edit_button" 
67                 onClick="$('#stemmaseq').val(selectedStemmaID); $('#stemma-edit-dialog').dialog('open');">
68                   <span>Edit this stemma</span>
69             </div>
70           </form>
71           <form id="open_stemweb_ui" action="" method="GET" name="run_stemweb">
72             <div class="button" id="run_stemweb_button"
73                 onClick="$('#stemweb-ui-dialog').dialog('open');">
74               <span>Run a Stemweb algorithm</span>
75             </div>
76           </form>
77           <form id="query_stemweb_ui" action="" method="GET" name="query_stemweb">
78             <div class="button" id="query_stemweb_button"
79                 onClick="query_stemweb_progress();">
80               <span>Check progress of Stemweb algorithm</span>
81             </div>
82           </form>
83           <form id="run_stexaminer" action="" method="GET" name="run_stexaminer">
84             <div class="button" id="stexaminer_button" onClick="$('#run_stexaminer').submit()">
85                   <span>Examine variants against this stemma</span>
86             </div>
87           </form>
88           <form id="run_relater" action="" method="GET" name="run_relater">
89             <div class="button" id="relater_button" onClick="$('#run_relater').submit()">
90               <span id='relatebutton_label'>View collation and relationships</span>
91             </div>
92           </form>
93           <a id="dl_tradition" href="" download="file.xml">
94             <div class="button" id="download_button">
95               <span id='dlbutton_label'>Download tradition as XML</span>
96             </div>
97           </a>
98       </div>
99       <div id="stemma_load_status"></div>
100       <div id="stemma_graph"></div>
101       <div id="stemma_graph_title"><span id="stemma_identifier"></span></div>
102     </div>
103
104     <!-- Interim 'loading' message for directory box -->
105     <div id="loading_message">
106         <h3>Loading texts, please wait...</h3>
107         <img src="[% c.uri_for( 'images', 'ajax-loader.gif' ) %]" alt="Loading tradition list..."/>
108     </div>
109   </div> <!-- main_page -->
110   
111     <!-- Textinfo editor dialog -->
112     <div id="textinfo-edit-dialog" title="Edit information about this tradition">
113       <div id="textinfo_edit_container">
114         <form id="edit_textinfo">
115                 <label for="edit_name">Tradition name: </label>
116                 <input id="edit_name" type="text" size="30" name="name"/><br/>
117                 <label for="edit_language">Language: </label>
118                 <input id="edit_language" type="text" size="12" name="language"/>
119                 <label for="edit_public">Publicly viewable: </label>
120                 <input id="edit_public" type="checkbox" name="public"/><br/>
121 [% IF c.user_exists -%]
122 [% IF c.user.get_object.is_admin -%]
123                 <label for="edit_owner">Tradition owner: </label>
124                 <input id="edit_owner" type="text" size="30" name="owner"/><br/>
125 [% END -%]
126 [% END -%]
127                 </form>
128                 <div id="edit_textinfo_status"></div>
129           </div>
130     </div>
131     
132     <!-- Stemma dot editor dialog, simple textarea for now -->
133     <div id="stemma-edit-dialog">
134       <div id="stemma_edit_container">
135         <form id="edit_stemma">
136                 <label for="dot_field">Dot definition for this stemma: </label><br/>
137                 <textarea id="dot_field" rows="30" cols="40"></textarea>
138                 <input id="stemmaseq" type="hidden" name="stemmaseq" val="n"/>
139                         <div id="edit_instructions">
140                                 <p>All definitions begin with the line
141                                         <pre>digraph "Stemma Name" {</pre>
142                                 and end with the line 
143                                         <pre>}</pre>
144                                 Please do not change these lines except to edit the stemma name.</p>
145                                 <p>First list each witness in your stemma, whether extant or lost /
146                                 reconstructed / hypothetical, and assign them a class of either "extant"
147                                 or "hypothetical". For example:</p><pre>  
148         α [ class=hypothetical ]
149         C [ class=extant ]
150                                 </pre>
151                                 <p>Next, list the direct links between witnesses, one per line. For example, if 
152                                 witness C descends directly from witness α, note it as follows:</p><pre>
153         α -> C
154                                 </pre>
155                                 <p>A witness may be the exemplar for any number of other witnesses, whether 
156                                 extant or not; likewise, a witness may inherit from any number of other 
157                                 witnesses. Use as may "A -> B" pairings as necessary to describe the links.</p>
158                         </div>
159         </form>
160         <div id="edit_stemma_status"></div>
161       </div>
162     </div>
163
164         <!-- Stemweb UI dialog box -->
165     <div id="stemweb-ui-dialog" title="Generate a Stemweb tree">
166       <div id="stemweb_ui_container">
167         <form id="call_stemweb">
168                 <input id="stemweb_tradition" type="hidden" name="tradition"/>
169                 <label for="algorithm">Run algorithm: </label>
170                 <select id="stemweb_algorithm" name="algorithm"></select><br/>
171                 <!-- Algorithm-specific options, if any, will be added within this div -->
172                 <div id="stemweb_runtime_options"></div>
173         </form>
174         <div id="stemweb_run_status"></div>
175       </div>
176     </div>
177     
178     <!-- File upload dialog box -->
179     <div id="upload-collation-dialog" title="Upload a collation">
180       <div id="upload_container">
181                 <input id="new_file" name="file" type="file" onchange="file_selected(this)">
182                 <label for="new_file" id="new_file_label">Collation file: </label>
183         <div id="new_file_name_container" onclick="$('#new_file').click();">&nbsp;(Use 'pick file' to select a tradition file to upload.)</div>
184         <form id="new_tradition">
185             <label for="new_name">Name of this text / tradition: </label>
186             <input id="new_name" type="text" name="name" size="40"/><br/>
187             <label for="new_lang">Primary language of the text: </label>
188             <input id="new_lang" type="text" name="language" size="20"/><br/>
189             <label for="new_public">Allow public display: </label>
190             <input id="new_public" name="public" type="checkbox"/><br/>
191         </form>
192         <div id="upload_status"></div>
193         <div>
194           <h4>Supported file types / extensions:</h4>
195           <ul>
196             <li>*.txt - spreadsheet collation, tab-separated values</li>
197             <li>*.csv - spreadsheet collation, comma-separated values</li>
198             <li>*.xls - spreadsheet collation, Excel 97-2004 format</li>
199             <li>*.xlsx - spreadsheet collation, Excel 2007 XML format</li>
200             <li>*.xml - TEI XML parallel segmentation format</li>
201             <li>*.xml - TEI XML export from Classical Text Editor</li>
202             <li>*.xml - GraphML export from the CollateX tool</li>
203           </ul>
204           <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>
205         </div>
206       </div>
207     </div>
208     
209     <div id="root_tree_dialog">
210         Use this node to root the stemma? <img id="root_tree_dialog_button_ok" src="[% c.uri_for( 'images', 'tick_circle_frame_24.png' ) %]"/>
211     </div>
212     
213 [% PROCESS footer.tt %]