handle Excel 2007+ parsing as well
[scpubgit/stemmaweb.git] / root / src / index.tt
CommitLineData
fb6e49b3 1[% WRAPPER header.tt
2 pagetitle = "Stemmaweb - Text tradition tools"
538715bd 3 applicationjs = c.uri_for( 'js/componentload.js' )
fb6e49b3 4%]
5 <script type="text/javascript">
f007ac1e 6var selectedTextID;
98a45925 7var selectedStemmaID = -1;
8var stemmata = [];
40ed7ca6 9
10function refreshDirectory () {
04469f3e 11 var lmesg = $('#loading_message').clone();
12 $('#directory').empty().append( lmesg.contents() );
69799996 13 $('#directory').load( "[% c.uri_for( 'directory' ) %]",
14 function(response, status, xhr) {
15 if (status == "error") {
16 var msg = "An error occurred: ";
17 $("#directory").html(msg + xhr.status + " " + xhr.statusText);
18 }
40ed7ca6 19 }
20 );
21}
22
5cc32d47 23function start_upload_dialog() {
24 if( typeof uploader != 'undefined' ){ uploader.destroy() };
25 $('#upload-collation-dialog').dialog('option', 'attach_uploader')();
9f7aeb53 26 $('#upload_status').empty();
5cc32d47 27 $('#upload_button').button('disable');
28 $('#upload-collation-dialog').dialog('open');
29}
30
40ed7ca6 31$(document).ready( function() {
32 // call out to load the directory div
33 $('#textinfo_container').hide();
34 $('#textinfo_waitbox').hide();
35 refreshDirectory();
36 $('#upload-collation-dialog').dialog({
37 autoOpen: false,
38 height: 325,
39 width: 480,
40 modal: true,
41 buttons: {
5cc32d47 42 pick: {
43 text: "Pick File",
44 id: "pick_uploadfile_button",
45 click: function() {}
46 },
47 upload: {
48 text: 'Upload',
49 id: 'upload_button',
50 click: function() {
51 $('#upload_status').empty();
52 uploader.start();
53 return false;
54 }
55 },
56 cancel: function() {
57 $('#upload-collation-dialog').dialog('close');
40ed7ca6 58 }
5cc32d47 59 },
60 attach_uploader: function() {
61 create_uploader( "[% c.uri_for ( '/newtradition' ) %]" );
62 $('#filelist').empty().html( 'Use the \'Pick\' button to choose a source fileā€¦' );
40ed7ca6 63 }
5cc32d47 64 });
40ed7ca6 65});
fb6e49b3 66 </script>
67
68[% END %]
69
7439e248 70 <div id="topbanner">
71 <h1>Stemmaweb - a collection of tools for analysis of collated texts</h1>
69799996 72 <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> | <a class="navlink" onclick="window.open('[% c.uri_for( '/register' ) %]', 'regwindow', 'height=385,width=445')">Register</a> | [% END %]<a class="navlink" href="[% c.uri_for( 'about.html' ) %]">About</a> </span>
7439e248 73 </div>
fb792f63 74 <div id="directory_container">
75 <h2>Text directory</h2>
04469f3e 76 <div id="directory"></div>
98a45925 77[% IF c.user_exists -%]
5cc32d47 78 <div class="button" id="new_trad_button" onClick="start_upload_dialog();">
98a45925 79 <span>Add a new text tradition</span>
80 </div>
81[% END %]
82 </div>
83 <div id="textinfo_waitbox">
84 <img src="[% c.uri_for( 'images', 'ajax-loader.gif' ) %]" alt="Loading tradition info..."/>
85 </div>
86 <div id="textinfo_container">
04469f3e 87 <div id="textinfo_load_status"></div>
98a45925 88 <h2>Text <span class="texttitle"></span></h2>
89 <ul>
90 <li>has <span id="witness_num"></span> witnesses: <span id="witness_list"></span></li>
91 <li>has <span id="reading_num"></span> distinct readings</li>
92 <li>has <span id="relationship_num"></span> distinct reading relationships</li>
93 </ul>
94
95 <!-- TODO buttons on either side of the graph div to flip through the stemmata -->
a35b3190 96 <div id="textinfo_container_buttons">
97 <form id="stemma_pager" action="" method="GET" name="stemma_pager">
98 <div class="button" id="stemma_pager_button" onClick="$('#stemma_pager').submit()">
99 <span>Left &amp; right go here</span>
100 </div>
101 </form>
102 <form id="run_stexaminer" action="" method="GET" name="run_stexaminer">
103 <div class="button" id="stexaminer_button" onClick="$('#run_stexaminer').submit()">
104 <span>Examine variants against this stemma</span>
105 </div>
106 </form>
107 <form id="run_relater" action="" method="GET" name="run_relater">
108 <div class="button" id="relater_button" onClick="$('#run_relater').submit()">
109 <span>Run relationship mapper</span>
110 </div>
111 </form>
112 </div>
98a45925 113 <div id="stemma_graph"></div>
7439e248 114 </div>
fb6e49b3 115
04469f3e 116 <!-- Interim 'loading' message for directory box -->
117 <div id="loading_message">
118 <h3>Loading texts, please wait...</h3>
119 <img src="[% c.uri_for( 'images', 'ajax-loader.gif' ) %]" />
120 </div>
40ed7ca6 121
122 <!-- File upload dialog box -->
123 <div id="upload-collation-dialog" title="Upload a collation">
5cc32d47 124 <div id="upload_container">
125 <form id="new_tradition">
126 <label for="traditionname">Name of this text / tradition: </label>
127 <input id="traditionname" type="text" name="name" size="40"/><br/>
128 <div id="filelist"></div>
129 <form>
130 <div id="upload_status"></div>
40ed7ca6 131 <div>
132 <h4>Supported file types / extensions:</h4>
133 <ul>
134 <li>*.txt - spreadsheet collation, tab-separated values</li>
135 <li>*.csv - spreadsheet collation, comma-separated values</li>
136 <li>*.xls - spreadsheet collation, Excel 97-2004 format</li>
137 <li>*.xlsx - spreadsheet collation, Excel 2007 XML format</li>
138 <li>*.xml - TEI XML parallel segmentation format</li>
139 <li>*.xml - TEI XML export from Classical Text Editor</li>
140 <li>*.xml - GraphML export from the CollateX tool</li>
141 </ul>
142 <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>
143 </div>
5cc32d47 144 </div>
40ed7ca6 145 </div>
fb6e49b3 146[% PROCESS footer.tt %]