From c6bbd5b2fecedd23604964dd7b8ccc8170bf8bac Mon Sep 17 00:00:00 2001
From: Krish M <krish94@uab.edu>
Date: Thu, 5 May 2022 15:29:29 -0500
Subject: [PATCH] Message passing for account services pages

1. Added messages to message.py
2. Sent the messages to 3 account services pages
3. Added these variables in the 3 account services html page
---
 app/__init__.py                         | 8 +++-----
 app/templates/account/blocked.html      | 2 +-
 app/templates/account/certify.html      | 4 ++--
 app/templates/account/unauthorized.html | 2 +-
 messages.py                             | 2 ++
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/app/__init__.py b/app/__init__.py
index 3dc5f8e..2f21df8 100644
--- a/app/__init__.py
+++ b/app/__init__.py
@@ -51,19 +51,17 @@ def create_app(config_name):
         session['return_url'] = request.args.get('redir', vars.default_referrer)
 
         if (not any(item in session['user'].get('eppa') for item in valid_eppa)):
-            return render_template('account/unauthorized.html')
+            return render_template('account/unauthorized.html', unauthorized_message=messages.unauthorized_message)
 
         if rc_util.check_state(session['user'].get('username')) == "blocked":
-            return render_template('account/blocked.html')
+            return render_template('account/blocked.html', unauthorized_message=messages.unauthorized_message)
 
         elif rc_util.check_state(session['user'].get('username')) == "certification":
               return render_template('account/certify.html', room_id=session['uid'],
                                username=session['user'].get('username'),
                                fullname=session['user'].get('fullname'), email=session['user'].get('email'),
                                referrer=session['return_url'], cancel_url=vars.default_referrer,
-                               welcome_msg=messages.welcome_message,
-                               cancel_msg=messages.cancel_message,
-                               error_msg=messages.error_message)
+                               cancel_msg=messages.cancel_message, certification_message_msg=messages.certification_message)
         else:
             return render_template('auth/SignUp.html', room_id=session['uid'],
                                username=session['user'].get('username'),
diff --git a/app/templates/account/blocked.html b/app/templates/account/blocked.html
index 964235e..b7b729f 100644
--- a/app/templates/account/blocked.html
+++ b/app/templates/account/blocked.html
@@ -53,7 +53,7 @@
   <div class="col-md-10 col-sm-10 my-col">
     <div id="form-wrapper">
     <h2> Account blocked </h2>
-    <p style="font-size:110%;"> {{ welcome_msg |safe }}</p>
+    <p style="font-size:110%;"> {{ unauthorized_message |safe }}</p>
     </div>
   </div>
 </div>  
diff --git a/app/templates/account/certify.html b/app/templates/account/certify.html
index abb4a46..dd87d05 100644
--- a/app/templates/account/certify.html
+++ b/app/templates/account/certify.html
@@ -79,8 +79,8 @@
 
   <div class="col-md-10 col-sm-10 my-col">
     <div id="form-wrapper">
-    <h2> Self Certification Form </h2>
-    <p style="font-size:110%;"> {{ welcome_msg |safe }}</p>
+    <h2> Annual Recertification Form </h2>
+    <p style="font-size:110%;"> {{ certification_message |safe }}</p>
       <div id="user-input">    
         <form id="signup" data-toggle="validator" role="form" action="." method="post" onsubmit="">
           <div class="col-md-7 col-sm-7 my-col">
diff --git a/app/templates/account/unauthorized.html b/app/templates/account/unauthorized.html
index f4a5cf5..ba826f8 100644
--- a/app/templates/account/unauthorized.html
+++ b/app/templates/account/unauthorized.html
@@ -53,7 +53,7 @@
   <div class="col-md-10 col-sm-10 my-col">
     <div id="form-wrapper">
     <h2> Account Authorization  error </h2>
-    <p style="font-size:110%;"> {{ welcome_msg |safe }}</p>
+    <p style="font-size:110%;"> {{ unauthorized_message |safe }}</p>
     </div>
   </div>
 </div>  
diff --git a/messages.py b/messages.py
index f4dfbf0..d4adb29 100644
--- a/messages.py
+++ b/messages.py
@@ -1,3 +1,5 @@
 welcome_message = "The information below will be used to create your account. Please fill in the reason for requesting your account as this helps us understand our user base.<br>Contact <a href='mailto:support@listserv.uab.edu'>Research Computing</a> if you have any questions."
 cancel_message = "Close current tab to end session.<br>Contact <a href="'mailto:support@listserv.uab.edu'">Research Computing</a> if you have any questions."
 error_message = "An error occurred while creating your account. Research Computing team has been notified and is working on fixing it.<br>Contact <a href='mailto:support@listserv.uab.edu'>Research Computing</a> if you have any questions."
+certification_message = "Welcome back to the UAB Research Computing services page. We are asking for researchers to recertify their accounts annually so that we'll know who is still actively using the systems. Fill out the form below and hit the Certify Account button when you are done."
+unauthorized_message = "Your UAB Research Computing account is currently on hold. Accounts are put on hold if there are changes with UAB affiliation or if there is an issue on one of the platforms. Please reach out to <a href="'mailto:support@listserv.uab.edu'">Research Computing</a> or attend the weekly office hours and we'll work with you to clear your account."
-- 
GitLab