Commit 8b184d484a4e2a8e46adac10c7367028bd11aad2
1 parent
02dca9d601
Exists in
master
and in
2 other branches
added events to teacher
Showing
1 changed file
with
51 additions
and
22 deletions
Show diff stats
src/pages/Dashboard/dashboard.vue
... | ... | @@ -102,7 +102,7 @@ |
102 | 102 | <v-flex xs12 sm12 md9> |
103 | 103 | <v-container fluid grid-list-xl> |
104 | 104 | <!-- ***** Total Students ***** --> |
105 | - <!-- <v-flex xs12 sm12 md12> | |
105 | + <v-flex xs12 sm12 md12 v-if="$store.state.role == 'TEACHER' "> | |
106 | 106 | <v-layout wrap class> |
107 | 107 | <v-flex xs12 sm12 md3> |
108 | 108 | <router-link :to="{ name:'Students' }"> |
... | ... | @@ -112,9 +112,9 @@ |
112 | 112 | <v-card-title class="headline py-1 white--text">{{ students.length }}</v-card-title> |
113 | 113 | </v-card> |
114 | 114 | </router-link> |
115 | - </v-flex>--> | |
116 | - <!-- ***** Total Teachers***** --> | |
117 | - <!-- <v-flex xs12 sm12 md3> | |
115 | + </v-flex> | |
116 | + <!-- ***** Total Teachers***** --> | |
117 | + <v-flex xs12 sm12 md3> | |
118 | 118 | <router-link :to="{ name:'Teachers' }"> |
119 | 119 | <v-card flat class="card elevation-2 firozi-bgcolor"> |
120 | 120 | <v-card-title primary-title class="titleCard white--text py-3">Teachers</v-card-title> |
... | ... | @@ -123,9 +123,9 @@ |
123 | 123 | <v-card-title class="headline py-1 white--text">{{ teachers.length }}</v-card-title> |
124 | 124 | </v-card> |
125 | 125 | </router-link> |
126 | - </v-flex>--> | |
127 | - <!-- ***** Total Parents ***** --> | |
128 | - <!-- <v-flex xs12 sm12 md3> | |
126 | + </v-flex> | |
127 | + <!-- ***** Total Parents ***** --> | |
128 | + <v-flex xs12 sm12 md3> | |
129 | 129 | <router-link :to="{ name:'Parents' }"> |
130 | 130 | <v-card flat class="card yellow darken-3"> |
131 | 131 | <v-card-title primary-title class="titleCard white--text py-3">Parents</v-card-title> |
... | ... | @@ -133,9 +133,9 @@ |
133 | 133 | <v-card-title class="headline py-1 white--text">{{ parents.length }}</v-card-title> |
134 | 134 | </v-card> |
135 | 135 | </router-link> |
136 | - </v-flex>--> | |
137 | - <!-- ***** Total Class***** --> | |
138 | - <!-- <v-flex xs12 sm12 md3> | |
136 | + </v-flex> | |
137 | + <!-- ***** Total Class***** --> | |
138 | + <v-flex xs12 sm12 md3> | |
139 | 139 | <router-link :to="{ name:'Class' }"> |
140 | 140 | <v-card flat class="card darkBlue-bgcolor"> |
141 | 141 | <v-card-title primary-title class="titleCard white--text py-3">Class</v-card-title> |
... | ... | @@ -145,7 +145,7 @@ |
145 | 145 | </router-link> |
146 | 146 | </v-flex> |
147 | 147 | </v-layout> |
148 | - </v-flex>--> | |
148 | + </v-flex> | |
149 | 149 | <p |
150 | 150 | v-if="studentsData.length === 0 && role == 'PARENT'" |
151 | 151 | class="text-center title grey lighten-4 error--text" |
... | ... | @@ -418,25 +418,31 @@ |
418 | 418 | <!-- LATEST ACTIVITY --> |
419 | 419 | <v-card class="my-3 elevation-0"> |
420 | 420 | <v-card-text> |
421 | - <v-card-title class="justify-center subheading font-weight-bold">Latest Activity</v-card-title> | |
421 | + <v-card-title class="justify-center subheading font-weight-bold">Latest Events</v-card-title> | |
422 | 422 | <div |
423 | 423 | v-for="(activity,index) in activityList" |
424 | 424 | :key="index" |
425 | 425 | class="mt-2" |
426 | 426 | style="cursor: pointer;" |
427 | - @click="seeEventDetails({meetingEventId: activity.meetingEvent._id})" | |
427 | + @click="seeEventDetails(activity)" | |
428 | 428 | > |
429 | 429 | <span |
430 | 430 | :style="{ 'background-color': colorsArray[index%colorsArray.length] }" |
431 | 431 | style="height: 12px;width: 12px;border-radius: 50%;display: inline-block;vertical-align: top;" |
432 | 432 | ></span> |
433 | 433 | <div style="display: inline-block;" class="ml-2"> |
434 | - <div | |
435 | - class="grey--text lighten-1 caption" | |
436 | - v-if="activity.meetingEvent" | |
437 | - >{{moment(activity.meetingEvent.dateOfEvent).format("DD MMMM, YYYY")}}</div> | |
438 | - <div class="body-2" v-if="activity.meetingEvent">{{activity.meetingEvent.title}}</div> | |
434 | + <div v-if="$store.state.role === 'PARENT' "> | |
435 | + <div | |
436 | + class="grey--text lighten-1 caption" | |
437 | + v-if="activity.meetingEvent" | |
438 | + >{{moment(activity.meetingEvent.dateOfEvent).format("DD MMMM, YYYY")}}</div> | |
439 | + <div | |
440 | + class="body-2" | |
441 | + v-if="activity.meetingEvent" | |
442 | + >{{activity.meetingEvent.title}}</div> | |
443 | + </div> | |
439 | 444 | |
445 | + <!-- LATEST EVENTS FOR TEACHER --> | |
440 | 446 | <div v-if="role == 'TEACHER'"> |
441 | 447 | <div |
442 | 448 | class="grey--text lighten-1 caption" |
... | ... | @@ -667,9 +673,17 @@ export default { |
667 | 673 | }); |
668 | 674 | this.viewEventDetails = true; |
669 | 675 | }, |
670 | - async seeEventDetails(params) { | |
671 | - await this.getParticularMeetingEvent(params); | |
672 | - this.viewEventDetails = true; | |
676 | + async seeEventDetails(activity) { | |
677 | + if (this.$store.state.role === "TEACHER") { | |
678 | + await this.getParticularMeetingEvent({ meetingEventId: activity._id }); | |
679 | + this.viewEventDetails = true; | |
680 | + } | |
681 | + if (this.$store.state.role === "PARENT") { | |
682 | + await this.getParticularMeetingEvent({ | |
683 | + meetingEventId: activity.meetingEvent._id | |
684 | + }); | |
685 | + this.viewEventDetails = true; | |
686 | + } | |
673 | 687 | }, |
674 | 688 | async routeToCourseDetails(courseId) { |
675 | 689 | /* getParticularCourseDetail- To get courseDetail - defined in GetApis.js*/ |
... | ... | @@ -953,6 +967,17 @@ export default { |
953 | 967 | var activityList = response.data.data; |
954 | 968 | this.activityList = activityList; |
955 | 969 | this.showLoader = false; |
970 | + | |
971 | + /* set activityEvents array to highlight event dates in calender */ | |
972 | + for (var i = 0; i < this.activityList.length; i++) { | |
973 | + let obj = {}; | |
974 | + obj.date = moment(this.activityList[i].dateOfEvent).format( | |
975 | + "YYYY/MM/DD" | |
976 | + ); | |
977 | + obj.title = this.activityList[i].title; | |
978 | + obj._id = this.activityList[i]._id; | |
979 | + this.activityEvents.push(obj); | |
980 | + } | |
956 | 981 | }) |
957 | 982 | .catch(error => { |
958 | 983 | this.showLoader = false; |
... | ... | @@ -994,7 +1019,7 @@ export default { |
994 | 1019 | }, |
995 | 1020 | |
996 | 1021 | async created() { |
997 | - /* get Latest events list */ | |
1022 | + /* get Latest events list for student login*/ | |
998 | 1023 | if (this.$store.state.role != "TEACHER") { |
999 | 1024 | let response = await this.studentMeetingEvents({ |
1000 | 1025 | studentId: localStorage.getItem("parentStudentId") |
... | ... | @@ -1012,6 +1037,10 @@ export default { |
1012 | 1037 | this.activityEvents.push(obj); |
1013 | 1038 | } |
1014 | 1039 | } |
1040 | + /* get Latest events list for teacher login*/ | |
1041 | + // if(this.$store.state.role == "TEACHER"){ | |
1042 | + | |
1043 | + // } | |
1015 | 1044 | } |
1016 | 1045 | }; |
1017 | 1046 | </script> | ... | ... |