From e3534d5a2d301f68d812b1232f9d298fba44ca50 Mon Sep 17 00:00:00 2001 From: Yasin Date: Mon, 30 Jun 2014 13:08:09 +0200 Subject: [PATCH] Opening changes --- portal/joinview.py | 10 ++++++---- portal/registrationview.py | 10 +++++++++- portal/static/js/join.js | 2 ++ portal/templates/activate_user.html | 2 +- portal/templates/activate_user.txt | 2 +- portal/templates/join_complete.html | 17 +++++++++++++++++ portal/templates/join_view.html | 2 +- portal/templates/registration_view.html | 18 ++++++++++-------- portal/templates/user_register_complete.html | 3 +-- portal/templates/user_request_email.html | 3 ++- portal/templates/user_request_email.txt | 5 +++++ 11 files changed, 55 insertions(+), 19 deletions(-) create mode 100644 portal/templates/join_complete.html diff --git a/portal/joinview.py b/portal/joinview.py index 65d8351f..5dd04c22 100644 --- a/portal/joinview.py +++ b/portal/joinview.py @@ -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), diff --git a/portal/registrationview.py b/portal/registrationview.py index f2fe7b96..13b6961a 100644 --- a/portal/registrationview.py +++ b/portal/registrationview.py @@ -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, diff --git a/portal/static/js/join.js b/portal/static/js/join.js index 193a00ac..44d8c750 100644 --- a/portal/static/js/join.js +++ b/portal/static/js/join.js @@ -1,5 +1,7 @@ jQuery(document).ready(function(){ + jQuery('[title!=""]').qtip(); + jQuery("#joinForm").validate({ rules: { pi_password: { diff --git a/portal/templates/activate_user.html b/portal/templates/activate_user.html index 4e9aa1d0..cbad91c4 100644 --- a/portal/templates/activate_user.html +++ b/portal/templates/activate_user.html @@ -3,7 +3,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/activate_user.txt b/portal/templates/activate_user.txt index 0d2ca56b..ac31ec27 100644 --- a/portal/templates/activate_user.txt +++ b/portal/templates/activate_user.txt @@ -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 index 00000000..74813b5f --- /dev/null +++ b/portal/templates/join_complete.html @@ -0,0 +1,17 @@ +{% extends "layout.html" %} + +{% block content %} + +
+

User RegistrationRequest to add organization

+
+
+

Organization information received.

+

+We will contact the manager that you have listed with any questions that we might have.
+Once we have added the organization to the list, we will alert the manager.
+At that time users will be able to sign up to join OneLab. +

+
+ +{% endblock %} diff --git a/portal/templates/join_view.html b/portal/templates/join_view.html index fecc7fb0..9cba9f75 100644 --- a/portal/templates/join_view.html +++ b/portal/templates/join_view.html @@ -5,7 +5,7 @@
-

Join Federation Add organization

+

Join Federation Request to add organization

diff --git a/portal/templates/registration_view.html b/portal/templates/registration_view.html index 78d60171..3cdbecf3 100644 --- a/portal/templates/registration_view.html +++ b/portal/templates/registration_view.html @@ -22,13 +22,13 @@

-

-

Organization not listed? Add organization now.

+

Organization not listed? Request its addition now.

@@ -108,11 +108,11 @@
diff --git a/portal/templates/user_request_email.html b/portal/templates/user_request_email.html index 6bc29411..c198feec 100644 --- a/portal/templates/user_request_email.html +++ b/portal/templates/user_request_email.html @@ -4,6 +4,7 @@
First name : {{first_name}}
Last name : {{last_name}}
+Organization : {{organization}}
Authority hrn: {{authority_hrn}}
Public key : {{public_key}}
Email : {{email}}
@@ -12,4 +13,4 @@

You can validate the user here.


-

Please note, the user will be available for validation only after he confirms his email address.

+

Please note that the validation request will only become visible once the user has confirmed his/her email address.

diff --git a/portal/templates/user_request_email.txt b/portal/templates/user_request_email.txt index cce80cb3..17ce1842 100644 --- a/portal/templates/user_request_email.txt +++ b/portal/templates/user_request_email.txt @@ -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. + + -- 2.43.0