Allow to display authority_hrn if we don't have the name
[unfold.git] / portal / templates / registration_view.html
1 {% extends "layout.html" %}
2
3 {% block content %}        
4
5 <div class="row">
6         <div class="col-md-12">
7                 <h1><img src="{{ STATIC_URL }}icons/user-xs.png" alt="User Registration" />User sign-up</h1>
8         </div>
9 </div>
10 <div class="row">
11         <div class="col-md-12">
12                 <p><strong>Questions? <a href="/portal/contact" >Contact us.</a></strong></p>
13         </div>
14 </div>
15 {% if errors %}
16 <div class="row">
17         <div class="col-md-12">
18                 <ul>
19                   {% for error in errors %}
20                   <li>{{ error }}</li>
21                   {% endfor %}
22                 </ul>
23         </div>
24 </div>
25 {% endif %}
26 <div class="row">
27         <div class="col-md-12">
28                 
29                         <div class="form-group">
30                                 <form class="cmxform form-horizontal" id="registrationForm" method="post" enctype="multipart/form-data" role="form">
31                         {% csrf_token %}
32                                 <label for="authority_hrn" class="control-label">Organization</label>
33                                 <p></p>
34                                 <input id="authority_hrn" name="org_name" class="form-control" style="width:590px" value="{{ organization }}" 
35                                 title="Choose your organization (company/university) from the list that apears when you click in the field and start to type.
36                                  Use the arrow keys to scroll through the list; type part of the name to narrow down the list. If it is not in the list, 
37                                 please request its addition by clicking the link below. We will send an email to the managers that we have on record for 
38                                 your organization, asking them to validate your sign-up request." required/>
39                                 <p></p>
40                                 <p>Organization not listed? <a href="/portal/join">Request its addition now.</a></p>
41                         </div>
42         </div>
43 </div>
44
45 <div class="row">
46         <div class="col-md-6">
47         
48             <div class="form-group">
49                         <label for="firstname" class="control-label">Personal information</label>
50                         <p></p>
51                         <input type="text" name="firstname" class="form-control" style="width:350px" minlength="2" value="{{ first_name }}" placeholder="First name" required />
52             </div>
53             <div class="form-group">
54                         <input type="text" name="lastname" size="25" class="form-control" style="width:350px" minlength="2" value="{{ last_name }}" placeholder="Last name" required />
55             </div>
56                 <div class="form-group">
57                 <input type="email" name="email" size="25"  class="form-control" style="width:350px" value="{{ email }}" 
58                         title="Your e-mail address will be your identifier for logging in. We contact you to verify your account and then, occasionally, for important issues."
59                         placeholder="Email" required/>
60                 </div>
61         </div>  
62
63         <div class="col-md-6">
64             <div class="form-group">
65               <label for="password" class="control-label">Authentication</label>
66                   <p></p>       
67               <input type="password"  id="password" name="password"   class="form-control" style="width:250px" minlength="4" value="{{ password }}" 
68                         title="Your password allows you to log in to this portal."
69                         placeholder="Password" required />
70             </div>
71             <div class="form-group">
72                         <input type="password"  id="confirmpassword" name="confirmpassword" style="width:250px"  minlength="4" class="form-control" value="" 
73                                 placeholder="Confirm password" required />
74             </div>
75             <div class="form-group">
76                 <!--<label for="question" class="control-label">Keys</label> -->
77                         <select name="question" class="form-control" style="width:350px" id="key-policy" 
78                                 title="Your public/private key pair allows you to access the testbeds." required>        
79                                 <option value="generate">Generate my keys for me (recommended)</option>
80                                 <option value="upload">Upload my public key (advanced users only)</option>
81                         </select>
82             </div>
83             <div class="form-group" style="display:none;" id="upload_key">
84                 <label for="file" class="control-label">Upload public key</label>
85                 <input type="file" name="user_public_key" class="form-control" style="width:200px" id="user_public_key" required/>
86                 <br />
87                         <div class="alert alert-danger" id="pkey_del_msg">
88                                 In order for the portal to contact testbeds on your behalf, so as to list and reserve resources, you will need to 
89                                 <a href="http://trac.myslice.info/wiki/InstallSfa" target="_blank">delegate your public key to the portal.</a>
90                         </div>
91             </div>
92         </div>
93 </div>
94 <div class="row">
95         <div class="col-md-12">
96                 <div class="form-group">
97                         <p></p>
98                         <input type="checkbox" name="agreement" value="agreement" required/>&nbsp;&nbsp; I agree to the 
99                         <a href="#" data-toggle="modal" data-target="#myModal">terms and conditions.</a> 
100                 </div>
101         </div>
102 </div>
103 <div class="row">
104         <div class="col-md-12">
105                 <div class="form-group" id="register">
106                         <p></p> 
107                 <button class="submit btn btn-onelab" type="submit">Sign up</button>
108             </div>
109         </form> 
110         </div>
111 </div>
112         
113         
114         <!-- Modal - columns selector -->
115                 <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
116                         <div class="modal-dialog">
117                         <div class="modal-content">
118                                 <div class="modal-header">
119                                         <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
120                                                 <h4 class="modal-title" id="myModalLabel">Terms & Conditions</h4>
121                                 </div>
122                                 <div class="modal-body">
123                                                 <p align="left">
124                                         for OneLab Basic level service
125                                         <br/>
126                                         Version 0.6 of 20 May 2014
127                                                 <br>
128                                                 <a href="/portal/terms" target="_blank">[Printable format]</a>
129                                                 </p>
130                                         <h1 align="left">1 Context</h1>
131                                         <h2 align="left">1.1 OneLab</h2>
132                                         <p align="left">
133                                 OneLab is an experimental facility for testing new ideas and new technologies in the area of computer networking. It consists of a variety of types of
134                                 platforms, including:</p>
135                                         <ul type="disc">
136                                 <li>
137                                 <strong>internet overlay testbeds</strong>
138                                 , testbeds that offer virtual machines distributed across locations in different countries, allowing users to deploy overlays on the internet;
139                                 </li>
140                                 <li>
141                                 <strong>wireless testbeds</strong>
142                                 , testbeds that consist of clusters of computers that are within Wi-Fi communication range of each other, either in an office environment or in an
143                                 isolated setting;
144                                 </li>
145                                 <li>
146                                 <strong>internet of things testbeds</strong>
147                                 , testbeds that consist of embedded computing nodes with sensor capabilities, communicating wirelessly in an isolated environment;
148                                 </li>
149                                 <li>
150                                 <strong>emulation testbeds,</strong>
151                                 computing clusters that offer virtual machines on servers that are interconnected by a high speed switch, enabling large scale network emulation.
152                                 </li>
153                                         </ul>
154                                         <p align="left">
155                                 This list of types of platforms is subject to change, and the current list, along with the identities of the specific platforms of each type, can be found
156                                 on the OneLab website (onelab.eu).</p>
157                                         <p align="left">
158                                 Each platform has its own owners, and OneLab is the grouping of these platforms through a consortium of institutions. The OneLab consortium is coordinated
159                                 by UPMC Sorbonne Universités. It operates on a not-for-profit basis.</p>
160                                         <p align="left">
161                                 Access to OneLab may also provide access to additional platforms that are not part of OneLab, due to a federation agreement between OneLab and the owners
162                                 of those platforms.</p>
163                                         <h2 align="left">1.2 Fee-free Basic level service</h2>
164                                         <p align="left">These terms and conditions define and apply to OneLab's Basic level service, which is available free of charge.</p>
165                                         <p align="left">
166                                 Users who would like additional services are encouraged to contact support@onelab.eu. Some additional services require a written agreement, but are
167                                 otherwise free. Others require the payment of fees or in-kind contributions. (An example of an in-kind contribution is the hosting of a PlanetLab Europe
168                                 server node.)</p>
169                                         <h2 align="left">1.3 Managers and standard users</h2>
170                                         <p align="left">
171                                 There are two classes of OneLab user: the manager and the standard user. OneLab grants access rights to managers, who, in turn, provide access rights to
172                                         standard users. Examples are: for a small enterprise, an executive may be the manager and the employees may be standard users; for a research team, a
173                                 senior scientist (faculty member or research scientist) may be a manager and doctoral students and other members of the team may be standard users; for a
174                                 university course, a professor may be a manager and the students may be standard users.</p>
175                                         <h2 align="left">1.4 These terms and conditions</h2>
176                                         <p align="left">
177                                 Acceptance of these terms and conditions is a condition of obtaining OneLab Basic level user service. They are posted to the OneLab portal site
178                                 (portal.onelab.eu). They may be changed without other notice than the posting of a new version to the portal site.</p>
179                                         <h1 align="left">2 Services provided by OneLab</h1>
180                                         <h2 align="left">2.1 Access to the experimental facility</h2>
181                                         <p align="left">
182                                 OneLab provides users with access to the platforms that make up the experimental facility. Each platform owner determines the specifics of this access (for
183                                 example, how many nodes are available to a user, what happens in case of oversubscription, etc.), with the proviso that Basic level service requires that
184                                         users be able to conduct meaningful experiments on every OneLab testbed.</p>
185                                         <p align="left">
186                                 Basic level service may also provide access to platforms that are federated with OneLab, but such access depends upon the terms of the federation
187                                 agreements with those platforms, which may require that the user have a higher level of service in order to gain access. For example, Basic level service
188                                 provides access to PlanetLab Europe, a OneLab platform, without providing access to PlanetLab Central, a federated platform. Users wanting full access
189                                 across the global PlanetLab system should contact support@onelab.eu to arrange to enter into a PlanetLab Europe membership agreement.</p>
190                                         <p align="left">OneLab's role is to facilitate access to the platforms. Specifically, it provides each user with:</p>
191                                         <ul>
192                                 <li align="left">
193                                 <strong>a single account,</strong>
194                                 the credentials for which can be used to access all of the OneLab testbeds;
195                                 </li>
196                                 <li align="left">
197                                 <strong>tools through which to access the testbeds</strong>
198                                 , including, notably, a web-based portal (portal.onelab.eu) that allows a user to see the resources available on each testbed and to reserve them,
199                                 along with a number of experiment control tools that a user can employ to deploy an experiment on those resources;
200                                 </li>
201                                 <li align="left">
202                                 <strong>support</strong>
203                                 , with documentation on how to use the tools, pointers to documentation for individual testbeds, and a helpdesk to respond to user questions.
204                                 </li>
205                                         </ul>
206                                         <p align="left">
207                                             Additional support, such as accompaniment through the design and deployment of experiments and the interpretation of their results, is available through
208                                             higher levels of service.
209                                         </p>
210                                         <h2 align="left">
211                                             2.2 Best effort, without guarantees
212                                         </h2>
213                                         <p align="left">
214                                             OneLab and the owners of the individual OneLab testbeds do their best to provide the services outlined here, with the understanding that Basic level
215                                             service offers no guarantees. Users should clearly understand the following limitations.
216                                         </p>
217                                         <ul type="disc">
218                                             <li>
219                                                 <strong>Reliability:</strong>
220                                                 OneLab does not provide any guarantees with respect to the reliability of the portal, of other tools, or of the individual nodes on platforms. These
221                                                 may be taken down for maintenance, rebooted, or reinstalled at any time. Reinstallation implies that disks are wiped, meaning that users should not
222                                                 consider a local disk to be a persistent form of storage.
223                                             </li>
224                                             <li>
225                                                 <strong>Fitness:</strong>
226                                                 OneLab does not guarantee that the platforms are suitable for the experiments that users intend to conduct. There may be limitations in the
227                                                 technologies that are offered that prevent certain types of experiments from being carried out.
228                                             </li>
229                                             <li>
230                                                 <strong>Privacy</strong>
231                                                 : OneLab does not guarantee the privacy of traffic generated on the platforms (e.g., wireless signals, packets). Unless otherwise specified by an
232                                                 individual platform owner, users should assume that traffic is monitored and logged. Such monitoring may be done intentionally, for example, to allow
233                                                 platform administrators as well as other users to investigate abuse.
234                                             </li>
235                                         </ul>
236                                         <p align="left">
237                                             Users who seek such guarantees are invited to consider a higher level of service.
238                                         </p>
239                                         <h2 align="left">
240                                             2.3 Limitedliability
241                                         </h2>
242                                         <p align="left">
243                                             In no event shall the partners of the OneLab consortium be liable to any user for any consequential, incidental, punitive, or lost profit damages, or for
244                                             any damages arising out of loss of use or loss of data, to the extent that such damages arise out of the activities of OneLab consortium partners, or any
245                                             breach of the present terms and conditions, even if the consortium partner has been advised of the possibility of such damages.
246                                         </p>
247                                         <p align="left">
248                                             Nothing contained in these terms and conditions shall be deemed as creating any rights or liabilities in or for third parties who are not Basic level users
249                                             of OneLab.
250                                         </p>
251                                         <h1 align="left">
252                                             3 Acceptable use policy
253                                         </h1>
254                                         <h2 align="left">
255                                             3.1 Responsibilities of managers and standard users
256                                         </h2>
257                                         <p align="left">
258                                             OneLab creates and administers accounts for managers and delegates to managers the responsibility for creating and administering accounts for standard
259                                             users. Both managers and standard users are required to follow OneLab's acceptable use policy. In addition, managers are fully responsible for the
260                                             activities of the standard users whose accounts they create.
261                                         </p>
262                                         <p align="left">
263                                             A manager is expected to grant user access only an individual with whom he or she has a working relationship. In general, this means an individual who
264                                             works for the same institution as the manager, or, in the case of higher education and research, an individual who is a student at the university where the
265                                             manager works. Managers may also grant access to individuals from other institutions, provided that they are collaborating on a common project on OneLab.
266                                             If there is a doubt, a manager should refer the question to support@onelab.eu.
267                                         </p>
268                                         <h2 align="left">
269                                             3.2 Types of use
270                                         </h2>
271                                         <p align="left">
272                                             OneLab may be used by enterprise, by scientific researchers, and by educators.
273                                         </p>
274                                         <p align="left">
275                                             OneLab may be used for pre-commercial research and development. In keeping with OneLab's not-for-profit status, it may not be used to deploy services that
276                                             are designed to generate a commercial profit.
277                                         </p>
278                                         <p align="left">
279                                             Not-for-profit use of OneLab to deploy services that are designed to generate revenue requires prior approval through a written agreement, and thus may not
280                                             be carried out on a Basic level account. Interested users are invited to contact support@onelab.eu.
281                                         </p>
282                                         <p align="left">
283                                             OneLab may be used for scientific research.
284                                         </p>
285                                         <p align="left">
286                                             OneLab may be used to host lab exercises for university courses.
287                                         </p>
288                                         <p align="left">
289                                             Questions about other types of use should be addressed to support@onelab.eu.
290                                         </p>
291                                         <h2 align="left">
292                                             3.3 Applicable laws and regulations
293                                         </h2>
294                                         <p align="left">
295                                             OneLab is managed, and the portal is hosted, in France. Information regarding the countries in which individual testbeds are managed and hosted is
296                                             available from those testbeds. Users are responsible for being aware of the countries in which their experiments are deployed and for ensuring that their
297                                             use of OneLab fully conforms to the laws and regulations of those countries, as well as the laws and regulations of the country in which they themselves
298                                             are present when conducting their experiments.
299                                         </p>
300                                         <p align="left">
301                                             Above and beyond specific national laws, the activities email spamming, phishing through web services, and all types of Internet fraud are prohibited on
302                                             OneLab.
303                                         </p>
304                                         <h2>
305                                             3.4 Security and accounting mechanisms
306                                         </h2>
307                                         <p align="left">
308                                             Users are expected to respect the security and accounting mechanisms put in place by OneLab, its platforms, and federated platforms. For example, access to
309                                             PlanetLab Europe is designed to take place through the SSH cryptographically-secured connection protocol, which uses public/private key pair
310                                             authentication, and so users should not attempt to bypass this mechanism. As another example, OneLab's notion of a "slice" associates a set of resources
311                                             with the group of users who have reserved those resources, and users should not attempt to obscure the identities of participants in a slice.
312                                         </p>
313                                         <p align="left">
314                                             Hacking attempts against the OneLab portal and testbeds are not permitted. This includes "red team" (hacker test) experiments.
315                                         </p>
316                                         <h2>
317                                             3.5 Sharing of resources
318                                         </h2>
319                                         <p align="left">
320                                             OneLab is intended for ambitious experiments. Large numbers of resources and extended leases on resources may legitimately be granted in order to carry
321                                             these out. At the same time, OneLab and its testbeds are shared environments, and when there is contention for resources, limits must be imposed.
322                                         </p>
323                                         <p align="left">
324                                             Each OneLab platform sets its own policies for handling resource contention. As a general rule, users are encouraged to design their experiments to use
325                                             resources efficiently. In particular, spinning/busy-waiting techniques for extended periods of time are strongly discouraged. Some resource contention
326                                             policies (e.g., PlanetLab Europe's) terminate the jobs that are using the most resources in the case of contention.
327                                         </p>
328                                         <h2>
329                                             3.6 Internet-connected platforms
330                                         </h2>
331                                         <p align="left">
332                                             Some of OneLab's platforms allow experiments to take place on resources that have access to the public internet. These experiments can potentially generate
333                                             traffic to, and receive traffic from, any host or router in the internet.<a></a><a id="_anchor_1" href="#_msocom_1" name="_msoanchor_1">[LB1]</a>
334                                         </p>
335                                         <p align="left">
336                                             Furthermore, some internet-connected platforms (e.g., PlanetLab Europe) consist of servers that are hosted by a large number of member institutions.
337                                         </p>
338                                         <p align="left">
339                                             The accessibility of internet-connected platforms and the distributed hosting model of some of these platforms imply certain responsibilities on the part
340                                             of users, as detailed below.
341                                         </p>
342                                         <h3>
343                                             3.6.1 General guidance
344                                         </h3>
345                                         <p align="left">
346                                             A good litmus test when considering whether an experiment is appropriate for such internet-connected platforms is to ask what the network administrator at
347                                             one's own organisation would say about the experiment running locally. If the experiment disrupts local activity (e.g., uses more than its share of the
348                                             site's internet bandwidth) or triggers complaints from remote network administrators (e.g., performs systematic port scans), then it is not appropriate for
349                                             such internet-connected platforms.
350                                         </p>
351                                         <p align="left">
352                                             It is the responsibility of the user and the user's manager to ensure that an application that will run on an internet-connected platform is tested and
353                                             debugged in a controlled environment, to better understand its behaviour prior to deployment.
354                                         </p>
355                                         <h3>
356                                             3.6.2 Standards of network etiquette
357                                         </h3>
358                                         <p align="left">
359                                             Internet-connected platforms are designed to support experiments that generate unusual traffic, such as network measurements. However, it is expected that
360                                             all users adhere to widely accepted standards of network etiquette in an effort to minimise complaints from network administrators. Activities that have
361                                             been interpreted as worm and denial-of-service attacks in the past (and should be avoided) include sending SYN packets to port 80 on random machines,
362                                             probing random IP addresses, repeatedly pinging routers, overloading bottleneck links with measurement traffic, and probing a single target machine from
363                                             many nodes.
364                                         </p>
365                                         <p align="left">
366                                             For internet-connected platforms that have a distributed hosting model, each host institution will have its own acceptable use policy. Users should not
367                                             knowingly violate such local policies. Conflicts between local policies and OneLab's stated goal of supporting research into wide-area networks should be
368                                             brought to the attention of OneLab administrators at support@onelab.eu.
369                                         </p>
370                                         <h3>
371                                             3.6.3 Specific network usage rules
372                                         </h3>
373                                         <p align="left">
374                                             It is not allowed to use one or more nodes of an internet-connected platform to generate a high number of network flows or flood a site with high traffic
375                                             to the point of interfering with its normal operation. Use of congestion-controlled flows for large transfers is highly encouraged.
376                                         </p>
377                                         <p align="left">
378                                             It is not allowed to perform systematic or random port or address block scans from an internet-connected platform.
379                                         </p>
380                                         <p align="left">
381                                             For internet-connected platforms that use a distributed hosting model, it is not allowed to spoof or sniff traffic on a hosted server or on the network the
382                                             server belongs to.
383                                         </p>
384                                         <p align="left">
385                                             Access to a server on a distributed hosting platform may not be used to gain access to other servers or networked equipment that are not part of the
386                                             testbed.
387                                         </p>
388                                         <h2>
389                                             3.7 Wireless platforms
390                                         </h2>
391                                         <p align="left">
392                                             Wireless-connected platforms give users access to nodes that communicate via Wi-Fi and other wireless technologies. They may be capable of detecting
393                                             wireless activity in the neighbourhood of those nodes: traffic generated by other users of the platform or by individuals not associated with the platform.
394                                             In general, much of the traffic will be encrypted, with certain aspects (such as SSIDs) not encrypted, but it is also possible that there will be fully
395                                             unencrypted traffic. They may also be capable of generating wireless activity that reaches equipment outside of the testbed.
396                                         </p>
397                                         <p align="left">
398                                             Furthermore, some wireless-connected platforms may have built-in limitations to prevent them from generating signals at a strength that exceeds health and
399                                             safety regulations.
400                                         </p>
401                                         <p align="left">
402                                             These characteristics of wireless-connected platforms imply certain responsibilities on the part of users, as detailed below.
403                                         </p>
404                                         <h3>
405                                             3.7.1 Specific network usage rules
406                                         </h3>
407                                         <p align="left">
408                                             Experimenters may make no attempt to defeat the encryption of encrypted third-party traffic. Furthermore, experimenters must treat with utmost discretion
409                                             any unencrypted traffic. Limited metadata can be recorded for the bona fide purposes of an experiment, but under no case should third party communications
410                                             be recorded.
411                                         </p>
412                                         <p align="left">
413                                             No attempt may be made to reverse engineer traffic in order to learn the identities of the parties who have generated the traffic.
414                                         </p>
415                                         <p align="left">
416                                             Wireless-connected platforms may not be used to gain access to any network equipment that is not part of the testbed itself.
417                                         </p>
418                                         <p align="left">
419                                             It is not allowed to perform systematic or random scans of wireless networks that are not part of a wireless-connected platform. Similarly, it is not
420                                             allowed to spoof or sniff wireless traffic of the institution that hosts a wireless-connected platform or of other networks in the proximity.
421                                         </p>
422                                         <p align="left">
423                                             Care must be taken so that traffic on wireless-connected platforms does not interfere with the normal functioning of network equipment that is not part of
424                                             the testbed itself.
425                                         </p>
426                                         <p align="left">
427                                             No attempt may be made to defeat the mechanisms that limit signal strength on wireless-connected platforms.
428                                         </p>
429                                         <h2>
430                                             3.8 Handling suspected violations
431                                         </h2>
432                                         <p align="left">
433                                             Suspected violations of the OneLab acceptable use policy should be reported to support@onelab.eu.
434                                         </p>
435                                         <p align="left">
436                                             Upon notification or detection of a possible violation, OneLab management will attempt to understand if a violation has in fact occurred. To do so,
437                                             management will freely communicate with the users concerned, the operators of the platforms concerned, as well as any third parties that might be involved.
438                                             An example of a third party is a network operator who detects what they believe to be unauthorized traffic emanating from a OneLab platform.
439                                         </p>
440                                         <p align="left">
441                                             The priority is to resolve any real or apparent violations amicably. However, if OneLab management believes that a violation may have occurred, it can, at
442                                             its sole discretion, and without prior notice, apply any of the following measures:
443                                         </p>
444                                         <ul type="disc">
445                                             <li>
446                                                 notification of the users of the concerned slice (set of resources);
447                                             </li>
448                                             <li>
449                                                 disabling of the concerned slice;
450                                             </li>
451                                             <li>
452                                                 disabling an individual user's account;
453                                             </li>
454                                             <li>
455                                                 reporting of the user's activity to his/her manager;
456                                             </li>
457                                             <li>
458                                                 disabling of the manager's account and all user accounts for which the manager is responsible;
459                                             </li>
460                                             <li>
461                                                 disabling of all accounts associated with the user's institution.
462                                             </li>
463                                         </ul>
464                                         <p align="left">
465                                             In the case of suspected illegal activity, OneLab management might need, without prior notice, to notify the relevant authorities.
466                                         </p>
467
468                                 </div>
469                                 <div class="modal-footer">
470                                         <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
471                                 </div>
472                         </div>
473                         </div>
474 </div>
475
476     
477 <script>
478 jQuery(document).ready(function(){
479     var availableTags = [
480     {% if authorities %}
481         {% for authority in authorities %}
482             {% if authority.name %}
483                 {value:"{{ authority.name }}",label:"{{authority.name}}"},
484                         // show hrn if we don't have the name
485             {% else %}
486                 {value:"{{ authority.authority_hrn }}",label:"{{authority.authority_hrn}}"},
487             {% endif %}
488         {% endfor %}    
489     {% else %}
490         {value:"",label:"No authority found !!!"}
491     {% endif %}
492     ];
493         // sorting the list
494         availableTags.sort(function(a,b){
495                 var nameA=a.value.toLowerCase(), nameB=b.value.toLowerCase();
496                 if (nameA < nameB) {
497                 return -1;
498                 }
499                 if (nameA > nameB) {
500                 return 1;
501                 }
502         return 0;
503         }); 
504         // auto-complete the form
505     jQuery( "#authority_hrn" ).autocomplete({
506       source: availableTags,
507       minLength: 0,
508       change: function (event, ui) {
509           if(!ui.item){
510               //http://api.jqueryui.com/autocomplete/#event-change -
511               // The item selected from the menu, if any. Otherwise the property is null
512               //so clear the item for force selection
513               jQuery("#authority_hrn").val("");
514           }
515       }
516       //select: function( event, ui ) {console.log(jQuery(this))}
517     });
518         // for hover texts
519         jQuery('[title!=""]').qtip();
520 });
521 </script>
522 {% endblock %}
523