X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Ftemplates%2Fregistration_view.html;h=1f27d4188ea8c0de9ef1f3386d6dab1692ee9d7b;hb=02c9260f3ec7e6b11f9b7330418f757075d2ed1f;hp=450575d277d24a46c5263c719db6bc355cd8cc56;hpb=c3272ce22d726e69598349413eb7a7e982b027d8;p=unfold.git diff --git a/portal/templates/registration_view.html b/portal/templates/registration_view.html index 450575d2..1f27d418 100644 --- a/portal/templates/registration_view.html +++ b/portal/templates/registration_view.html @@ -34,10 +34,10 @@

Enter your last name

- +
- +

An authority responsible for vetting your account

@@ -47,7 +47,6 @@ TODO: Login should be suggested from user email or first/last name, and checked for existence. In addition, the full HRN should be shown to the user. - -->
@@ -55,7 +54,8 @@

Enter your login

- + --> +
@@ -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))} }); });