fed4fire: changes for the review
authorYasin <mohammed-yasin.rahman@lip6.fr>
Wed, 11 Jun 2014 17:06:15 +0000 (19:06 +0200)
committerYasin <mohammed-yasin.rahman@lip6.fr>
Wed, 11 Jun 2014 17:06:15 +0000 (19:06 +0200)
portal/forms.py
portal/templates/_widget-login-user.html
portal/templates/fed4fire/fed4fire__widget-login.html [deleted file]
portal/templates/fed4fire/fed4fire_home-view.html
portal/templates/fed4fire/fed4fire_registration_view.html [new file with mode: 0644]
portal/templates/fed4fire/fed4fire_widget-topmenu.html

index 38293e4..ecd2e6c 100644 (file)
@@ -86,12 +86,12 @@ class ContactForm(forms.Form):
    #                              error_messages={'invalid': _("This value may contain only letters, numbers and @/./+/-/_ characters.")})
     email = forms.EmailField(widget=forms.TextInput(attrs={'class':'form-control'}))
     subject = forms.RegexField(widget=forms.TextInput(attrs={'class':'form-control'}),
-                                regex=r'^[\w.@+-]+$',
+                                regex=r'^[\w+\s\w+]+$',
                                  max_length=100,
                                  label=_("subject"),
                                  error_messages={'invalid': _("This value may contain only letters, numbers and @/./+/-/_ characters.")})
     description = forms.RegexField(widget=forms.Textarea(attrs={'class':'form-control'}),
-                                regex=r'^[\w.@+-]+$',
+                                regex=r'^[\w+\s\w+]+$',
                                  label=_("description"),
                                  error_messages={'invalid': _("This value may contain only letters, numbers and @/./+/-/_ characters.")})    
     cc_myself = forms.BooleanField(required=False,widget=forms.CheckboxInput(attrs={'class':'form-control'}))
index 9e24887..4c3fd15 100644 (file)
@@ -20,7 +20,7 @@
                <span class="lost-password">&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="/portal/pass_reset/">Can't access your account?</a></span>
        </div>
        <div class="login-signup">
-               <a href="/portal/register">Try</a> or <a href="/portal/register">Sign Up</a>
+               Don't have an account? <a href="/portal/register">Sign up now</a>
        </div>
        </form>
 </div>
diff --git a/portal/templates/fed4fire/fed4fire__widget-login.html b/portal/templates/fed4fire/fed4fire__widget-login.html
deleted file mode 100644 (file)
index db7245c..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<div class="well">
-       {% if state %}
-       <span class="help-block">{{ state }}</span>
-       {% endif %}
-       <form action="/login/" method="post" role="form">
-         {% csrf_token %}
-         {% if next %}
-         <input type="hidden" name="next" value="{{ next }}" />
-         {% endif %}
-       <div class="form-group">
-       <label for="username">Email address / Username</label>
-       <input type="email" class="form-control" name="username" placeholder="Enter Email / username">
-       </div>
-       <div class="form-group">
-       <label for="password">Password</label>
-       <input type="password" class="form-control" name="password" placeholder="Password">
-       </div>
-       <div class="login-submit">
-               <input class="btn btn-default" type="submit" value="Sign In" />
-               <span class="lost-password">&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="/portal/pass_reset/">Can't access your account?</a></span>
-       </div>
-       <div class="login-signup">
-               <a href="/portal/register">Try</a> or <a href="/portal/register">Sign Up</a>
-       </div>
-       </form>
-</div>
index fd560f4..0357018 100644 (file)
@@ -84,6 +84,9 @@
                        <h3>
                                A wide variety of world class testbeds available through your one account.
                        </h3>
+                       <h3>
+                                <a href='http://doc.fed4fire.eu' target="_blank">Want to learn more?</a>
+                       </h3>
                </div>
                <div class="col-sm-4 col-sm-offset-1" style="width:400px; top:16px; float:left;">
                        <div class="row">
