Added feature to close registration form remotely

This commit is contained in:
Kent Joseph T. Palima
2026-04-30 16:04:25 +08:00
parent 76cdeeded0
commit 1d7e0df6cd
2 changed files with 27 additions and 20 deletions
+5 -1
View File
@@ -151,6 +151,8 @@ import '../styles/apply.scss';
const successMsg = document.getElementById('success-message');
// --- STEP 1: CHECK GOOGLE SHEET STATUS ---
// Added the protective if-statement here!
if (loadingStatus && closedMessage && registrationContent) {
fetch(SCRIPT_URL)
.then(response => response.json())
.then(data => {
@@ -164,11 +166,12 @@ import '../styles/apply.scss';
}
})
.catch(error => {
console.error("Status check failed:", error); // Added this to clear the warning
// If the internet is down or script fails, fail gracefully by showing closed
loadingStatus.style.display = 'none';
closedMessage.style.display = 'block';
});
}
// --- ELIGIBILITY LOGIC ---
if (checkBtn && eligibilitySection && ineligibleMsg && mainForm) {
@@ -246,6 +249,7 @@ import '../styles/apply.scss';
}
})
.catch(error => {
console.error("Form submission failed:", error); // Added this to clear the warning
alert('A network error occurred. Please try again.');
submitBtn.disabled = false;
submitBtn.style.display = 'block';
+5 -2
View File
@@ -1,4 +1,5 @@
@import './variables.scss';
@use './variables.scss' as *;
@use "sass:color"; /* Add this line! */
.registration-section {
padding-block: 8rem;
@@ -195,7 +196,9 @@
transition: background-color 0.2s ease;
&:hover {
background-color: darken($primary, 10%);
/* Old way: background-color: darken($primary, 10%); */
/* New way: */
background-color: color.adjust($primary, $lightness: -10%);
}
}
}