Merge branch 'main' of https://github.com/Newtbot/MP
This commit is contained in:
commit
638993a66a
@ -9,7 +9,7 @@ i repeat DO NOT USE CREDS IN CODE! Please use .env files (https://www.npmjs.com/
|
|||||||
1) Ti Seng
|
1) Ti Seng
|
||||||
* Webserver Microservices
|
* Webserver Microservices
|
||||||
* IoT sensor
|
* IoT sensor
|
||||||
* All Database / Backend Functions
|
* Most Database / Backend Functions of this repo
|
||||||
* consumer website api and user function
|
* consumer website api and user function
|
||||||
2) Sean
|
2) Sean
|
||||||
* Admin Website Microservice
|
* Admin Website Microservice
|
||||||
|
@ -253,4 +253,4 @@ form
|
|||||||
.top-nav .navbar-toggler:hover{
|
.top-nav .navbar-toggler:hover{
|
||||||
color: #4eae3a;
|
color: #4eae3a;
|
||||||
border-color: #4eae3a;
|
border-color: #4eae3a;
|
||||||
}
|
}
|
||||||
|
@ -256,7 +256,7 @@ app.auth = (function (app) {
|
|||||||
};
|
};
|
||||||
})(app);
|
})(app);
|
||||||
|
|
||||||
//ajax form submit
|
//ajax form submit and pass to api
|
||||||
function formAJAX(btn, del) {
|
function formAJAX(btn, del) {
|
||||||
event.preventDefault(); // avoid to execute the actual submit of the form.
|
event.preventDefault(); // avoid to execute the actual submit of the form.
|
||||||
var $form = $(btn).closest("[action]"); // gets the 'form' parent
|
var $form = $(btn).closest("[action]"); // gets the 'form' parent
|
||||||
|
@ -51,11 +51,27 @@ router.get('/news', function(req, res, next) {
|
|||||||
res.render('news');
|
res.render('news');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//learn more page
|
||||||
|
router.get('/learnmore', function(req, res, next) {
|
||||||
|
res.render('learnmore');
|
||||||
|
});
|
||||||
|
|
||||||
//login | register page
|
//login | register page
|
||||||
router.get('/login', function(req, res, next) {
|
router.get('/login', function(req, res, next) {
|
||||||
res.render('signuplogin');
|
res.render('signuplogin');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//profile page
|
||||||
|
router.get('/profile', function(req, res, next) {
|
||||||
|
res.render('profile');
|
||||||
|
});
|
||||||
|
|
||||||
|
//forgot password page
|
||||||
|
router.get('/forgotPassword', function(req, res, next) {
|
||||||
|
res.render('forgotPassword');
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
//contact page
|
//contact page
|
||||||
router.get('/contact', function(req, res, next) {
|
router.get('/contact', function(req, res, next) {
|
||||||
res.render('contact');
|
res.render('contact');
|
||||||
|
@ -85,6 +85,9 @@
|
|||||||
<!-- Bootstrap core JavaScript -->
|
<!-- Bootstrap core JavaScript -->
|
||||||
<script src="vendor/jquery/jquery.min.js"></script>
|
<script src="vendor/jquery/jquery.min.js"></script>
|
||||||
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
|
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
|
||||||
|
<script src="js/learnmore.js"></script>
|
||||||
|
<script src="js/contact.js"></script>
|
||||||
|
<script src="js/search.js"></script>
|
||||||
<script src="js/api.js"></script>
|
<script src="js/api.js"></script>
|
||||||
<script src="js/learnmore.js"></script>
|
<script src="js/learnmore.js"></script>
|
||||||
<script src="js/search.js"></script>
|
<script src="js/search.js"></script>
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
<%- include('top') %>
|
<%- include('top') %>
|
||||||
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
@ -61,4 +61,4 @@
|
|||||||
<br>
|
<br>
|
||||||
<%- include('bot') %>
|
<%- include('bot') %>
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,400;0,500;1,300&family=Source+Code+Pro:wght@300&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,400;0,500;1,300&family=Source+Code+Pro:wght@300&display=swap" rel="stylesheet">
|
||||||
|
|
||||||
|
|
||||||
<!-- jQuery library -->
|
<!-- jQuery library -->
|
||||||
<script src="https://code.jquery.com/jquery-3.7.1.min.js"
|
<script src="https://code.jquery.com/jquery-3.7.1.min.js"
|
||||||
integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
|
integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
|
||||||
@ -112,6 +111,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
@ -24,17 +24,15 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
const result = await response.json();
|
const result = await response.json();
|
||||||
|
|
||||||
// Handle the API response
|
// Handle the API response
|
||||||
//console.log(result);
|
console.log(result);
|
||||||
|
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
// Form submitted successfully, display notification
|
// Form submitted successfully, display notification
|
||||||
alert('Form submitted successfully!');
|
alert('Form submitted successfully!');
|
||||||
location.reload()
|
location.reload()
|
||||||
// You can replace the alert with your custom notification logic
|
|
||||||
} else {
|
} else {
|
||||||
// Form submission failed, display error notification
|
// Form submission failed, display error notification
|
||||||
alert('Form submission failed. Please try again.');
|
alert('Form submission failed. Please try again.');
|
||||||
// You can replace the alert with your custom error notification logic
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user