Blame view
src/pages/Dashboard/CourseDetails.vue
6.62 KB
fe15ee8b4
|
1 2 |
<template> <div> |
6f7cf8cf5
|
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
<!-- LOADER --> <div class="loader" v-if="showLoader"> <v-progress-circular indeterminate color="white"></v-progress-circular> </div> <!-- SNACKBAR --> <v-snackbar :timeout="timeout" :top="y === 'top'" :right="x === 'right'" :vertical="mode === 'vertical'" v-model="snackbar" :color="snackbarColor" > {{ text }} <v-spacer></v-spacer> <v-btn flat text @click="snackbar = false">X</v-btn> </v-snackbar> |
fe15ee8b4
|
21 |
<v-container class="pt-0"> |
f87ff3ba5
|
22 23 |
<v-layout row wrap class="mt-1"> <v-flex xs12 md8> |
fe15ee8b4
|
24 25 |
<div class="title side-bar-color font-weight-bold" |
0a5256600
|
26 |
>Welcome to the {{courseDetails[0].courseId.courseName}} Course for {{courseDetails[0].classId.classNum}} class</div> |
fe15ee8b4
|
27 28 29 30 31 |
<v-flex xs12 class="subheading mt-2"> Lorem Ipsum sdjjkhsdf sdklfjs dkfjskdjfk fjsdklf sdjfksljf sdfkls fljlkj kl jkhjkfhjksd sdfjkhsdjk fsdjkl sfkljkl ldkfjkl kjlfs dlkjlskd fljsldk fklj lksjdfljklsdj flkjs dflkjsd flkjsd lfkjsd lfjsdjf lkj kl </v-flex> |
47a8dcd38
|
32 |
|
fe15ee8b4
|
33 |
<div class="mt-5"> |
e91641fe5
|
34 |
<v-btn |
0a5256600
|
35 |
@click="$router.push({name: 'Announcement', query:{courseId: $route.query.courseId}})" |
e91641fe5
|
36 37 |
flat class="grey--text lighten-1" |
0a5256600
|
38 |
> |
40b9cb69c
|
39 40 41 |
<v-avatar size="30"> <img src="/static/icon/announcement_icon.png" alt="icon" /> </v-avatar> |
e91641fe5
|
42 43 |
<span>Announcement</span> </v-btn> |
fe15ee8b4
|
44 45 |
</div> <div> |
e91641fe5
|
46 |
<v-btn |
6f7cf8cf5
|
47 |
@click="$router.push({name: 'Course Discussion Forum', query:{courseId: $route.query.courseId}})" |
fe15ee8b4
|
48 |
class="grey--text lighten-1" |
e91641fe5
|
49 |
flat |
fe15ee8b4
|
50 |
> |
40b9cb69c
|
51 52 53 54 |
<v-avatar size="30"> <img src="/static/icon/courseDiscussion_icon.png" alt="icon" /> </v-avatar> <span>Course discussion forum</span> |
e91641fe5
|
55 |
</v-btn> |
fe15ee8b4
|
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
</div> <!-- CHAPTERS --> <v-layout column class="mt-5"> <v-flex v-for="(chapter,index) in courseDetails[0].chapters" :key="index" style="cursor: pointer;" @click="routeToChapterInfo(chapter._id)" > <v-card class="mt-2 elevation-0 card-border"> <v-container class="pt-0"> <div class="title side-bar-color font-weight-bold">{{chapter.chapterName}}</div> <div class="grey--text lighten-1 subheading">{{chapter.description}}</div> <div v-for="(point,index) in chapter.chapterPoints" :key="index" class="ml-2 mt-2" > <span class="grey--text lighten-1 subheading">{{index +1}}. {{point}}</span> </div> </v-container> </v-card> </v-flex> </v-layout> </v-flex> <v-spacer></v-spacer> |
ac24ec07a
|
82 |
|
fe15ee8b4
|
83 |
<!-- COURSES --> |
f87ff3ba5
|
84 |
<v-flex xs12 md3> |
fe15ee8b4
|
85 86 87 |
<v-card class="elevation-0 card-border" height="100%"> <v-container class="pt-0"> <div class="side-bar-color font-weight-bold title">Courses</div> |
375b62cd1
|
88 |
<div v-for="(course,index) in courseData" :key="index"> |
6f7cf8cf5
|
89 90 91 92 93 94 95 96 97 |
<v-btn flat class="subheading text-xs-start justify-left" style="cursor: pointer;" block @click="routeToCourseDetails(course._id)" > <div style="width: 100%;text-align: left;"> <v-icon style="color: red;padding-bottom: 3px;" size="15">play_arrow</v-icon> |
0a5256600
|
98 |
{{course.courseName}} |
6f7cf8cf5
|
99 100 |
</div> </v-btn> |
fe15ee8b4
|
101 102 103 104 |
</div> <!-- <v-expansion-panel focusable class="elevation-0"> <v-expansion-panel-content v-for="(item,i) in courseData" :key="i"> <template v-slot:header> |
0a5256600
|
105 |
<div class="subheading">{{item.courseName}}</div> |
fe15ee8b4
|
106 107 108 109 110 111 112 113 |
</template> </v-expansion-panel-content> </v-expansion-panel>--> </v-container> </v-card> </v-flex> </v-layout> </v-container> |
fe15ee8b4
|
114 115 116 |
</div> </template> <script> |
6f7cf8cf5
|
117 |
import AllApiCalls from "@/Services/AllApiCalls.js"; |
fe15ee8b4
|
118 119 120 |
import http from "@/Services/http.js"; import moment from "moment"; export default { |
6f7cf8cf5
|
121 |
mixins: [AllApiCalls], |
fe15ee8b4
|
122 123 124 125 126 |
data() { return { showLoader: false, courseDetails: [{ courseId: {}, classId: {} }], chapterIds: [], |
6f7cf8cf5
|
127 |
// courseData: [], |
860da881d
|
128 |
courseDataTree: [], |
fe15ee8b4
|
129 130 131 |
}; }, methods: { |
e91641fe5
|
132 |
routeToChapterInfo(selectedChapterId) { |
fe15ee8b4
|
133 134 135 136 137 138 139 |
/* set value of present chapter selected, and other chapters ids in the obj */ let obj = {}; for (var i = 0; i < this.courseDetails[0].chapters.length; i++) { obj[ this.courseDetails[0].chapters[i].chapterName ] = this.courseDetails[0].chapters[i]._id; } |
e91641fe5
|
140 |
obj.selectedChapterId = selectedChapterId; |
fe15ee8b4
|
141 |
obj.courseDetailId = this.courseDetails[0]._id; |
e91641fe5
|
142 |
obj.courseId = this.$route.query.courseId; |
fe15ee8b4
|
143 144 |
this.$router.push({ name: "Chapter Info", |
860da881d
|
145 |
query: obj, |
fe15ee8b4
|
146 |
}); |
6f7cf8cf5
|
147 148 149 150 151 152 153 |
}, async routeToCourseDetails(courseId) { /* getParticularCourseDetail- To get courseDetail - defined in GetApis.js*/ let response = await this.getParticularCourseDetail(courseId); /* If the response is null then dont route */ if (response.data.data.length > 0) { |
0b7006a1c
|
154 155 156 157 |
// REQUIRED TO WAIT FOR UPDATE CYCLE this.$nextTick(() => { // this.filters.locEmitted = "emitted"; this.$router.push({ query: { courseId: courseId } }); |
6f7cf8cf5
|
158 159 160 161 |
}); } else { this.seeSnackbar("No Data Available", "warning"); } |
860da881d
|
162 |
}, |
fe15ee8b4
|
163 |
}, |
6f7cf8cf5
|
164 |
async created() { |
860da881d
|
165 |
// console.log("its working"); |
6f7cf8cf5
|
166 167 168 169 170 |
/* getParticularCourseDetail- To get courseDetail - defined in GetApis.js*/ let response = await this.getParticularCourseDetail( this.$route.query.courseId ); this.courseDetails = response.data.data; |
860da881d
|
171 |
// console.log("its working courseDetails - ", this.courseDetails); |
fe15ee8b4
|
172 |
|
6f7cf8cf5
|
173 174 175 |
/* getStudentCourses - to get courseData - defined in GetApis.js*/ await this.getStudentCourses({ classId: localStorage.getItem("parentClassId"), |
860da881d
|
176 |
studentId: localStorage.getItem("parentStudentId"), |
6f7cf8cf5
|
177 |
}); |
860da881d
|
178 |
}, |
fe15ee8b4
|
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 |
}; </script> <style scoped> .side-bar-color { color: #827bfa !important; /* border-top-right-radius: 74px !important; */ } .card-border { border: 1px #bdbdbd solid; border-radius: 3px; } /* .v-treeview-node__toggle { color: red !important; } */ </style> |