Registration Form: redesigned!
[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                 <h3>Questions? <a href="/portal/contact" >Contact us</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="authority_hrn" class="control-label">Organization</label>
30                 <input id="authority_hrn" name="authority_hrn" class="form-control" style="width:200px" value="{{ authority_hrn }}" required>
31                 <p class="help-block">Start typing to find the name of your organization (company or university).<br> If it is not in the list, <a href="/portal/join">please add it.</a></p>
32         </div>
33
34     <div class="form-group">
35                 <label for="firstname" class="control-label">Personal Information</label>
36                 <input type="text" name="firstname" class="form-control" style="width:200px" minlength="2" value="{{ firstname }}" placeholder="First Name" required />
37     </div>
38     <div class="form-group">
39                 <input type="text" name="lastname" size="25" class="form-control" style="width:200px" minlength="2" value="{{ lastname }}" placeholder="Last Name" required />
40     </div>
41         <div class="form-group">
42         <input type="email" name="email" size="25"  class="form-control" style="width:200px" value="{{ email }}" placeholder="Email" required/>
43                 <p class="help-block">Your e-mail address will be your identifier for logging in.<br> We contact you to verify your account and then, occasionally, for important issues. </p>
44         </div>
45
46
47         <!-- LOGIN
48         TODO: Login should be suggested from user email or first/last name, and
49         checked for existence. In addition, the full HRN should be shown to the
50         user.
51     <div class="form-group">
52       <label for="login" class="col-xs-2 control-label">Login</label>
53       <div class="col-xs-4">
54           <input type="text" name="login" size="25" class="form-control" minlength="2" value="{{ login }}" placeholder="Login" required />
55       </div>
56       <div class="col-xs-6"><p class="form-hint">Enter your login</p></div>
57     </div>
58         -->
59
60     <div class="form-group">
61       <label for="password" class="control-label">Authentication</label>
62       <input type="password"  id="password" name="password"   class="form-control" style="width:200px" minlength="4" value="{{ password }}" placeholder="Password" required/>
63     </div>
64     <div class="form-group">
65                 <input type="password"  id="confirmpassword" name="confirmpassword" style="width:200px"  minlength="4" class="form-control" value="" placeholder="Confirm Password" required/>
66                 <p class="help-block">Your password allows you to log in to this portal.</p>
67     </div>
68     <div class="form-group">
69         <!--<label for="question" class="control-label">Keys</label> -->
70                 <select name="question" class="form-control" style="width:200px" id="key-policy" required>        
71                         <option value="generate">Generate my keys for me (recommended)</option>
72                         <option value="upload">Upload my public key (advanced users only)</option>
73                 </select>
74                 <p class="help-block">Your public/private key pair allows you to access the testbeds.</p>
75     </div>
76     <div class="form-group" style="display:none;" id="upload_key">
77         <label for="file" class="control-label">Upload public key</label>
78         <input type="file" name="user_public_key" class="form-control" style="width:200px" id="user_public_key" required/>
79         <br />
80                 <div class="alert alert-danger" id="pkey_del_msg">
81                         In order for the portal to contact testbeds on your behalf, so as to list and reserve resources, you will need to i
82                         <a href="http://trac.myslice.info/wiki/InstallSfa" target="_blank">delegate your public key to the portal.</a>
83                 </div>
84     </div>
85         <div class="form-group">
86                 <input type="checkbox" required /> I agree to the terms and conditions.
87         </div>
88     <div class="form-group" id="register">
89       <button class="submit btn btn-default" type="submit">Sign up</button>
90     </div>
91   </form>  
92 </div>
93 <script>
94 jQuery(document).ready(function(){
95     var availableTags = [
96     {% if authorities %}
97         {% for authority in authorities %}
98             {% if authority.name %}
99                 {value:"{{ authority.authority_hrn }}",label:"{{authority.name}}"},
100             {% else %}
101                 {value:"{{ authority.authority_hrn }}",label:"{{authority.authority_hrn}}"},
102             {% endif %}
103         {% endfor %}    
104     {% else %}
105         {value:"",label:"No authority found !!!"}
106     {% endif %}
107     ];
108     jQuery( "#authority_hrn" ).autocomplete({
109       source: availableTags,
110       minLength: 0,
111       change: function (event, ui) {
112           if(!ui.item){
113               //http://api.jqueryui.com/autocomplete/#event-change -
114               // The item selected from the menu, if any. Otherwise the property is null
115               //so clear the item for force selection
116               jQuery("#authority_hrn").val("");
117           }
118       }
119       //select: function( event, ui ) {console.log(jQuery(this))}
120     });
121 });
122 </script>
123 {% endblock %}
124