diff --git a/app/static/css/allPendingForms.css b/app/static/css/allPendingForms.css index b5635d8a6..229fc6bb4 100644 --- a/app/static/css/allPendingForms.css +++ b/app/static/css/allPendingForms.css @@ -107,3 +107,24 @@ a.hover_indicator:active { text-align: center !important; } +.spinner { + width: 50px; + height: 50px; + border: 5px solid #f3f3f3; + border-radius: 50%; + + border-top: 5px solid #3498db; + + + animation: spin 1s linear infinite; +} + + +@keyframes spin { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} \ No newline at end of file diff --git a/app/static/css/base.css b/app/static/css/base.css index 916fb4db9..d8050e45d 100755 --- a/app/static/css/base.css +++ b/app/static/css/base.css @@ -20,6 +20,13 @@ html, body { background-color: #275881; overflow-x: hidden; } +.bottom-clickability { + padding: 1.5rem 1.5rem !important; + width: 100% !important; + display: inline !important; + margin: 10 !important; + box-sizing: border-box !important; +} .panel-default, .panel-heading { border: none; diff --git a/app/static/js/allPendingForms.js b/app/static/js/allPendingForms.js index fda836f08..03e593aad 100644 --- a/app/static/js/allPendingForms.js +++ b/app/static/js/allPendingForms.js @@ -252,8 +252,8 @@ function resendApprovalLink(formId) { }); } -function getNotes(formId) { - $.ajax({ +function getNotes(formId, formHistoryID) { + $.ajax({ type: "GET", url: "/admin/getNotes/" + formId, datatype: "json", @@ -286,7 +286,6 @@ function getNotes(formId) { }); } - function notesInsert(textareaID, buttonID) { var formId = $("#" + textareaID).data('formId'); var laborNotes = $("#" + textareaID).val(); //this is getting the id of the labor notes text area @@ -303,7 +302,6 @@ function notesInsert(textareaID, buttonID) { e.preventDefault(); }); - $.ajax({ method: "POST", url: '/admin/notesInsert/' + formId, @@ -353,21 +351,29 @@ function clearTextArea() { //makes sure that it empties text areas and p tags wh -function loadOverloadModal(formHistoryID, laborStatusFormID) { - /* - This method sends an AJAX call to recieve data used to populate - the overload modal. - */ +function loadOverloadModal(formHistoryID) { + /* + This method resets the modal content to a loading state to prevent + displaying stale data, then fetches and renders the new form data.*/ + + $("#overloadModal").find(".modal-content").html(``); $("#overloadModal").modal("show"); - $("#overloadModal").find('.modal-content').load('/admin/overloadModal/' + formHistoryID); + $("#overloadModal").find('.modal-content').load('/admin/overloadModal/' + formHistoryID) ; + } -function loadReleaseModal(formHistoryID, laborStatusFormID) { - $("#modalRelease").modal("show"); +function loadReleaseModal(formHistoryID) { + /* + This method resets the modal content to a loading state to prevent + displaying stale data, then fetches and renders the new form data. + */ + $("#modalRelease").find(".modal-content").html(``) + $("#modalRelease").modal("show"); $("#modalRelease").find('.modal-content').load('/admin/releaseModal/' + formHistoryID); - - + } @@ -588,7 +594,6 @@ function toggleNotesLog(laborStatusFormID, formHistoryID) { } } - function notesCounter(laborStatusFormID, formHistoryID){ /* This method displays the number of admin notes a Labor @@ -604,13 +609,13 @@ function notesCounter(laborStatusFormID, formHistoryID){ success: function(response) { var viewNotesID = '#notes_' + String(formHistoryID) var modalViewNotesID = '#modalNote_' + String(formHistoryID) - $(viewNotesID).html('View Notes (' + response['noteTotal'] + ')') + $(viewNotesID).html('Notes (' + response['noteTotal'] + ')') $(modalViewNotesID).html('View Notes (' + response['noteTotal'] + ')') }, error: function(request,status,error){ console.log(request.responseText); } - }); + }); } diff --git a/app/templates/admin/allPendingForms.html b/app/templates/admin/allPendingForms.html index 5041dadab..9e13d5c89 100644 --- a/app/templates/admin/allPendingForms.html +++ b/app/templates/admin/allPendingForms.html @@ -114,7 +114,7 @@

{{title}}

{% endwith %} @@ -206,7 +206,7 @@

{{title}}