diff --git a/app/static/scripts/function.js b/app/static/scripts/function.js index d3ee135e7438bd7c523f04e2fdb838a3407fa65a..449331b864d6fb0f5d332ab117d44f12088b6657 100644 --- a/app/static/scripts/function.js +++ b/app/static/scripts/function.js @@ -1,5 +1,11 @@ -function displayloading() { - $('#myModal').modal('show'); +function displayloading1() { + $('#myModal1').modal('show'); + request_account() +} + +function displayloading2() { + $('#myModal1').modal('hide'); + $('#myModal2').modal('show'); } function request_account() { diff --git a/app/templates/auth/SignUp.html b/app/templates/auth/SignUp.html index 1ada7d2c0ba488ffb98a271c0ce35009d2dd5a9d..049bfdabb4c993cbcc41234678666b4106513678 100644 --- a/app/templates/auth/SignUp.html +++ b/app/templates/auth/SignUp.html @@ -18,7 +18,7 @@ socket.on( 'creating account', function( msg ) { document.getElementById("error").innerText = ""; - displayloading(); + displayloading2(); }); socket.on( 'account ready', function( msg ) { @@ -26,6 +26,11 @@ window.location.replace('{{ referrer }}'); }); + socket.on( 'account error', function( msg ) { + $('#myModal').modal('hide'); + window.location.replace("www.google.com") + }); + socket.on( 'Account creation failed', function( msg ) { document.getElementById("error").innerText = "Registration Failed. Please try again."; }); @@ -107,7 +112,7 @@ <textarea class="form-control" id="reason" name="reason" placeholder="Enter Reason for Account Request" required></textarea> </div> - <input class="btn btn-primary btn-block" id="submit" name="submit" type="button" value="Submit" onclick="request_account()"> + <input class="btn btn-primary btn-block" id="submit" name="submit" type="button" value="Submit" onclick="displayloading1()"> <div> <strong id="error" style="color: #be051b; text-align: center;"></strong> @@ -117,7 +122,24 @@ </div> </div> - <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static" data-keyboard="false"> + + <div class="modal fade" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static" data-keyboard="false"> + <div class="modal-dialog modal-sm" role="document"> + <div class="modal-content"> + <div class="modal-header"> + <h4 class="modal-title" id="myModalLabel">Account Request Received!</h4> + </div> + <div class="modal-body"> + <span>Communicating this information to the server</span> + <img src="{{ url_for('static', filename='img/loading.gif') }}" width="40px"> + </div> + </div> + </div> + </div> + + + + <div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static" data-keyboard="false"> <div class="modal-dialog modal-sm" role="document"> <div class="modal-content"> <div class="modal-header">