-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
-{% block unfold1_main %}
+{% block content %}
-<div class="onelab-title well well-lg">
- <h2>OneLab Experimenter Registration</h2>
- <h4>For First Line Support please <a href="/portal/contact" >Contact Support</a></h3>
+<div class="row">
+ <div class="col-md-12">
+ <h1><img src="{{ STATIC_URL }}icons/user-xs.png" alt="User Registration" />Experimenter registration</h1>
+ </div>
+</div>
+<div class="row">
+ <div class="col-md-12">
+ <h3>For First Line Support please <a href="/portal/contact" >Contact Support</a></h3>
+ </div>
</div>
-
{% if errors %}
<ul>
{% for error in errors %}
</ul>
{% endif %}
-<div class="well">
- <form class="cmxform form-horizontal" id="registrationForm" method="post" action="" enctype="multipart/form-data" role="form">
- <fieldset>
+<div class="row">
+ <div class="col-md-2"></div>
+ <div class="col-md-8">
+ <form class="cmxform form-horizontal" id="registrationForm" method="post" enctype="multipart/form-data" role="form">
{% csrf_token %}
<div class="form-group">
- <label for="firstname" class="col-md-4 control-label">First Name</label>
- <div class="col-md-4">
- <input type="text" name="firstname" class="form-control" minlength="2" value="{{ firstname }}" placeholder="First Name" required />
- </div>
- <div class="col-md-4"> <p class="form-hint">Enter your first name</p> </div>
+ <label for="firstname" class="control-label">First Name</label>
+ <input type="text" name="firstname" class="form-control" minlength="2" value="{{ firstname }}" placeholder="First Name" required />
</div>
<div class="form-group">
- <label for="lastname" class="col-md-4 control-label">Last Name</label>
- <div class="col-md-4">
- <input type="text" name="lastname" size="25" class="form-control" minlength="2" value="{{ lastname }}" placeholder="Last Name" required />
- </div>
- <div class="col-md-4"><p class="form-hint">Enter your last name</p></div>
+ <label for="lastname" class="control-label">Last Name</label>
+ <input type="text" name="lastname" size="25" class="form-control" minlength="2" value="{{ lastname }}" placeholder="Last Name" required />
</div>
<div class="form-group">
- <label for="auth_list" class="col-md-4 control-label">Authority</label>
- <div class="col-md-4">
- <select id="auth_list" name="authority_hrn" size="1" class="form-control" required>
- {% if authorities %}
- {% for authority in authorities %}
- <option value="{{ authority.authority_hrn }}"/>{{authority.authority_hrn}}</option>
- <!-- <option value="{{ authority.authority_hrn }}">{{authority.name}} ({{authority.authority_hrn}})</option> -->
- {% endfor %}
- {% else %} <!-- should not happen -->
- <option value="test">No authority found !!! </option>
- {% endif %}
- </select>
- </div>
- <div class="col-md-4"><p class="form-hint">Please select an authority responsible for vetting your account</p></div>
+ <label for="authority_hrn" class="control-label">Authority</label>
+ <input id="authority_hrn" name="authority_hrn" class="form-control" value="{{ authority_hrn }}" required>
+ <p class="help-block">An authority responsible for vetting your account</p>
</div>
-
+
+ <!-- LOGIN
+ TODO: Login should be suggested from user email or first/last name, and
+ checked for existence. In addition, the full HRN should be shown to the
+ user.
<div class="form-group">
- <label for="email" class="col-md-4 control-label">Email</label>
- <div class="col-md-4">
- <input type="email" name="email" size="25" class="form-control" value="{{ email }}" required/>
+ <label for="login" class="col-xs-2 control-label">Login</label>
+ <div class="col-xs-4">
+ <input type="text" name="login" size="25" class="form-control" minlength="2" value="{{ login }}" placeholder="Login" required />
</div>
- <div class="col-md-4"><p class="form-hint">Enter a valid email address</p></div>
+ <div class="col-xs-6"><p class="form-hint">Enter your login</p></div>
</div>
+ -->
+
<div class="form-group">
- <label for="password" class="col-md-4 control-label">Password</label>
- <div class="col-md-4">
- <input type="password" id="password" name="password" class="form-control" minlength="4" value="{{ password }}" required/>
- </div>
- <div class="col-md-4"><p class="form-hint">Enter password</p></div>
+ <label for="email" class="control-label">Email</label>
+ <input type="email" name="email" size="25" class="form-control" value="{{ email }}" required/>
</div>
<div class="form-group">
- <label for="password" class="col-md-4 control-label">Confirm Password</label>
- <div class="col-md-4">
- <input type="password" id="confirmpassword" name="confirmpassword" minlength="4" class="form-control"
- value="" placeholder="Confirm Password" required/>
- </div>
- <div class="col-md-4"><p class="form-hint">Retype the password</p></div>
+ <label for="password" class="control-label">Password</label>
+ <input type="password" id="password" name="password" class="form-control" minlength="4" value="{{ password }}" required/>
</div>
<div class="form-group">
- <label for="question" class="col-md-4 control-label">My Keys</label>
- <div class="col-md-4">
- <select name="question" class="form-control" id="key-policy" required>
- <option value="generate">Generate key pairs for me </option>
- <option value="upload">Upload my public key </option>
- </select>
- </div>
- <div class="col-md-4"><p class="form-hint">Genkey: Account Delegation Automatic (Recommended)</p> </div>
+ <label for="password" class="control-label">Confirm Password</label>
+ <input type="password" id="confirmpassword" name="confirmpassword" minlength="4" class="form-control" value="" placeholder="Confirm Password" required/>
+ </div>
+ <div class="form-group">
+ <label for="question" class="control-label">My Keys</label>
+ <select name="question" class="form-control" id="key-policy" required>
+ <option value="generate">Generate key pairs for me </option>
+ <option value="upload">Upload my public key </option>
+ </select>
+ <p class="help-block">Genkey: Account Delegation Automatic (Recommended)</p>
</div>
<div class="form-group" style="display:none;" id="upload_key">
- <label for="file" class="col-md-4 control-label">Upload public key</label>
- <div class="col-md-4">
- <input type="file" name="user_public_key" class="form-control" id="user_public_key" required/>
- <p class="warning" id="pkey_del_msg">Once your account is validated, you will have to delegate your credentials manually using SFA [Advanced users only]</p>
- </div>
- <div class="col-md-4"><p class="form-hint">Account Delegation: Manual (Advanced Users)</p></div>
+ <label for="file" class="control-label">Upload public key</label>
+ <input type="file" name="user_public_key" class="form-control" id="user_public_key" required>
+ <br />
+ <div class="alert alert-danger" id="pkey_del_msg">
+ Once your account is validated, you will have to delegate your credentials manually using SFA [Advanced users only]
+ </div>
+ <p class="help-block">Account Delegation: Manual (Advanced Users)</p>
</div>
<div class="form-group" id="register">
- <div class="col-md-offset-4 col-md-4">
- <button class="submit btn btn-default" type="submit">Register</button>
- </div>
+ <button class="submit btn btn-default" type="submit">Register</button>
</div>
- </fieldset>
</form>
</div>
-
+<script>
+jQuery(document).ready(function(){
+ var availableTags = [
+ {% 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 %}
+ ];
+ jQuery( "#authority_hrn" ).autocomplete({
+ source: availableTags,
+ minLength: 0,
+ change: function (event, ui) {
+ if(!ui.item){
+ //http://api.jqueryui.com/autocomplete/#event-change -
+ // The item selected from the menu, if any. Otherwise the property is null
+ //so clear the item for force selection
+ jQuery("#authority_hrn").val("");
+ }
+ }
+ //select: function( event, ui ) {console.log(jQuery(this))}
+ });
+});
+</script>
{% endblock %}