Commit c6bbd5b2 authored by Krish Moodbidri's avatar Krish Moodbidri
Browse files

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
parent df37ef2a
...@@ -51,19 +51,17 @@ def create_app(config_name): ...@@ -51,19 +51,17 @@ def create_app(config_name):
session['return_url'] = request.args.get('redir', vars.default_referrer) session['return_url'] = request.args.get('redir', vars.default_referrer)
if (not any(item in session['user'].get('eppa') for item in valid_eppa)): 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": 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": elif rc_util.check_state(session['user'].get('username')) == "certification":
return render_template('account/certify.html', room_id=session['uid'], return render_template('account/certify.html', room_id=session['uid'],
username=session['user'].get('username'), username=session['user'].get('username'),
fullname=session['user'].get('fullname'), email=session['user'].get('email'), fullname=session['user'].get('fullname'), email=session['user'].get('email'),
referrer=session['return_url'], cancel_url=vars.default_referrer, referrer=session['return_url'], cancel_url=vars.default_referrer,
welcome_msg=messages.welcome_message, cancel_msg=messages.cancel_message, certification_message_msg=messages.certification_message)
cancel_msg=messages.cancel_message,
error_msg=messages.error_message)
else: else:
return render_template('auth/SignUp.html', room_id=session['uid'], return render_template('auth/SignUp.html', room_id=session['uid'],
username=session['user'].get('username'), username=session['user'].get('username'),
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<div class="col-md-10 col-sm-10 my-col"> <div class="col-md-10 col-sm-10 my-col">
<div id="form-wrapper"> <div id="form-wrapper">
<h2> Account blocked </h2> <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> </div>
</div> </div>
......
...@@ -79,8 +79,8 @@ ...@@ -79,8 +79,8 @@
<div class="col-md-10 col-sm-10 my-col"> <div class="col-md-10 col-sm-10 my-col">
<div id="form-wrapper"> <div id="form-wrapper">
<h2> Self Certification Form </h2> <h2> Annual Recertification Form </h2>
<p style="font-size:110%;"> {{ welcome_msg |safe }}</p> <p style="font-size:110%;"> {{ certification_message |safe }}</p>
<div id="user-input"> <div id="user-input">
<form id="signup" data-toggle="validator" role="form" action="." method="post" onsubmit=""> <form id="signup" data-toggle="validator" role="form" action="." method="post" onsubmit="">
<div class="col-md-7 col-sm-7 my-col"> <div class="col-md-7 col-sm-7 my-col">
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<div class="col-md-10 col-sm-10 my-col"> <div class="col-md-10 col-sm-10 my-col">
<div id="form-wrapper"> <div id="form-wrapper">
<h2> Account Authorization error </h2> <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> </div>
</div> </div>
......
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." 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." 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." 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."
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment