Skip to content

Commit

Permalink
change back buttons in create pages to cancel with confirmation popup
Browse files Browse the repository at this point in the history
  • Loading branch information
APandamonium1 committed Aug 11, 2024
1 parent 5306896 commit afcb81e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
Binary file modified EduSync.exe
Binary file not shown.
8 changes: 5 additions & 3 deletions templates/admin/create_instructor.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@
window.location.href = '/admin/search_instructor';
}

function goBack() {
window.history.back();
function cancelInstructor() {
if (confirm('Confirm cancel?')) {
window.location.href = '/admin/search_instructor';
}
}
</script>
</head>
Expand Down Expand Up @@ -81,7 +83,7 @@ <h1>Create New Instructor</h1>
<br>
<div class="button-container">
<button type="submit">Create Instructor</button>
<button type="button" onclick="goBack()">Back</button>
<button type="button" onclick="cancelInstructor()">Cancel</button>
</div>
</form>
</div>
Expand Down
8 changes: 5 additions & 3 deletions templates/admin/create_parent.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@
window.location.href = '/admin/search_parent';
}

function goBack() {
window.history.back();
function cancelParent() {
if (confirm('Confirm cancel?')) {
window.location.href = '/admin/search_parent';
}
}
</script>
</head>
Expand Down Expand Up @@ -68,7 +70,7 @@ <h1>Create New Parent</h1>
<br>
<div class="button-container">
<button type="submit">Create Parent</button>
<button type="button" onclick="goBack()">Back</button>
<button type="button" onclick="cancelParent()">Cancel</button>
</div>
</form>
</div>
Expand Down
8 changes: 5 additions & 3 deletions templates/admin/create_student.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@
window.location.href = '/admin/search_student';
}

function goBack() {
window.history.back();
function cancelStudent() {
if (confirm('Confirm cancel?')) {
window.location.href = '/admin/search_student';
}
}
</script>
</head>
Expand Down Expand Up @@ -94,7 +96,7 @@ <h1>Create New Student</h1>
<br>
<div class="button-container">
<button type="submit">Create Student</button>
<button type="button" onclick="goBack()">Back</button>
<button type="button" onclick="cancelStudent()">Cancel</button>
</div>
</form>
</div>
Expand Down

0 comments on commit afcb81e

Please sign in to comment.