Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
# Conflicts:
#	server/resource/views/doctor/appointmentList.handlebars
  • Loading branch information
NVCLong committed Dec 19, 2023
2 parents 98174ad + fdc61ac commit a33ca9d
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 67 deletions.
21 changes: 17 additions & 4 deletions server/public/css/dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ body {
font-size: medium;
text-decoration: none;
line-height: 100%;
text-align: left;
}
.site-nav ul li .nav_icon:hover, .site-nav ul li .nav_icon:focus, .site-nav ul li a:hover, .site-nav ul li a:focus {
color: #4371c5;
Expand Down Expand Up @@ -351,14 +352,25 @@ main > header {
margin: 200px 50px 350px 550px;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24);
border-radius: 8px;
width: 30%;
width: 40%;
}

fieldset {
display: block;
border: medium none !important;
margin: 0 0 10px;
min-width: 100%;
padding: 0;
padding: 10;
border-radius: 8px;
}
fieldset i {
float: left;
padding-left: 10px;
color: #999;
background: transparent;
border: none;
outline: none;
border: 2px solid rgba(255, 255, 255, 0.2);
border-radius: 8px;
}

Expand Down Expand Up @@ -458,7 +470,7 @@ fieldset {
width: 1000px;
padding: 1rem;
background: #ebecee;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.04);
box-shadow: 0 0 35px rgba(0, 0, 0, 0.04);
border-radius: 5px;
text-align: center;
font-size: 20px;
Expand All @@ -469,14 +481,15 @@ fieldset {
width: 100px;
height: 50px;
align-items: center;
margin: 0 50px 0 60px;
margin: 0 0px 0 95px;
background: #f57992;
border: none;
color: white;
text-align: center;
font-size: 20px;
border-radius: 8px;
cursor: pointer;
box-shadow: 0 0px 5px 0 rgba(0, 0, 0, 0.2), 0 0px 5px 0 rgba(0, 0, 0, 0.19);
}
.appointmentList .col .delBtn :link {
text-decoration: none;
Expand Down
24 changes: 19 additions & 5 deletions server/resource/scss/dashboard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ body {
overflow: hidden;
}
.editBtn{

i{
padding-right: 15px;
}
Expand Down Expand Up @@ -81,6 +82,7 @@ body {
font-size: medium;
text-decoration: none;
line-height: 100%;
text-align: left;

&:hover,
&:focus {
Expand Down Expand Up @@ -412,15 +414,27 @@ main {
margin: 200px 50px 350px 550px;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24);
border-radius: 8px;
width: 30%;
width: 40%;

}
fieldset {
display: block;
border: medium none !important;
margin: 0 0 10px;
min-width: 100%;
padding: 0;
padding: 10;
border-radius: 8px;

i {
float: left;
padding-left: 10px;
color: #999;
background: transparent;
border: none;
outline: none;
border: 2px solid rgba(255, 255, 255, .2);
border-radius: 8px;
}
}

#status input[type="text"],
Expand Down Expand Up @@ -470,7 +484,6 @@ fieldset {

}


#status input:focus,
#status textarea:focus {
outline: 0;
Expand Down Expand Up @@ -527,7 +540,7 @@ fieldset {
width:1000px;
padding: 1rem;
background: #ebecee;
box-shadow: 0 0 5px rgba(black, 0.04);
box-shadow: 0 0 35px rgba(black, 0.04);
border-radius: 5px;
text-align: center;
font-size: 20px;
Expand All @@ -538,14 +551,15 @@ fieldset {
width: 100px;
height: 50px;
align-items: center;
margin:0 50px 0 60px;
margin:0 0px 0 95px;
background: #f57992;
border: none;
color: white;
text-align: center;
font-size: 20px;
border-radius: 8px;
cursor: pointer;
box-shadow: 0 0px 5px 0 rgba(0,0,0,0.2), 0 0px 5px 0 rgba(0,0,0,0.19);

:link {
text-decoration: none;
Expand Down
75 changes: 17 additions & 58 deletions server/resource/views/doctor/appointmentList.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
<div class="site-wrap">
<nav class="site-nav">
<div class="name">Patient list</div>

<ul id="sidebar">

</ul>

<div class="note">
Expand All @@ -20,42 +18,21 @@
</header>

<div class="appointmentList">
<div class="col">
<div class="col">
{{#each appointment}}
<div class="item">
{{this.name}} | {{this.meetDate}} | {{this.meetTime}}
<button type="submit" class="delBtn">
<i class="fa-solid fa-user-slash"></i>
Delete</button>
</div>
</div>
<a href="" class="btn btn-link" data-toggle="modal" data-id="{{this.pId}}" data-target="#delete-course">Delete</a>
{{/each}}
</div>

</div>
</main>
</div>

<div class="modal fade" id="delete-course" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Confirm delete</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 delete ?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button id="btn-delete-course" type="button" class="btn btn-danger">Delete</button>
</div>
</div>
</div>
</main>
</div>

<form method="post" id="deleteForm"></form>

</body>

<script>
const navTabs = document.querySelectorAll("#nav-tabs > a");
Expand All @@ -68,11 +45,13 @@
});
});
let cookies = document.cookie
let ulTag = document.getElementById("sidebar")
if (cookies.includes("pId")) {
ulTag.innerHTML = ` <li class="active">
ulTag.innerHTML = `
<li class="active">
<div class="nav_icon">
<i class="fa-solid fa-bed-pulse"></i>
<a href="#">Patients</a>
Expand All @@ -88,52 +67,32 @@
</div>
<ul class="sub_nav">
<li>
</li>
</ul>
</li>`
let title = document.getElementById("title");
console.log(title);
title.innerText = "Patient";
} else {
ulTag.innerHTML = ` <li>
ulTag.innerHTML = `
<li>
<div class="nav_icon">
<i class="fa-solid fa-user-doctor"></i>
<a href="#">Doctors</a>
</div>
<div class="nav_icon">
<i class="fa-brands fa-wpforms"></i>
<a href="/doctor/inchargeform">In charge form</a>
<i class="fa-brands fa-wpforms"></i>
<a href="/doctor/inchargeform">In charge form</a>
</div>
<div class="nav_icon">
<i class="fa-solid fa-list"></i>
<a href="/doctor/getAllAppointments">Appointment list</a>
<i class="fa-solid fa-list"></i>
<a href="/doctor/getAllAppointments">Appointment list</a>
</div>
</ul>
</li>`
</li>`
let title = document.getElementById("title");
console.log(title);
title.innerText = "Doctor";
let deleteForm=document.getElementById('deleteForm')
let courseID;
//when dialog confirm click
document.addEventListener('DOMContentLoaded',function () {
$('#delete-course').on('show.bs.modal', function (event) {
let button = $(event.relatedTarget) // Button that triggered the modal
courseID = button.data('id') // Extract info from data-* attributes
})
})
const btndeletecourse=document.getElementById('btn-delete-course')
console.log(courseID)
// when delete course btn clicked
btndeletecourse.onclick=function () {
deleteForm.action = '/doctor/appointments/' + ${courseID} + '?_method=DELETE'
deleteForm.submit()
}
}
</script>
6 changes: 6 additions & 0 deletions server/resource/views/doctor/inchargeForm.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,24 @@
</header>
<form id="status" method="post" action="/doctor/inchargeForm">
<fieldset>
<i class="fa-solid fa-user"> Patient ID</i>
<input placeholder="Input patient ID" name="pId" type="text" tabindex="1" required autofocus>

</fieldset>
<fieldset>
<i class="fa-solid fa-user-doctor"> Doctor ID</i>
<input placeholder="Input doctor ID" name="dId" type="text" tabindex="1" required autofocus>
</fieldset>
<fieldset>
<i class="fa-solid fa-address-card"> Patient name</i>
<input placeholder="Input patient name" name="pName" type="text" tabindex="1" required autofocus>
</fieldset>
<fieldset>
<i class="fa-solid fa-circle-info"> Patient status</i>
<input placeholder="Input patient status" name="details" type="text" tabindex="1" required autofocus>
</fieldset>
<fieldset>
<i class="fa-regular fa-calendar-days"> Start day</i>
<input placeholder="Input patient start date" name="startDay" type="date" tabindex="1" required autofocus>
</fieldset>
<fieldset>
Expand Down

0 comments on commit a33ca9d

Please sign in to comment.