Added feature to close registration form remotely
This commit is contained in:
@@ -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';
|
||||
|
||||
@@ -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%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user