get new front page working, if poorly styled
[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 var selectedTextID;
7 var selectedStemmaID = -1;
8 var stemmata = [];
9 $(document).ready(function() {
10     // call out to load the directory div
11     $('#textinfo_container').hide();
12     $('#textinfo_waitbox').hide();
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                         }
19                 });
20         });
21     </script>
22
23 [% END %]
24
25     <div id="topbanner">
26       <h1>Stemmaweb - a collection of tools for analysis of collated texts</h1>
27       <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>
28     </div>
29     <div id="directory_container">
30       <h2>Text directory</h2>
31       <div id="directory">
32         <h3>Loading texts, please wait...</h3>
33         <img src="[% c.uri_for( 'images', 'ajax-loader.gif' ) %]" />
34       </div>
35 [% IF c.user_exists -%]
36           <div class="button" id="new_trad_button" onClick="$('#new_trad_form').open()">
37             <span>Add a new text tradition</span>
38           </div>
39 [% END %]
40     </div>
41     <div id="textinfo_waitbox">
42         <img src="[% c.uri_for( 'images', 'ajax-loader.gif' ) %]" alt="Loading tradition info..."/>
43     </div>
44     <div id="textinfo_container">
45       <h2>Text <span class="texttitle"></span></h2>
46       <ul>
47               <li>has <span id="witness_num"></span> witnesses: <span id="witness_list"></span></li>
48               <li>has <span id="reading_num"></span> distinct readings</li>
49               <li>has <span id="relationship_num"></span> distinct reading relationships</li>
50       </ul>
51       
52       <!-- TODO buttons on either side of the graph div to flip through the stemmata -->
53       <div id="stemma_graph"></div>
54       <form id="run_stexaminer" action="" method="GET" name="run_stexaminer">
55         <div class="button" id="stexaminer_button" onClick="$('#run_stexaminer').submit()">
56           <span>Examine variants against this stemma</span>
57         </div>
58       </form>
59       <form id="run_relater" action="" method="GET" name="run_relater">
60         <div class="button" id="relater_button" onClick="$('#run_relater').submit()">
61           <span>Run relationship mapper</span>
62         </div>
63       </form>
64     </div>
65
66 [% PROCESS footer.tt %]