5929f165ce07fd4bf70c791168cd4def9efd43a9
[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" />Experimenter registration</h1>
8         </div>
9 </div>
10 <div class="row">
11         <div class="col-md-12">
12                 <h3>For First Line Support please <a href="/portal/contact" >Contact Support</a></h3>
13         </div>
14 </div>
15 {% if errors %}
16 <ul>
17   {% for error in errors %}
18   <li>{{ error }}</li>
19   {% endfor %}
20 </ul>
21 {% endif %}
22    
23 <div class="row">
24         <div class="col-md-2"></div>
25         <div class="col-md-8">
26         <form class="cmxform form-horizontal" id="registrationForm" method="post" enctype="multipart/form-data" role="form">
27     {% csrf_token %}
28     <div class="form-group">
29         <label for="firstname" class="control-label">First Name</label>
30                 <input type="text" name="firstname" class="form-control" minlength="2" value="{{ firstname }}" placeholder="First Name" required />
31     </div>
32     <div class="form-group">
33         <label for="lastname" class="control-label">Last Name</label>
34                 <input type="text" name="lastname" size="25" class="form-control" minlength="2" value="{{ lastname }}" placeholder="Last Name" required />
35     </div>
36     <div class="form-group">
37       <label for="authority_hrn" class="control-label">Authority</label>
38       <input id="authority_hrn" name="authority_hrn" class="form-control" value="{{ authority_hrn }}" required>
39       <p class="help-block">An authority responsible for vetting your account</p>
40     </div>
41
42         <!-- LOGIN
43         TODO: Login should be suggested from user email or first/last name, and
44         checked for existence. In addition, the full HRN should be shown to the
45         user.
46     <div class="form-group">
47       <label for="login" class="col-xs-2 control-label">Login</label>
48       <div class="col-xs-4">
49           <input type="text" name="login" size="25" class="form-control" minlength="2" value="{{ login }}" placeholder="Login" required />
50       </div>
51       <div class="col-xs-6"><p class="form-hint">Enter your login</p></div>
52     </div>
53         -->
54
55     <div class="form-group">
56         <label for="email" class="control-label">Email</label>
57         <input type="email" name="email" size="25"  class="form-control" value="{{ email }}" required/>
58     </div>
59     <div class="form-group">
60       <label for="password" class="control-label">Password</label>
61       <input type="password"  id="password" name="password"   class="form-control" minlength="4" value="{{ password }}" required/>
62     </div>
63     <div class="form-group">
64         <label for="password" class="control-label">Confirm Password</label>
65                 <input type="password"  id="confirmpassword" name="confirmpassword"   minlength="4" class="form-control" value="" placeholder="Confirm Password" required/>
66     </div>
67     <div class="form-group">
68         <label for="question" class="control-label">My Keys</label>
69                 <select name="question" class="form-control" id="key-policy" required>        
70                         <option value="generate">Generate key pairs for me </option>
71                         <option value="upload">Upload my public key </option>
72                 </select>
73         <p class="help-block">Genkey: Account Delegation Automatic (Recommended)</p>
74     </div>
75     <div class="form-group" style="display:none;" id="upload_key">
76         <label for="file" class="control-label">Upload public key</label>
77         <input type="file" name="user_public_key" class="form-control" id="user_public_key" required>
78         <br />
79                 <div class="alert alert-danger" id="pkey_del_msg">
80                         Once your account is validated, you will have to delegate your credentials manually using SFA [Advanced users only]
81                 </div>
82         <p class="help-block">Account Delegation: Manual (Advanced Users)</p>
83     </div>
84     <div class="form-group" id="register">
85       <button class="submit btn btn-default" type="submit">Register</button>
86     </div>
87   </form>  
88 </div>
89 <script>
90 jQuery(document).ready(function(){
91     var availableTags = [
92     {% if authorities %}
93         {% for authority in authorities %}
94             {% if authority.name %}
95                 {value:"{{ authority.authority_hrn }}",label:"{{authority.name}}"},
96             {% else %}
97                 {value:"{{ authority.authority_hrn }}",label:"{{authority.authority_hrn}}"},
98             {% endif %}
99         {% endfor %}    
100     {% else %}
101         {value:"",label:"No authority found !!!"}
102     {% endif %}
103     ];
104     jQuery( "#authority_hrn" ).autocomplete({
105       source: availableTags,
106       minLength: 0,
107       change: function (event, ui) {
108           if(!ui.item){
109               //http://api.jqueryui.com/autocomplete/#event-change -
110               // The item selected from the menu, if any. Otherwise the property is null
111               //so clear the item for force selection
112               jQuery("#authority_hrn").val("");
113           }
114       }
115       //select: function( event, ui ) {console.log(jQuery(this))}
116     });
117 });
118 </script>
119 {% endblock %}
120