diff --git a/portal/templates/fed4fire/fed4fire_registration_view.html b/portal/templates/fed4fire/fed4fire_registration_view.html
new file mode 100644 (file)
index 0000000..3afdae2
--- /dev/null
@@ -0,0 +1,151 @@
+{% extends "layout.html" %}
+
+{% block content %}        
+
+<div class="row">
+       <h1><img src="{{ STATIC_URL }}icons/user-xs.png" alt="User Registration" />User sign-up</h1>
+</div>
+<div class="row">
+               <p></p>
+               <p><strong>Questions? <a href="/portal/contact" >Contact us.</a></strong></p>
+</div>
+{% if errors %}
+<ul>
+  {% for error in errors %}
+  <li>{{ error }}</li>
+  {% endfor %}
+</ul>
+{% endif %}
+<div class="row"><div class="col-sm-12">
+<form class="cmxform form-horizontal" id="registrationForm" method="post" enctype="multipart/form-data" role="form">
+{% csrf_token %}
+       <div class="form-group">
+               <label for="authority_hrn" class="control-label">Authority</label>
+               <p></p>
+               <input id="authority_hrn" name="authority_hrn" class="form-control" style="width:530px" value="{{ authority_hrn }}" placeholder="fed4fire" required>
+               <p class="help-block">If your organization does not deploy a Fed4FIRE authority itself,<br> you can use the default one called "fed4fire".</p> 
+       </div>
+
+       <div class="row">
+       <div class="col-md-4">
+       
+           <div class="form-group">
+                       <label for="firstname" class="control-label">Personal information</label>
+                       <p></p>
+                       <input type="text" name="firstname" class="form-control" style="width:200px" minlength="2" value="{{ first_name }}" placeholder="First name" required />
+           </div>
+           <div class="form-group">
+                       <input type="text" name="lastname" size="25" class="form-control" style="width:200px" minlength="2" value="{{ last_name }}" placeholder="Last name" required />
+           </div>
+               <div class="form-group">
+               <input type="email" name="email" size="25"  class="form-control" style="width:200px" 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/>
+               </div>
+       </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="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-xs-6"><p class="form-hint">Enter your login</p></div>
+    </div>
+       -->
+       <div class="col-md-4">
+           <div class="form-group">
+             <label for="password" class="control-label">Authentication</label>
+                 <p></p>       
+             <input type="password"  id="password" name="password"   class="form-control" style="width:200px" minlength="4" value="{{ password }}" 
+                       title="Your password allows you to log in to this portal."
+                       placeholder="Password" required/>
+           </div>
+           <div class="form-group">
+                       <input type="password"  id="confirmpassword" name="confirmpassword" style="width:200px"  minlength="4" class="form-control" value="" 
+                               placeholder="Confirm password" required/>
+           </div>
+           <div class="form-group">
+               <!--<label for="question" class="control-label">Keys</label> -->
+                       <select name="question" class="form-control" style="width:200px" id="key-policy" 
+                               title="Your public/private key pair allows you to access the testbeds." required>        
+                               <option value="generate">Generate my keys for me (recommended)</option>
+                               <option value="upload">Upload my public key (advanced users only)</option>
+                       </select>
+           </div>
+           <div class="form-group" style="display:none;" id="upload_key">
+               <label for="file" class="control-label">Upload public key</label>
+               <input type="file" name="user_public_key" class="form-control" style="width:200px" id="user_public_key" required/>
+               <br />
+                       <div class="alert alert-danger" id="pkey_del_msg">
+                               In order for the portal to contact testbeds on your behalf, so as to list and reserve resources, you will need to 
+                               <a href="http://trac.myslice.info/wiki/InstallSfa" target="_blank">delegate your public key to the portal.</a>
+                       </div>
+           </div>
+       </div>
+       </div>
+
+       <div class="form-group">
+               <p></p>
+               <input type="checkbox" name="agreement" value="agreement" required/> I agree to the 
+               <button class="btn btn-default btn-xs" data-toggle="modal" data-target="#myModal">terms and conditions.</button> 
+       </div>
+       <!-- Modal - columns selector -->
+               <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
+                       <div class="modal-dialog">
+                       <div class="modal-content">
+                               <div class="modal-header">
+                                       <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
+                                               <h4 class="modal-title" id="myModalLabel">Terms & Conditions</h4>
+                               </div>
+                               <div class="modal-body">
+                                               <p>The exact terms and conditions for Fed4FIRE are currently under development.</p>                                             
+                               </div>
+                               <div class="modal-footer">
+                                       <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
+                               </div>
+                       </div>
+                       </div>
+               </div>
+
+    <div class="form-group" id="register">
+               <p></p> 
+       <button class="submit btn btn-primary" type="submit">Sign up</button>
+    </div>
+</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 %}
+
index 74edfdc..1dde768 100644 (file)
@@ -2,7 +2,7 @@
 <div id="header">
        <div class="wrapper">
                <div class="logo">
-                       <a href="/"><img src="{{ STATIC_URL }}img/f4f-logo.png" alt="Fed4Fire Portal" width="80px" />Fed4Fire Portal</a>
+                       <a href="/"><img src="{{ STATIC_URL }}img/f4f-logo.png" alt="Fed4Fire Portal" width="80px" />Home</a>
                </div>
                
                <div id="secondary">
@@ -20,7 +20,7 @@
                <ul>
                        <li id="nav-account"><a href="/portal/account/">{{ username }}</a></li>
                        <li>|</li>
-                       <li id="nav-institution" class=""><a href="/portal/institution">INSTITUTION</a></li>
+                       <li id="nav-institution" class=""><a href="/portal/institution">AUTHORITY</a></li>
                        <li class="slices">
                                <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                        SLICES <span class="caret"></span>