implement HTML5 file upload; fix is-public display bug
[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     </div>
17     <div id="directory_container">
18       <h2>Text directory</h2>
19       <div id="directory"></div>
20 [% IF c.user_exists -%]
21           <div class="button" id="new_trad_button" onClick="$('#upload-collation-dialog').dialog('open')">
22             <span>Add a new text tradition</span>
23           </div>
24 [% END %]
25     </div>
26     <div id="textinfo_waitbox">
27         <h3>Loading tradition information, please wait...</h3>
28         <img src="[% c.uri_for( 'images', 'ajax-loader.gif' ) %]" alt="Loading tradition info..." />
29     </div>
30     <div id="textinfo_container">
31       <div id="textinfo_load_status"></div>
32       <h2>Text <span class="texttitle"></span></h2>
33       <form id="open_textinfo_edit" action="" method="GET" name="edit_textinfo">
34         <div class="button" id="edit_textinfo_button"
35                 onClick="$('#textinfo-edit-dialog').dialog('open')">
36           <span>Modify information about this tradition</span>
37         </div>
38       </form>
39       <ul>
40           <li>is owned by <span id="owner_id"></span></li>
41           <li>is <span id="not_public"></span>public</li>
42           <li>has <span id="marked_language"></span> as its primary language</li>
43               <li>has <span id="witness_num"></span> witnesses: <span id="witness_list"></span></li>
44       </ul>
45       
46       <div id="textinfo_container_buttons">
47           <form id="stemma_pager" action="" method="GET" name="stemma_pager">
48             <div id="stemma_pager_buttons">
49               <div class="pager_left_button" id="stemma_pager_left_button"></div>
50               <div class="pager_right_button" id="stemma_pager_right_button"></div>
51             </div>
52           </form>
53           <form id="open_stemma_add" action="" method="GET" name="add_new_stemma">
54             <div class="button" id="stemma_add_button" 
55                 onClick="$('#stemmaseq').val('n'); $('#stemma-edit-dialog').dialog('open');">
56                   <span>Add a new stemma</span>
57             </div>
58           </form>
59           <form id="open_stemma_edit" action="" method="GET" name="edit_current_stemma">
60             <div class="button" id="stemma_edit_button" 
61                 onClick="$('#stemmaseq').val(selectedStemmaID); $('#stemma-edit-dialog').dialog('open');">
62                   <span>Edit this stemma</span>
63             </div>
64           </form>
65           <form id="run_stexaminer" action="" method="GET" name="run_stexaminer">
66             <div class="button" id="stexaminer_button" onClick="$('#run_stexaminer').submit()">
67                   <span>Examine variants against this stemma</span>
68             </div>
69           </form>
70           <form id="run_relater" action="" method="GET" name="run_relater">
71             <div class="button" id="relater_button" onClick="$('#run_relater').submit()">
72               <span>Run relationship mapper</span>
73             </div>
74           </form>
75       </div>
76       <div id="stemma_graph"></div>
77     </div>
78
79     <!-- Interim 'loading' message for directory box -->
80     <div id="loading_message">
81         <h3>Loading texts, please wait...</h3>
82         <img src="[% c.uri_for( 'images', 'ajax-loader.gif' ) %]" alt="Loading tradition list..."/>
83     </div>
84     
85     <!-- Textinfo editor dialog -->
86     <div id="textinfo-edit-dialog" title="Edit information about this tradition">
87       <div id="textinfo_edit_container">
88         <form id="edit_textinfo">
89                 <label for="edit_name">Tradition name: </label>
90                 <input id="edit_name" type="text" size="30" name="name"/><br/>
91                 <label for="edit_language">Language: </label>
92                 <input id="edit_language" type="text" size="12" name="language"/>
93                 <label for="edit_public">Publicly viewable: </label>
94                 <input id="edit_public" type="checkbox" name="public"/><br/>
95 [% IF c.user_exists -%]
96 [% IF c.user.get_object.is_admin -%]
97                 <label for="edit_owner">Tradition owner: </label>
98                 <input id="edit_owner" type="text" size="30" name="owner"/><br/>
99 [% END -%]
100 [% END -%]
101                 </form>
102                 <div id="edit_textinfo_status"></div>
103           </div>
104     </div>
105     
106     <!-- Stemma dot editor dialog, simple textarea for now -->
107     <div id="stemma-edit-dialog">
108       <div id="stemma_edit_container">
109         <form id="edit_stemma">
110                 <label for="dot_field">Dot definition for this stemma: </label><br/>
111                 <textarea id="dot_field" rows="30" cols="40"></textarea>
112                 <input id="stemmaseq" type="hidden" name="stemmaseq" val="n"/>
113                         <div id="edit_instructions">
114                                 <p>All definitions begin with the line
115                                         <pre>digraph stemma {</pre>
116                                 and end with the line 
117                                         <pre>}</pre>Please do not change these lines.</p>
118                                 <p>First list each witness in your stemma, whether extant or lost /
119                                 reconstructed / hypothetical, and assign them a class of either "extant"
120                                 or "hypothetical". For example:</p><pre>  
121         α [ class=hypothetical ]
122         C [ class=extant ]
123                                 </pre>
124                                 <p>Next, list the direct links between witnesses, one per line. For example, if 
125                                 witness C descends directly from witness α, note it as follows:</p><pre>
126         α -> C
127                                 </pre>
128                                 <p>A witness may be the exemplar for any number of other witnesses, whether 
129                                 extant or not; likewise, a witness may inherit from any number of other 
130                                 witnesses. Use as may "A -> B" pairings as necessary to describe the links.</p>
131                         </div>
132         </form>
133         <div id="edit_stemma_status"></div>
134       </div>
135     </div>
136
137     <!-- File upload dialog box -->
138     <div id="upload-collation-dialog" title="Upload a collation">
139       <div id="upload_container">
140         <label for="new_file">Collation file: </label>
141                 <input id="new_file" name="file" type="file" onchange="file_selected(this)"><br/>
142         <form id="new_tradition">
143             <label for="new_name">Name of this text / tradition: </label>
144             <input id="new_name" type="text" name="name" size="40"/><br/>
145             <label for="new_lang">Primary language of the text: </label>
146             <input id="new_lang" type="text" name="language" size="20"/><br/>
147             <label for="new_public">Allow public display: </label>
148             <input id="new_public" name="public" type="checkbox"/><br/>
149         <form>
150         <div id="upload_status"></div>
151         <div>
152           <h4>Supported file types / extensions:</h4>
153           <ul>
154             <li>*.txt - spreadsheet collation, tab-separated values</li>
155             <li>*.csv - spreadsheet collation, comma-separated values</li>
156             <li>*.xls - spreadsheet collation, Excel 97-2004 format</li>
157             <li>*.xlsx - spreadsheet collation, Excel 2007 XML format</li>
158             <li>*.xml - TEI XML parallel segmentation format</li>
159             <li>*.xml - TEI XML export from Classical Text Editor</li>
160             <li>*.xml - GraphML export from the CollateX tool</li>
161           </ul>
162           <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>
163         </div>
164       </div>
165     </div>    
166 [% PROCESS footer.tt %]