Opening changes
authorYasin <mohammed-yasin.rahman@lip6.fr>
Mon, 30 Jun 2014 11:08:09 +0000 (13:08 +0200)
committerYasin <mohammed-yasin.rahman@lip6.fr>
Mon, 30 Jun 2014 11:08:09 +0000 (13:08 +0200)
portal/joinview.py
portal/registrationview.py
portal/static/js/join.js
portal/templates/activate_user.html
portal/templates/activate_user.txt
portal/templates/join_complete.html [new file with mode: 0644]
portal/templates/join_view.html
portal/templates/registration_view.html
portal/templates/user_register_complete.html
portal/templates/user_request_email.html
portal/templates/user_request_email.txt

index 65d8351..5dd04c2 100644 (file)
@@ -43,8 +43,8 @@ class JoinView (FreeAccessView, ThemeView):
         root_authorities = sorted([a for a in authorities if '.' not in a['authority_hrn']])
 
         page = Page(request)
-        page.add_js_files  ( [ "js/jquery.validate.js", "js/join.js" ] )
-        page.add_css_files ( [ "css/onelab.css", "css/registration.css" ] )
+        page.add_js_files  ( [ "js/jquery.validate.js", "js/join.js", "js/jquery.qtip.min.js" ] )
+        page.add_css_files ( [ "css/onelab.css", "css/registration.css", "css/jquery.qtip.min.css" ] )
         page.add_css_files ( [ "https://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" ] )
 
         if method == 'POST':
@@ -216,8 +216,10 @@ class JoinView (FreeAccessView, ThemeView):
     
                 except Exception, e:
                     print "Failed to send email, please check the mail templates and the SMTP configuration of your server"
