From 4dfee996479254283147aa209ddf06bb725a591a Mon Sep 17 00:00:00 2001 From: amber Date: Mon, 24 Aug 2020 16:13:29 +0530 Subject: [PATCH] added school events for parent --- src/pages/Dashboard/dashboard.vue | 260 ++++++++++++++++++++++++-------------- static/css/custom.css | 2 +- 2 files changed, 165 insertions(+), 97 deletions(-) diff --git a/src/pages/Dashboard/dashboard.vue b/src/pages/Dashboard/dashboard.vue index d317955..cf415d6 100644 --- a/src/pages/Dashboard/dashboard.vue +++ b/src/pages/Dashboard/dashboard.vue @@ -292,7 +292,7 @@ - + @@ -344,6 +344,7 @@ + @@ -380,8 +381,6 @@ - - + --> - + - - + + + - -

- Latest Annoucements -

+ + + Latest Announcements - - - + + +
+ - -

- Online User -

+ + + School Events +
+ + +
+
+ +
{{moment(schoolEvent.dateOfEvent).format("DD MMMM, YYYY")}}
+ +
{{schoolEvent.title}}
+
+
+
+
+

No Data Found!

+
+
+
+
+ + + + + Online user - - - + + +
@@ -936,10 +977,12 @@ export default { test(e) { console.log(" test - ", e); }, + + /*WHEN CALENDER IS CLICKED - DISPLAYS EVENTS IN DIALOG BOX */ async handleDayChanged(e) { console.log("event calender - ", e); /*the list of events that will be used in dialog box to display events */ - // this.displayEventsList = []; + this.dialogMeetingEvents = []; this.dialogSchoolEvents = []; @@ -957,9 +1000,11 @@ export default { this.dialogSchoolEvents.push(schoolEventResponse.data.data); } } - + /* Opens the dialog box */ this.viewEventDetails = true; }, + + /* see meeting events, school events individually (when calender is not clicked) */ async seeEventDetails(activity, message) { // if (this.$store.state.role === "TEACHER") { // let response = await this.getParticularMeetingEvent({ @@ -970,14 +1015,25 @@ export default { // this.viewEventDetails = true; // } if (this.$store.state.role === "PARENT") { - let response = await this.getParticularMeetingEvent({ - meetingEventId: activity.meetingEvent._id, - }); - this.displayEventsList = []; - this.displayEventsList.push(response.data.data); + if (message == "schoolEvent") { + let response = await this.getParticularSchoolEvent({ + schoolEventId: activity._id, + }); + this.displayEventsList = []; + this.displayEventsList.push(response.data.data); + } else { + let response = await this.getParticularMeetingEvent({ + meetingEventId: activity.meetingEvent._id, + }); + this.displayEventsList = []; + this.displayEventsList.push(response.data.data); + } this.viewEventDetails = true; } - if (this.$store.state.role === "ADMIN" || this.$store.state.role === "TEACHER") { + if ( + this.$store.state.role === "ADMIN" || + this.$store.state.role === "TEACHER" + ) { if (message == "schoolEvent") { let response = await this.getParticularSchoolEvent({ schoolEventId: activity._id, @@ -1208,6 +1264,8 @@ export default { this.showLoader = false; }); }, + + /* MEETING EVENTS, SCHOOL EVENTS */ async getMeetingEventes() { if (this.role == "TEACHER" || this.role === "ADMIN") { this.showLoader = true; @@ -1235,8 +1293,13 @@ export default { this.showLoader = false; }); } - /* If role is ADMIN or TEACHER then school events need to be displayed too */ - if (this.role === "ADMIN" || this.role === "TEACHER") { + /* If role is ADMIN,TEACHER, PARENT then school events need to be displayed too */ + if ( + this.role === "ADMIN" || + this.role === "TEACHER" || + this.role === "PARENT" + ) { + /* this will get data in a "schoolEvents" data property */ await this.getSchoolEventsList(); /* set schoolEvents in activityEvents array to highlight event dates in calender */ for (var i = 0; i < this.schoolEvents.length; i++) { @@ -1247,7 +1310,7 @@ export default { obj.title = this.schoolEvents[i].title; obj._id = this.schoolEvents[i]._id; obj.eventType = "schoolEvent"; - /* activityEvents is an array used to display events in calender on particular dates */ + /* activityEvents is an array used to display events in calender on particular dates */ this.activityEvents.push(obj); } } @@ -1307,12 +1370,17 @@ export default { ); obj.title = this.activityList[i].meetingEvent.title; obj._id = this.activityList[i].meetingEvent._id; + obj.eventType = "meetingEvent"; this.activityEvents.push(obj); } } /* get Latest events list for teacher login*/ - if (this.role == "TEACHER" || this.role == "ADMIN") { + if ( + this.role == "TEACHER" || + this.role == "ADMIN" || + this.role == "PARENT" + ) { await this.getMeetingEventes(); } }, diff --git a/static/css/custom.css b/static/css/custom.css index fa728eb..82e5382 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -217,7 +217,7 @@ h4 { } .account-Card { - border: 1px solid #71d9ea !important + border: 2px solid #71d9ea !important } .pink-color { -- 2.0.0