list authorities, display name label only if available, else display authority_hrn
authorLoic Baron <loic.baron@lip6.fr>
Wed, 5 Feb 2014 11:04:55 +0000 (12:04 +0100)
committerLoic Baron <loic.baron@lip6.fr>
Wed, 5 Feb 2014 11:04:55 +0000 (12:04 +0100)
portal/templates/registration_view.html
portal/templates/slicerequest_view.html

index 7ed1bd1..1f27d41 100644 (file)
@@ -108,7 +108,11 @@ 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 !!!"}
index af787c2..fc91224 100644 (file)
 <script>
 jQuery(document).ready(function(){
     var availableTags = [
-    {% if authorities %}
-        {% for authority in authorities %}
-        {value:"{{ authority.authority_hrn }}",label:"{{authority.name}}"},
-        {% endfor %}    
-    {% else %}
-        {value:"",label:"No authority found !!!"}
-    {% endif %}
+     {% if authorities %}
+         {% for authority in authorities %}
+             {% 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 %}
     ];
     $( "#authority_hrn" ).autocomplete({
       source: availableTags,