Skip to content

Commit

Permalink
Completed merge, removed useless pages, completed Therapist homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
ms@Nicro authored and ms@Nicro committed Jan 18, 2024
1 parent f501f52 commit 0a6b087
Show file tree
Hide file tree
Showing 23 changed files with 230 additions and 461 deletions.
2 changes: 1 addition & 1 deletion src/main/java/controller/Login.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private String setSessionAttributes(int id, HttpServletRequest request){
else {
session.setAttribute("type", "therapist");
session.setAttribute("surname", personalInfo.getLastname());
return "JSP/homeTherapist.jsp";
return "JSP/homepageTherapist.jsp";
}
}
}
Expand Down
43 changes: 43 additions & 0 deletions src/main/webapp/CSS/RecommendationAndConditionManager.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,47 @@ caption {
outline: none;
border-color: #145C53;
box-shadow: 0 0 5px rgba(25, 154, 142, 0.5);
}

.buttonApprove {
display: inline-block;
padding: 8px 16px;
font-size: 14px;
font-weight: bold;
text-align: center;
text-decoration: none;
cursor: pointer;
border: 2px solid #199A8E;
color: #199A8E;
background-color: transparent;
border-radius: 3px;
transition: background-color 0.3s, color 0.3s, border-color 0.3s;
margin-bottom: 5px;
}

.buttonRemove {
display: inline-block;
padding: 8px 16px;
font-size: 14px;
font-weight: bold;
text-align: center;
text-decoration: none;
cursor: pointer;
border: 2px solid #f44336;
color: #f44336;
background-color: transparent;
border-radius: 3px;
transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.buttonApprove:hover {
background-color: #199A8E;
color: #fff;
border-color: #fff;
}

.buttonRemove:hover {
background-color: #f44336;
color: #fff;
border-color: #fff;
}
4 changes: 2 additions & 2 deletions src/main/webapp/CSS/acceptanceExercisesAI.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}


table {
#aiContent table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
Expand All @@ -25,7 +25,7 @@ table {
}


th, td {
#aiContent th, td {
padding: 10px;
text-align: center;
}
Expand Down
17 changes: 16 additions & 1 deletion src/main/webapp/CSS/homepageTherapist.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ body{

#navIcons > div > img{
width: 25%;
cursor: pointer;
}

#logoIcon{
Expand All @@ -67,6 +68,7 @@ body{
display: flex;
flex-direction: column;
margin-bottom: 40%;
cursor: pointer;
}

#docIcon{
Expand Down Expand Up @@ -168,11 +170,24 @@ tr.hoverable-row:hover {
color: deepskyblue;
}

#scrollableDiv {
.scrollableDiv {
display: flex;
align-content: center;
text-align: center;
align-items: center;
justify-content: center;
flex-direction: column;
width: 100%;
max-height: 100%;
overflow-y: auto;
}

#aiContainer{
display: none;
max-height: 100%;
overflow-y: auto;
}

#NoExercise{
text-align: center;
}
10 changes: 10 additions & 0 deletions src/main/webapp/CSS/viewPatientInfo.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,13 @@
height: 90%;
width: 90%;
}

#exercisesDiv, #conditionsDiv{
max-height: 90%;
overflow: auto;
}





