Templates: Registration
[unfold.git] / portal / templates / onelab / onelab_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="/contact" >Contact us.</a></strong></p>
13   </div>
14 </div>
15
16 {% if errors %}
17 <div class="row">
18         <div class="col-md-12">
19                 <ul class="error">
20                   {% for error in errors %}
21                   <li>{{ error | safe }}</li>
22                   {% endfor %}
23                 </ul>
24         </div>
25 </div>
26 {% endif %}
27 <form action="/register" class="cmxform form-horizontal" method="post" enctype="multipart/form-data">
28 <div class="row">
29         <div class="col-md-6">
30             <div>
31                                 {% csrf_token %}
32                                 <label for="authority_hrn" class="control-label">Organization</label>
33                                 <p></p>
34                 <div class="ui-widget">
35                                 <select id="org_name" name="org_name" class="form-control" style="width:590px" value="{{ organization }}" 
36                                 title="Choose your organization (company/university) from the list that apears when you click in the field and start to type.
37                                  Use the arrow keys to scroll through the list; type part of the name to narrow down the list. We will send an email to 
38                                  the managers that we have on record for your organization, asking them to validate your sign-up request." required>
39                     <option value="">select an organization</option>
40                 {% if authorities %}
41                     {% for authority in authorities %}
42                         {% if authority.name %}
43                                 <option value="{{ authority.authority_hrn }}">{{authority.name}}</option>
44                         {% else %}
45                             <option value="{{ authority.authority_hrn }}">{{authority.authority_hrn}}</option>
46                         {% endif %}
47                     {% endfor %}               
48                 {% else %}
49                     <option value:"">No authority found !!!</option>
50                 {% endif %}
51                 </select>
52                 </div>
53                                 <p></p>
54                 {% include theme|add:"_authority_notListed.html" %}
55                 </div>
56         </div>
57 </div>
58
59 <div class="row">
60         <div class="col-md-6">
61            <p>
62                         <label for="firstname" class="control-label">Personal information</label>
63            </p>
64            <p>
65                         <input type="text" name="firstname" class="form-control" style="width:350px" minlength="2" value="{{ first_name }}" placeholder="First name" required />
66             </p>
67             <p>
68                         <input type="text" name="lastname" size="25" class="form-control" style="width:350px" minlength="2" value="{{ last_name }}" placeholder="Last name" required />
69             </p>
70                 <p>
71                 <input type="email" name="email" size="25"  class="form-control" style="width:350px" value="{{ email }}" 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." placeholder="Email" required />
72                 </p>
73         </div>  
74
75         <div class="col-md-6">
76             <p>
77               <label for="password" class="control-label">Authentication</label>
78                 </p>    
79                 <p>
80               <input type="password"  id="password" name="password"   class="form-control" style="width:250px" minlength="8" value="{{ password }}" 
81                         title="Your password allows you to log in to this portal."
82                         placeholder="Password" required />
83             </p>
84             <p>
85                         <input type="password"  id="confirmpassword" name="confirmpassword" style="width:250px"  minlength="8" class="form-control" value="" 
86                                 placeholder="Confirm password" required />
87             </p>
88             <p>
89                         <select name="question" class="form-control" style="width:350px" id="key-policy" 
90                                 title="Your public/private key pair allows you to access the testbeds." required >        
91                                 <option value="generate">Generate my keys for me (recommended)</option>
92                                 <option value="upload">Upload my public key (advanced users only)</option>
93                         </select>
94             </p>
95             <div style="display:none;" id="upload_key">
96                 <label for="file" class="control-label">Upload public key</label>
97                 <input type="file" name="user_public_key" class="form-control" style="width:200px" id="user_public_key" />
98                 <br />
99                         <div class="alert alert-danger" id="pkey_del_msg">
100                                 In order for the portal to contact testbeds on your behalf, so as to list and reserve resources, you will need to 
101                                 <a href="/portal/manual_delegation" target="_blank">delegate your credentials to the portal.</a>
102                         </div>
103             </div>
104         </div>
105 </div>
106 <div class="row">
107         <div class="col-md-12">
108                 <p>
109                         <input type="checkbox" name="agreement" value="agreement" required />&nbsp;&nbsp; I agree to the 
110                         <a href="#" data-toggle="modal" data-target="#myModal">terms and conditions.</a> 
111                 </p>
112         </div>
113 </div>
114 {% include theme|add:"_register_info.html" %}
115 <div class="row">
116         <div class="col-md-12">
117                 <div id="register">
118                         <p>
119                 <input class="submit btn btn-onelab" type="submit" value="Sign up" />
120                 </p>
121                 </form>
122             </div>
123         </div>
124 </div>
125
126         <!-- Modal - columns selector -->
127 <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
128                         <div class="modal-dialog">
129                         <div class="modal-content">
130                                 <div class="modal-header">
131                                         <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
132                                                 <h4 class="modal-title" id="myModalLabel">Terms & Conditions</h4>
133                                 </div>
134                                 <div class="modal-body">
135                     {% include theme|add:"_terms_and_conditions.html" %}
136                                 </div>
137                                 <div class="modal-footer">
138                                         <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
139                                 </div>
140                         </div>
141                         </div>
142 </div>
143     
144 <script>
145 $(document).ready(function(){
146
147         // auto-complete the form
148     jQuery("#org_name").combobox();
149     
150     {% if theme == 'fed4fire' %}
151     //setting the default value in the org_list
152     var temp="fed4fire.global"; 
153     $("#org_name").val(temp);
154     {% endif %}
155
156         $('[title!=""]').qtip();
157         $("form").validate();
158         $("form").submit(function() {
159                 if ($('select option:selected').val() == 'upload') {
160                         if ($('input[name=user_public_key]').val() == '') {
161                                 alert('Please specify the key file to upload');
162                                 return false;
163                         }
164                 }
165         });
166 });
167 </script>
168 {% endblock %}