Remove invalid blank options from relationship dialogue
[scpubgit/stemmaweb.git] / root / src / relate.tt
index b01ab41..e46c5de 100644 (file)
@@ -12,12 +12,15 @@ var editable = "[% permission %]" === "full";
 // URLs for images referenced in Javascript
 var merge_button_yes = "[% c.uri_for( '/images/tick_circle_frame.png' ) %]";
 var merge_button_no = "[% c.uri_for( '/images/no_entry.png' ) %]";
+// Constants used in Javascript that we get from the server
 [% IF error -%]
 var relationship_types = [];
 var relationship_scopes = [];
+var ternary_values = [];
 [% ELSE -%]
 var relationship_types = [% relationship_types %];
 var relationship_scopes = [% relationship_scopes %];
+var ternary_values = [% ternary_values %];
 [% END -%]
 
 $(document).ready(function () {
@@ -26,10 +29,10 @@ $(document).ready(function () {
 </script>
 [% END %]
 
-       <div id="topbanner">
-               <span class="mainnav">
-                       <a href="help/[% text_lang %]" title="Relationship mapper help" class="helptag">Help / About</a> | <a href="[% c.uri_for( '/' ) %]?withtradition=[% textid %]" class="navlink">Return to index</a>
-               </span>
+  <div class="mainnav">
+       <span>[% IF c.user_exists %]Hello [% c.user.get_object.email %]! &nbsp; <a class="navlink" href="[% c.uri_for( '/logout' ) %]">Sign out</a> | [% END %]<a href="help/[% text_lang %]" title="Relationship mapper help" class="helptag navlink">Help / About</a> | <a href="[% c.uri_for( '/' ) %]?withtradition=[% textid %]" class="navlink">Return to index</a> </span>
+   </div>
+    <div id="topbanner">
                <h1>Relationship mapper</h1>
                <h2>[% text_title %]</h2>
                <div id="segmentation">
@@ -64,18 +67,29 @@ $(document).ready(function () {
                        <input type="hidden" name="source_text" id="source_node_text"/>
                        <input type="hidden" name="target_id" id="target_node_id"/>
                        <input type="hidden" name="target_text" id="target_node_text"/>
-                       <label for="rel_type">Relation type..&nbsp;</label>
-                       <select name="rel_type" id="rel_type" class=".ui-widget select">
-                               <option></option>
+                       <label for="rel_type">Relation type&nbsp;</label>
+                       <select name="type" id="rel_type" class=".ui-widget select">
                        </select>
                        <br/><br/>
-                       <label for="scope">Scope of relation..&nbsp;</label>
+                       <label for="scope">Scope of relation&nbsp;</label>
                        <select name="scope" id="scope" class=".ui-widget select">
-                               <option></option>
                        </select>
                        <br/><br/>
-                       <label for="note">Annotation or note..&nbsp;</label>
-                       <textarea rows="3" style="width:100%;" name="note" id="note" class=".ui-widget input"></textarea>
+                       <label for="is_significant">Is this variance stemmatically significant?</label>
+                       <select name="is_significant" id="is_significant" class=".ui-widget select"/>
+                       </select>
+                       <br/><br/>
+                       <input type="checkbox" name="b_derivable_from_a" id="b_derivable_from_a"/>
+                       <label for="b_derivable_from_a"><span class="rel_rdg_a"></span> would be corrected to <span class="rel_rdg_b"></span>&nbsp;</label>
+                       <br/>
+                       <input type="checkbox" name="a_derivable_from_b" id="a_derivable_from_b"/>
+                       <label for="a_derivable_from_b"><span class="rel_rdg_b"></span> would be corrected to <span class="rel_rdg_a"></span>&nbsp;</label>
+                       <br/>
+                       <input type="checkbox" name="non_independent" id="non_independent"/>
+                       <label for="non_independent">Variants unlikely to arise coincidentally&nbsp;</label>
+                       <br/><br/>
+                       <label for="note">Annotation or note&nbsp;</label>
+                       <textarea rows="3" style="width:100%;" name="annotation" id="note" class=".ui-widget input"></textarea>
                </fieldset>
        <div id="status"></div>         
                </form>
@@ -89,6 +103,7 @@ $(document).ready(function () {
                </form>
                <div id="delete-form-text">Type: <span id="delete_relation_type"></span><br/>
                    Scope: <span id="delete_relation_scope"></span><br/>
+                   <span id="delete_relation_attributes"></span>
                    <span id="delete_relation_note"></span></div>
        </div>
 
@@ -110,15 +125,6 @@ $(document).ready(function () {
                                <label for="reading_grammar_invalid">This word's grammar cannot be right</label>
                        </div>
                        <br/><br/>
-                       <!-- Collation correction option goes here -->
-                       <div id="decollation">
-                               <label for="reading_decollate">Detach this reading with the selected witnesses:</label>
-                               <select id="reading_decollate_witnesses" name="reading_decollate_witnesses"
-                                       multiple="multiple">
-                               <!-- Fill in relevant reading witnesses here -->
-                               </select>
-                               <button id="reading_decollate" onclick="decollate(); return false;">Uncollate</button>
-                       </div>
                        <!-- Morphological options go here -->
                        <div id="normalization" class="morph">
                                <label for="reading_normal_form">Normalized form: </label>
@@ -145,4 +151,4 @@ $(document).ready(function () {
         </ul>
     </div>
     
-[% PROCESS footer.tt %]
\ No newline at end of file
+[% PROCESS footer.tt %]