2 changes: 1 addition & 1 deletion src/main/webapp/JS/exercise.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function redirect(where){
if (USERTYPE === "patient"){
window.location.href = "homePagePatient.jsp";
}else if (USERTYPE === "therapist"){
window.location.href = "homeTherapist.jsp";
window.location.href = "homepageTherapist.jsp";
}
}
else{
Expand Down
35 changes: 0 additions & 35 deletions src/main/webapp/JS/homeTherapist.js

This file was deleted.

40 changes: 37 additions & 3 deletions src/main/webapp/JS/homepageTherapist.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
$(document).ready(function () {
$("#home").click(() => redirect("homepageTherapist.jsp"));
$("#iaIconSelected").hide();
$("#homeIcon").hide();

$("#home").click(() => redirect("home"));
$("#message").click(() => redirect("messageCenter.jsp"));
$("#agenda").click(() => redirect("schedule.jsp"));
$("#profile").click(() => redirect("userArea.jsp"));
$("#ia").click(() => redirect("AI"));
$("#docInfo").click(() => redirect("userArea.jsp"));


let tableContainer = $("#tableContainer");
Expand All @@ -28,6 +32,24 @@ $(document).ready(function () {
});
});

function showAI(){
$("#homeSelectedIcon").hide();
$("#homeIcon").show()
$("#aiContainer").show();
$("#tableContainer").hide();
$("#iaIcon").hide();
$("#iaIconSelected").show();
}

function hideAI(){
$("#homeSelectedIcon").show();
$("#homeIcon").hide()
$("#aiContainer").hide();
$("#tableContainer").show();
$("#iaIcon").show();
$("#iaIconSelected").hide();
}



function openInvitePopup() {
Expand All @@ -40,5 +62,17 @@ function viewPatient(i){


function redirect(where){
window.location.href = where;
if(where==="AI" || where === "home"){
let path = window.location.pathname.substring(window.location.pathname.lastIndexOf('/') + 1);
console.log(path);
if(path!=="homepageTherapist.jsp"){
window.location.href = "homepageTherapist.jsp";
}else if(where==="AI"){
showAI();
}else if(where === "home"){
hideAI();
}
}else{
window.location.href = where;
}
}
10 changes: 5 additions & 5 deletions src/main/webapp/JS/navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ const profileIconS = $("#profileIconSelected")

let USERTYPE
const page = window.location.pathname.split('/').pop()
const homePages = ["homePagePatient.jsp", "patientReport.jsp"] //TODO: Mettere le pagine da considerare "Home"
const messagePages = ["messageCenter.jsp"] //TODO: Mettere le pagine da considerare "Message"
const calendarPages = ["schedule.jsp"] //TODO: Mettere le pagine da considerare "Calendar"
const profilePages = ["userArea.jsp"] //TODO: Mettere le pagine da considerare "Profile"
const homePages = ["homePagePatient.jsp", "patientReport.jsp", "userReport.jsp"]
const messagePages = ["messageCenter.jsp"]
const calendarPages = ["schedule.jsp"]
const profilePages = ["userArea.jsp", "changePassw.jsp"]

$("document").ready(()=>{
USERTYPE = $("#userInfo").data("type");
Expand Down Expand Up @@ -60,7 +60,7 @@ function redirect(where){
if (USERTYPE === "patient"){
window.location.href = "homePagePatient.jsp";
}else if (USERTYPE === "therapist"){
window.location.href = "homeTherapist.jsp";
window.location.href = "homepageTherapist.jsp";
}
}
else{
Expand Down
34 changes: 34 additions & 0 deletions src/main/webapp/JS/viewPatientInfo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
$(document).ready(function () {
let canvas = document.getElementById('myChart');
let parentContainer = canvas.parentNode;

$("#home").click(() => redirect("homepageTherapist.jsp"));
$("#message").click(() => redirect("messageCenter.jsp"));
$("#agenda").click(() => redirect("schedule.jsp"));
$("#docInfo").click(() => redirect("userArea.jsp"));

canvas.width = parentContainer.offsetWidth;
canvas.height = parentContainer.offsetHeight;
})

function showExercises(){
$("#content").hide();
$("#conditionsDiv").hide();
$("#exercisesDiv").show();
}

function showCondition(){
$("#content").hide();
$("#exercisesDiv").hide();
$("#conditionsDiv").show();
}

function showPatient(){
$("#exercisesDiv").hide();
$("#conditionsDiv").hide();
$("#content").show();
}

function redirect(where){
window.location.href = where;
}
Loading

0 comments on commit 0a6b087

Please sign in to comment.