Skip to content

Commit

Permalink
Update UI, logout
Browse files Browse the repository at this point in the history
  • Loading branch information
NVCLong committed Dec 20, 2023
1 parent 71d751d commit b4b9566
Show file tree
Hide file tree
Showing 10 changed files with 335 additions and 40 deletions.
35 changes: 34 additions & 1 deletion server/resource/views/dashboard.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,28 @@
</main>
</div>

<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
Do you want to log out ?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-danger" id="logoutBTN">Log out</button>
</div>
</div>
</div>
</div>

<form id="logoutForm" method="post" action="/authentication/logout"></form>

<script>
const navTabs = document.querySelectorAll("#nav-tabs > a");
navTabs.forEach((tab) => {
Expand Down Expand Up @@ -61,6 +83,7 @@
<a href="/patient/appointments">Scheduled appointment</a>
</div>
</li>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal"> Logout</button>
</li>
`
let title = document.getElementById("title");
Expand All @@ -81,10 +104,20 @@
<i class="fa-solid fa-list"></i>
<a href="/doctor/getAllAppointments">Appointment list</a>
</div>
</li>`
<div class="nav_icon">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">Logout</button>
</div>
</li>`
let title = document.getElementById("title");
console.log(title);
title.innerText = "Doctor";
}
let logoutForm= document.getElementById("logoutForm");
let logoutBTN= document.getElementById("logoutBTN")
console.log(logoutBTN);
logoutBTN.onclick= function(){
logoutForm.submit();
}
</script>
33 changes: 32 additions & 1 deletion server/resource/views/doctor/appointmentList.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,27 @@
</div>
</main>
</div>
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
Do you want to log out ?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-danger" id="logoutBTN">Log out</button>
</div>
</div>
</div>
</div>

<form id="logoutForm" method="post" action="/authentication/logout"></form>

<script>
const navTabs = document.querySelectorAll("#nav-tabs > a");
Expand Down Expand Up @@ -65,6 +85,7 @@
<li>
</li>
</ul>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">
</li>`
let title = document.getElementById("title");
console.log(title);
Expand All @@ -84,11 +105,21 @@
<i class="fa-solid fa-list"></i>
<a href="/doctor/getAllAppointments">Appointment list</a>
</div>
</ul>
<div class="nav_icon">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">Log out</button>
</div>
</ul>
</li>`
let title = document.getElementById("title");
console.log(title);
title.innerText = "Doctor";
}
let logoutForm= document.getElementById("logoutForm");
let logoutBTN= document.getElementById("logoutBTN")
console.log(logoutBTN);
logoutBTN.onclick= function(){
logoutForm.submit();
}
</script>
32 changes: 31 additions & 1 deletion server/resource/views/doctor/inchargeForm.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
<i class="fa-solid fa-list"></i>
<a href="/doctor/getAllAppointments">Appointment List</a>
</div>
</ul>
<div class="nav_icon">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">Log out </button>
</div>
</li>

</ul>
Expand Down Expand Up @@ -68,6 +70,27 @@

</body>

<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
Do you want to log out ?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-danger" id="logoutBTN">Log out</button>
</div>
</div>
</div>
</div>

<form id="logoutForm" method="post" action="/authentication/logout"></form>

<script>
const navTabs = document.querySelectorAll("#nav-tabs > a");
Expand All @@ -80,5 +103,12 @@
});
});
let logoutForm= document.getElementById("logoutForm");
let logoutBTN= document.getElementById("logoutBTN")
console.log(logoutBTN);
logoutBTN.onclick= function(){
logoutForm.submit();
}
</script>
34 changes: 32 additions & 2 deletions server/resource/views/doctor/inchargeInformation.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
<i class="fa-solid fa-list"></i>
<a href="/doctor/getAllAppointments">Appointment List</a>
</div>
</ul>
<div> <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">Log out</button></div>

</li>

</ul>


<div class="note">
<h3>PDM Project</h3>
<p>Hospital Data Management</p>
Expand Down Expand Up @@ -73,6 +75,29 @@

</div>


<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
Do you want to log out ?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-danger" id="logoutBTN">Log out</button>
</div>
</div>
</div>
</div>

<form id="logoutForm" method="post" action="/authentication/logout"></form>

<script>
const navTabs = document.querySelectorAll("#nav-tabs > a");
navTabs.forEach((tab) => {
Expand All @@ -83,6 +108,11 @@
tab.classList.add("active");
});
});
let logoutForm= document.getElementById("logoutForm");
let logoutBTN= document.getElementById("logoutBTN")
console.log(logoutBTN);
logoutBTN.onclick= function(){
logoutForm.submit();
}
</script>
39 changes: 33 additions & 6 deletions server/resource/views/doctor/patientList.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,27 @@
</div>
</main>
</div>
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
Do you want to log out ?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-danger" id="logoutBTN">Log out</button>
</div>
</div>
</div>
</div>

<form id="logoutForm" method="post" action="/authentication/logout"></form>
<script>
const navTabs = document.querySelectorAll("#nav-tabs > a");
navTabs.forEach((tab) => {
Expand Down Expand Up @@ -63,11 +83,9 @@
<i class="fa-solid fa-calendar-check"></i>
<a href="#">Scheduled appointment</a>
</div>
<ul class="sub_nav">
<li>
</li>
</ul>
<div class="nav_icon">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">Log out</button>
</div>
</li>`
let title = document.getElementById("title");
console.log(title);
Expand All @@ -86,11 +104,20 @@
<i class="fa-solid fa-list"></i>
<a href="/doctor/getAllAppointments">Appointment list</a>
</div>
</ul>
<div class="nav_icon">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">Log out</button>
</div>
</li>`
let title = document.getElementById("title");
console.log(title);
title.innerText = "Doctor";
}
let logoutForm= document.getElementById("logoutForm");
let logoutBTN= document.getElementById("logoutBTN")
console.log(logoutBTN);
logoutBTN.onclick= function(){
logoutForm.submit();
}
</script>
47 changes: 32 additions & 15 deletions server/resource/views/doctor/updateInchargeDetails.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
<i class="fa-solid fa-list"></i>
<a href="/doctor/getAllAppointments">Appointment list</a>
</div>
</ul>
</li>
<div class="nav_icon">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">Log out</button>
</div>
</li>

</ul>

Expand All @@ -38,11 +40,33 @@
<input value="{{patient.details}}" type="text" tabindex="1" name="details" required autofocus>
<button name="submit" type="submit" id="contact-submit" data-submit="...Sending"> Submit </button>
</form>
</div>
</main>

</div>


<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
Do you want to log out ?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-danger" id="logoutBTN">Log out</button>
</div>
</div>
</div>
</div>

<form id="logoutForm" method="post" action="/authentication/logout"></form>

<script>
const navTabs = document.querySelectorAll("#nav-tabs > a");
navTabs.forEach((tab) => {
Expand All @@ -54,18 +78,11 @@
});
});
function submitPatch() {
const formData = new FormData(document.getElementById('status'));
fetch('/doctor/updateInchargeForm/{{patient.id}}', {
method: 'PATCH',
body: formData,
})
.then(() => {
// Handle successful update
})
.catch(error => {
// Handle errors
});
let logoutForm= document.getElementById("logoutForm");
let logoutBTN= document.getElementById("logoutBTN")
console.log(logoutBTN);
logoutBTN.onclick= function(){
logoutForm.submit();
}
Expand Down
Loading

0 comments on commit b4b9566

Please sign in to comment.