Skip to content
Snippets Groups Projects
Commit de3fd8ae authored by Krish Moodbidri's avatar Krish Moodbidri
Browse files

sending text message for welcome message, error message and cancel message as...

sending text message for welcome message, error message and cancel message as a variable from messages.py
parent e9fcbe98
No related branches found
No related tags found
No related merge requests found
Pipeline #4630 failed with stage
...@@ -3,17 +3,17 @@ ...@@ -3,17 +3,17 @@
# local imports # local imports
from __future__ import print_function from __future__ import print_function
import vars import vars
import messages
# third-party imports # third-party imports
import uuid import uuid
from flask import Flask, redirect, url_for, request, render_template, flash, session from flask import Flask, redirect, url_for, request, render_template, flash, session, send_from_directory
from flask_bootstrap import Bootstrap from flask_bootstrap import Bootstrap
import random import random
import os import os
import json import json
def create_app(config_name): def create_app(config_name):
app = Flask(__name__) # initialization of the flask app app = Flask(__name__, static_folder='static') # initialization of the flask app
Bootstrap(app) # allowing app to use bootstrap Bootstrap(app) # allowing app to use bootstrap
def get_authorized_user(): def get_authorized_user():
...@@ -49,12 +49,10 @@ def create_app(config_name): ...@@ -49,12 +49,10 @@ def create_app(config_name):
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'),
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,
@app.route('/error') error_msg=messages.error_message)
def error():
return 'ERROR: '
@app.route('/error_account') @app.route('/error_account')
def error_account_create(): def error_account_create():
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
socket.on( 'account error', function( msg ) { socket.on( 'account error', function( msg ) {
console.log(msg); console.log(msg);
$('#myModal2').modal('hide'); $('#myModal2').modal('hide');
renderDom("Account Create Error", "Error while creating your account. We've been notified about this", msg); renderDom("Account Create Error", "{{ error_msg }}", msg);
}); });
}); });
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,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> Self Registration Form </h2> <h2> Self Registration Form </h2>
<p style="font-size:110%;"> Welcome to UAB's Reseach Computing cluster. The information below will be used to create your account. Please fill in all the details as this helps us understand our user base. Contact <a href="mailto:someone@yoursite.com">Research Computing</a> for any assistance in creating your account.</p> <p style="font-size:110%;"> {{ welcome_msg |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">
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
</div> </div>
<br> <br>
<div class="col-md-7 col-sm-7 my-col"> <div class="col-md-7 col-sm-7 my-col">
<button class="btn btn-danger btn-md" id="cancel" name="cancel" type="button" onClick="renderDom('Account Creation Cancelled','Close browser to end session', null)">Cancel</button> <button class="btn btn-danger btn-md" id="cancel" name="cancel" type="button" onClick="renderDom('Account Creation Cancelled','{{ cancel_msg |safe }}', null)">Cancel</button>
<button class="btn btn-primary btn-md" id="submit" name="submit" type="button" value="Submit" onclick="displayloading1();request_account()"> Create Account</button> <button class="btn btn-primary btn-md" id="submit" name="submit" type="button" value="Submit" onclick="displayloading1();request_account()"> Create Account</button>
</div> </div>
</form> </form>
......
welcome_message = "Welcome to UAB's Reseach Computing cluster. The information below will be used to create your account. Please fill in all the details as this helps us understand our user base. Contact <a href='mailto:someone@yoursite.com'>Research Computing</a> for any assistance in creating your account."
cancel_message = "Close browser to end session. Contact <a href="'mailto:someone@yoursite.com'">Research Computing</a> for any assistance in creating your account."
error_message = "Error while creating your account. We've been notified about this. Contact <a href="'mailto:someone@yoursite.com'">Research Computing</a> for any assistance in creating your account."
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment