Commit af6c7b97a1d209ff851e73def1c11c52e5cb907a

Authored by Shikha Mishra
1 parent 58fac10b48

add document section for pdf in course detail screen and set approprite message …

…in assignTeacher screen
src/pages/AssignTeachers.vue
... ... @@ -261,7 +261,7 @@ export default {
261 261 http()
262 262 .put("/assignTeacherToCourse", payload)
263 263 .then((response) => {
264   - console.log("===response===", response);
  264 + // console.log("===response===", response);
265 265 this.snackbar = true;
266 266 this.color = "success";
267 267 this.text = response.data.message;
... ... @@ -288,7 +288,7 @@ export default {
288 288 this.snackbar = true;
289 289 this.color = "success";
290 290 this.text = response.data.message;
291   - this.getParticularCourse();
  291 + this.getParticularCourse("noSnackbar");
292 292 })
293 293 .catch((error) => {
294 294 this.snackbar = true;
... ...
src/pages/Course/courseDetail.vue
... ... @@ -139,7 +139,7 @@
139 139 </v-flex>
140 140 <v-flex xs8 sm6 class="ml-3">
141 141 <UploadPdf
142   - @pdfFileSelected="pdfFileSelected($event,'uploadPDF')"
  142 + @pdfFileSelected="pdfFileSelected($event,'fileName')"
143 143 label="Add PDF"
144 144 reference="editPdf"
145 145 id="editPdfInput"
... ... @@ -290,11 +290,12 @@
290 290 </v-flex>
291 291 <v-flex xs8 sm6 class="ml-3">
292 292 <UploadPdf
293   - @pdfFileSelected="pdfFileSelected($event,'uploadPDF')"
  293 + @pdfFileSelected="pdfFileSelected($event,'fileName')"
294 294 label="Add PDF"
295 295 reference="newChapterPdf"
296 296 id="newChapterPdfInput"
297 297 :emptyPdf="emptyPdf"
  298 + v-model="addChapterItem.fileName"
298 299 ></UploadPdf>
299 300 </v-flex>
300 301 </v-layout>
... ... @@ -394,6 +395,45 @@
394 395 </v-flex>
395 396 </v-layout>
396 397 <!-- LINK TO PDF -->
  398 + <!-- <v-layout row justify-center v-show="editedItem.pdfFileUrl != ''">
  399 + <v-flex xs6>
  400 + <div style="width: 100%;">
  401 + <a
  402 + :href="editedItem.pdfFileUrl"
  403 + target="_blank"
  404 + style="text-decoration: none!important;"
  405 + >
  406 + <v-btn flat block>
  407 + <span>
  408 + <h5>
  409 + <b>Open PDF</b>
  410 + </h5>
  411 + </span>
  412 + </v-btn>
  413 + </a>
  414 + </div>
  415 + </v-flex>
  416 + </v-layout>-->
  417 + </v-flex>
  418 + </v-layout>
  419 + </v-container>
  420 + </v-card-text>
  421 + </v-card>
  422 + </v-dialog>
  423 +
  424 + <v-dialog v-model="viewDocument" max-width="1000" scrollable>
  425 + <v-card flat class="card-style pa-3" dark>
  426 + <v-layout>
  427 + <v-flex xs12>
  428 + <label class="title text-xs-center">View Document</label>
  429 + <v-icon size="24" class="right" @click="closeviewDocument">cancel</v-icon>
  430 + </v-flex>
  431 + </v-layout>
  432 + <v-card-text>
  433 + <v-container grid-list-md>
  434 + <v-layout wrap>
  435 + <v-flex xs12>
  436 + <!-- LINK TO PDF -->
397 437 <v-layout row justify-center v-show="editedItem.pdfFileUrl != ''">
398 438 <v-flex xs6>
399 439 <div style="width: 100%;">
... ... @@ -597,6 +637,23 @@
597 637 />
598 638 <span>Delete Chapter</span>
599 639 </v-tooltip>
  640 + <v-tooltip top>
  641 + <img
  642 + slot="activator"
  643 + style="cursor:pointer; width:20px; height:20px; "
  644 + class="mr-3"
  645 + @click="documents(props.item)"
  646 + src="/static/icon/dashboard icons-34.png"
  647 + />
  648 + <span>
  649 + <a
  650 + :href="editedItem.pdfFileUrl"
  651 + style="text-decoration: underline!important; color: white;"
  652 + >
  653 + <h5>{{editedItem.pdfFileUrl}}</h5>
  654 + </a>
  655 + </span>
  656 + </v-tooltip>
600 657 </td>
601 658 </tr>
602 659 </template>
... ... @@ -725,11 +782,12 @@
725 782 </v-flex>
726 783 <v-flex xs8 sm8 md7 class="ml-3">
727 784 <UploadPdf
728   - @pdfFileSelected="pdfFileSelected($event,'uploadPDF')"
  785 + @pdfFileSelected="pdfFileSelected($event,'fileName')"
729 786 label="Add PDF"
730 787 reference="newCoursePdf"
731 788 id="newCoursePdfInput"
732 789 :emptyPdf="emptyPdf"
  790 + v-model="addCourseDetail.fileName"
733 791 ></UploadPdf>
734 792 </v-flex>
735 793 </v-layout>
... ... @@ -813,6 +871,7 @@ export default {
813 871 editCourseDetailDialog: false,
814 872 editChapterDetailDialog: false,
815 873 viewProfileGallery: false,
  874 + viewDocument: false,
816 875 valid: true,
817 876 editLoading: false,
818 877 addclass: [],
... ... @@ -942,6 +1001,7 @@ export default {
942 1001 this.addChapterDialog = true;
943 1002 },
944 1003 submitChapter() {
  1004 + console.log("addChapterItem", this.addChapterItem);
945 1005 this.addChapterItem.chapterPoints = [];
946 1006 for (let i = 0; i < this.findsChapterPoint.length; i++) {
947 1007 this.addChapterItem.chapterPoints.push(this.findsChapterPoint[i].value);
... ... @@ -986,6 +1046,10 @@ export default {
986 1046 }
987 1047 this.editChapterDetailDialog = true;
988 1048 },
  1049 + documents(item) {
  1050 + this.editedItem = Object.assign({}, item);
  1051 + this.viewDocument = true;
  1052 + },
989 1053 deleteItem(item) {
990 1054 let deleteGallery = {
991 1055 courseDetailId: item._id,
... ... @@ -1043,6 +1107,9 @@ export default {
1043 1107 closeProfileGallery() {
1044 1108 this.viewProfileGallery = false;
1045 1109 },
  1110 + closeviewDocument() {
  1111 + this.viewDocument = false;
  1112 + },
1046 1113 submit() {
1047 1114 let chapters = [];
1048 1115 var chapterPoints = [];
... ... @@ -1054,7 +1121,7 @@ export default {
1054 1121 chapterName: this.addCourseDetail.chapterName,
1055 1122 description: this.addCourseDetail.description,
1056 1123 chapterPoints: chapterPoints,
1057   - uploadPdf: this.pdfFile,
  1124 + fileName: this.pdfFile,
1058 1125 uploadPpt: this.pptFile,
1059 1126 },
1060 1127 ];
... ... @@ -1134,7 +1201,7 @@ export default {
1134 1201 chapterName: this.editChapter.chapterName,
1135 1202 description: this.editChapter.description,
1136 1203 chapterPoints: chapterPoints,
1137   - uploadPdf: this.pdfFile,
  1204 + fileName: this.pdfFile,
1138 1205 uploadPpt: this.pptFile,
1139 1206 };
1140 1207 this.editLoading = true;
... ...