layout and style changes
[myslice.git] / portal / templates / registration_view.html
index 7bf4791..10381a3 100644 (file)
@@ -1,11 +1,13 @@
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
 
-{% block unfold_main %}        
+{% block content %}        
 
-<div class="onelab-title well-lg">
-  <h2>OneLab Experimenter Registration</h2>
-  <h4>For First Line Support please <a href="/portal/contact" >Contact Support</a></h3>
+<div class="row">
+       <h1><img src="{{ STATIC_URL }}img/icon_user_small.png" alt="User Registration" /> OneLab Experimenter Registration</h1>
 </div>
+<div class="row">
+
+  <h4>For First Line Support please <a href="/portal/contact" >Contact Support</a></h3>
 
 {% if errors %}
 <ul>
@@ -15,7 +17,6 @@
 </ul>
 {% endif %}
    
-<div class="well">
  <form class="cmxform form-horizontal" id="registrationForm" method="post" action="" enctype="multipart/form-data" role="form">
     <fieldset>
     {% csrf_token %}
       <div class="col-xs-6"><p class="form-hint">Enter your last name</p></div>
     </div>
     <div class="form-group">
-      <label for="auth_list" class="col-xs-2 control-label">Authority</label>
+      <label for="authority_hrn" class="col-xs-2 control-label">Authority</label>
       <div class="col-xs-4">
         <div class="ui-widget">
-            <input id="auth_list" class="form-control" required>
+            <input id="authority_hrn" name="authority_hrn" class="form-control" value="{{ authority_hrn }}" required>
         </div>
      </div>
       <div class="col-xs-6"><p class="form-hint">An authority responsible for vetting your account</p></div>
     <div class="form-group" id="register">
       <button class="submit btn btn-default col-xs-12" type="submit">Register</button>
     </div>
-    </div>
   </fieldset>
   </form>  
 </div>
@@ -108,15 +108,28 @@ jQuery(document).ready(function(){
     var availableTags = [
     {% if authorities %}
         {% for authority in authorities %}
-        {value:"{{ authority.authority_hrn }}",label:"{{authority.name}}"},
+            {% if authority.name %}
+                {value:"{{ authority.authority_hrn }}",label:"{{authority.name}}"},
+            {% else %}
+                {value:"{{ authority.authority_hrn }}",label:"{{authority.authority_hrn}}"},
+            {% endif %}
         {% endfor %}    
     {% else %}
         {value:"",label:"No authority found !!!"}
     {% endif %}
     ];
-    $( "#auth_list" ).autocomplete({
+    jQuery( "#authority_hrn" ).autocomplete({
       source: availableTags,
-      select: function( event, ui ) {console.log(jQuery(this))}
+      minLength: 0,
+      change: function (event, ui) {
+          if(!ui.item){
+              //http://api.jqueryui.com/autocomplete/#event-change -
+              // The item selected from the menu, if any. Otherwise the property is null
+              //so clear the item for force selection
+              jQuery("#authority_hrn").val("");
+          }
+      }
+      //select: function( event, ui ) {console.log(jQuery(this))}
     });
 });
 </script>