get new front page working, if poorly styled
[scpubgit/stemmaweb.git] / root / src / index.tt
index 569968a..49f0266 100644 (file)
@@ -4,8 +4,12 @@
 %]
     <script type="text/javascript">
 var selectedTextID;
+var selectedStemmaID = -1;
+var stemmata = [];
 $(document).ready(function() {
     // call out to load the directory div
+    $('#textinfo_container').hide();
+    $('#textinfo_waitbox').hide();
     $('#directory').load( "[% c.uri_for( 'directory' ) %]", 
        function(response, status, xhr) {
                        if (status == "error") {
@@ -28,8 +32,35 @@ $(document).ready(function() {
        <h3>Loading texts, please wait...</h3>
        <img src="[% c.uri_for( 'images', 'ajax-loader.gif' ) %]" />
       </div>
+[% IF c.user_exists -%]
+         <div class="button" id="new_trad_button" onClick="$('#new_trad_form').open()">
+           <span>Add a new text tradition</span>
+         </div>
+[% END %]
+    </div>
+    <div id="textinfo_waitbox">
+       <img src="[% c.uri_for( 'images', 'ajax-loader.gif' ) %]" alt="Loading tradition info..."/>
+    </div>
+    <div id="textinfo_container">
+      <h2>Text <span class="texttitle"></span></h2>
+      <ul>
+             <li>has <span id="witness_num"></span> witnesses: <span id="witness_list"></span></li>
+             <li>has <span id="reading_num"></span> distinct readings</li>
+             <li>has <span id="relationship_num"></span> distinct reading relationships</li>
+      </ul>
+      
+      <!-- TODO buttons on either side of the graph div to flip through the stemmata -->
+      <div id="stemma_graph"></div>
+      <form id="run_stexaminer" action="" method="GET" name="run_stexaminer">
+        <div class="button" id="stexaminer_button" onClick="$('#run_stexaminer').submit()">
+         <span>Examine variants against this stemma</span>
+        </div>
+      </form>
+      <form id="run_relater" action="" method="GET" name="run_relater">
+        <div class="button" id="relater_button" onClick="$('#run_relater').submit()">
+          <span>Run relationship mapper</span>
+        </div>
+      </form>
     </div>
-    <div id="textinfo_container"></div>
-    <div id="variant_container"></div>
 
 [% PROCESS footer.tt %]
\ No newline at end of file