From 2ceaf7332e30fa099fea2c997c48e4882210d97d Mon Sep 17 00:00:00 2001 From: root <root@login001.cm.cluster> Date: Fri, 12 Feb 2021 04:22:47 -0600 Subject: [PATCH] fixed overlay turn on on click submit --- app/static/scripts/function.js | 10 ++++++++-- app/templates/auth/SignUp.html | 28 +++++++++++++++++++++++++--- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/app/static/scripts/function.js b/app/static/scripts/function.js index d3ee135..449331b 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 1ada7d2..049bfda 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"> -- GitLab