-
-                return render(request, 'user_register_complete.html') 
+                
+                self.template_name = 'join_complete.html'
+                return render(request, self.template, {'theme': self.theme})
+                #return render(request, 'user_register_complete.html') 
 
         template_env = {
           'topmenu_items': topmenu_items_live('join', page),
index f2fe7b9..13b6961 100644 (file)
@@ -56,6 +56,13 @@ class RegistrationView (FreeAccessView, ThemeView):
             current_site = Site.objects.get_current()
             current_site = current_site.domain
 
+            authorities_query = Query.get('authority').select('name', 'authority_hrn')
+            authorities = execute_admin_query(wsgi_request, authorities_query)
+    
+            for authority in authorities:
+                if authority['name'] == wsgi_request.POST.get('org_name', ''):
+                    authority_hrn = authority['authority_hrn']     
+
             post_email = wsgi_request.POST.get('email','').lower()
             salt = randint(1,100000)
             email_hash = md5(str(salt)+post_email).hexdigest()
@@ -63,7 +70,8 @@ class RegistrationView (FreeAccessView, ThemeView):
             user_request = {
                 'first_name'    : wsgi_request.POST.get('firstname',     ''),
                 'last_name'     : wsgi_request.POST.get('lastname',      ''),
-                'authority_hrn' : wsgi_request.POST.get('authority_hrn', ''),
+                'organization'  : wsgi_request.POST.get('org_name', ''),
+                'authority_hrn' : authority_hrn, 
                 'email'         : post_email,
                 'password'      : wsgi_request.POST.get('password',      ''),
                 'current_site'  : current_site,
index 193a00a..44d8c75 100644 (file)
@@ -1,5 +1,7 @@
 jQuery(document).ready(function(){
 
+    jQuery('[title!=""]').qtip();
+    
     jQuery("#joinForm").validate({
         rules: {
           pi_password: {
index 4e9aa1d..cbad91c 100644 (file)
@@ -3,7 +3,7 @@
 <p>We have received a user signup request for your email address at {{current_site}}</p>
 <p>You have the following user details:</p>
 
-Organisation: {{authority_hrn}}<br>
+Organization: {{organization}}<br>
 First name: {{first_name}}<br>
 Last name: {{last_name}}<br>
 Email: {{email}}<br>
index 0d2ca56..ac31ec2 100644 (file)
@@ -2,7 +2,7 @@ We have received a user signup request for your email address at {{current_site}
 
 You have the following user details:
 
-Organisation: {{authority_hrn}}
+Organization: {{organization}}
 First name: {{first_name}}
 Last name: {{last_name}}
 Email: {{email}}
diff --git a/portal/templates/join_complete.html b/portal/templates/join_complete.html
new file mode 100644 (file)
index 0000000..74813b5
--- /dev/null
@@ -0,0 +1,17 @@
+{% extends "layout.html" %}
+
+{% block content %}
+
+<div class="row">
+       <h1><img src="{{ STATIC_URL }}img/icon_user_small.png" alt="User Registration" />Request to add organization</h1>
+</div>
+<div class="row">
+  <h3>Organization information received.</h3>
+<p>
+We will contact the manager that you have listed with any questions that we might have.<br> 
+Once we have added the organization to the list, we will alert the manager.<br>
+At that time users will be able to sign up to join OneLab.
+</p>
+</div>
+
+{% endblock %}
index fecc7fb..9cba9f7 100644 (file)
@@ -5,7 +5,7 @@
 
 <div class="row">
        <div class="col-md-12">
-       <h1><img src="{{ STATIC_URL }}icons/testbed-xs.png" alt="Join Federation" /> Add organization</h1>
+       <h1><img src="{{ STATIC_URL }}icons/testbed-xs.png" alt="Join Federation" /> Request to add organization</h1>
        </div>
 </div>
 <div class="row">
index 78d6017..3cdbecf 100644 (file)
        <div class="form-group">
                <label for="authority_hrn" class="control-label">Organization</label>
                <p></p>
-               <input id="authority_hrn" name="authority_hrn" class="form-control" style="width:530px" value="{{ authority_hrn }}" 
+               <input id="authority_hrn" name="org_name" class="form-control" style="width:590px" value="{{ organization }}" 
                title="Choose your organization (company/university) from the list that apears when you click in the field and start to type.
                 Use the arrow keys to scroll through the list; type part of the name to narrow down the list. If it is not in the list, 
-               please add it by clicking the add organization link below. We will send an email to the managers that we have on record for 
+               please request its addition by clicking the link below. We will send an email to the managers that we have on record for 
                your organization, asking them to validate your sign-up request." required/>
                <p></p>
-               <p>Organization not listed? <a href="/portal/join">Add organization now.</a></p>
+               <p>Organization not listed? <a href="/portal/join">Request its addition now.</a></p>
        </div>
 
        <div class="row">
                                </div>
                                <div class="modal-body">
                                                <p align="left">
-                                               <a href="/portal/terms" target="_blank">TERMS AND CONDITIONS</a>
-                                       <br/>
                                        for OneLab Basic level service
                                        <br/>
                                        Version 0.6 of 20 May 2014
+                                               <br>
+                                               <a href="/portal/terms" target="_blank">[Printable format]</a>
                                                </p>
                                        <h1 align="left">1 Context</h1>
                                        <h2 align="left">1.1 OneLab</h2>
@@ -477,9 +477,10 @@ jQuery(document).ready(function(){
     {% 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}}"},
+                {value:"{{ authority.name }}",label:"{{authority.name}}"},
+                       // to show only full name
+           // {% else %}
+           //     {value:"{{ authority.authority_hrn }}",label:"{{authority.authority_hrn}}"},
             {% endif %}
         {% endfor %}    
     {% else %}
@@ -499,6 +500,7 @@ jQuery(document).ready(function(){
       }
       //select: function( event, ui ) {console.log(jQuery(this))}
     });
+       // for hover texts
        jQuery('[title!=""]').qtip();
 });
 </script>
index fb48e00..2bd2f0a 100644 (file)
@@ -11,8 +11,7 @@
   <p>To gain full access, two steps are required:</p>
   <ul>
        <li>1. You confirm your signup request by clicking on the link in the email that we have sent to your email address.</li>
-       <li>2. A manager from your organization validates your request. Upon confirmation of your signup request,<br> 
-               we will send an email to the managers at your organization with a validation request.</li>
+       <li>2. A manager from your organization validates your request. (We have sent email to your organisation's registered managers.)</li>
   </ul>                
 </div>
 
index 6bc2941..c198fee 100644 (file)
@@ -4,6 +4,7 @@
 <br>
 <b>First name   :</b> {{first_name}}<br>
 <b>Last name    :</b> {{last_name}}<br>
+<b>Organization :</b> {{organization}}<br>
 <b>Authority hrn:</b> {{authority_hrn}}<br>
 <b>Public key   :</b> {{public_key}}<br>
 <b>Email        :</b> {{email}}<br>
@@ -12,4 +13,4 @@
 <p></p>
 <p>You can validate the user <a href="http://{{current_site}}/portal/validate">here</a>.<p>
 <br>
-<p>Please note, the user will be available for validation only after he confirms his email address.</p>
+<p>Please note that the validation request will only become visible once the user has confirmed his/her email address.</p>
index cce80cb..17ce184 100644 (file)
@@ -2,8 +2,13 @@ NEW USER REQUEST
 
 First name   : {{first_name}}
 Last name    : {{last_name}} 
+Organization :{{organization}}
 Authority hrn: {{authority_hrn}}
 Public key   : {{public_key}}
 Email        : {{email}}
 User hrn     : {{user_hrn}}
 Portal url   : {{ current_site }}
+
+Please note that the validation request will only become visible once the user has confirmed his/her email address.
+
+