/home/techb158/ileadtechnology.com/SSM/public/js/resource/lessonPlan
Edit: /home/techb158/ileadtechnology.com/SSM/public/js/resource/lessonPlan/create.js (11588B)
(window.webpackJsonp=window.webpackJsonp||[]).push([[313],{"4AD2":function(e,t,s){(e.exports=s("I1BE")(!1)).push([e.i,"\n.loading-overlay.is-full-page{\n z-index: 1060;\n}\n",""])},"79BB":function(e,t,s){"use strict";s.r(t);var a={components:{lessonPlanForm:s("NNu8").a},data:function(){return{}},mounted:function(){helper.hasPermission("create-lesson-plan")||(helper.notAccessibleMsg(),this.$router.push("/dashboard"))},methods:{},computed:{},filters:{},watch:{}},n=s("KHd+"),o=Object(n.a)(a,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("div",{staticClass:"page-titles"},[s("div",{staticClass:"row"},[s("div",{staticClass:"col-12 col-sm-6"},[s("h3",{staticClass:"text-themecolor"},[e._v(e._s(e.trans("resource.add_new_lesson_plan")))])]),e._v(" "),s("div",{staticClass:"col-12 col-sm-6"},[s("div",{staticClass:"action-buttons pull-right"},[s("button",{staticClass:"btn btn-info btn-sm",on:{click:function(t){return e.$router.push("/resource/lesson/plan")}}},[s("i",{staticClass:"fas fa-list"}),e._v(" "),s("span",{staticClass:"d-none d-sm-inline"},[e._v(e._s(e.trans("resource.lesson_plan")))])])])])])]),e._v(" "),s("div",{staticClass:"container-fluid"},[s("div",{staticClass:"card card-form"},[s("div",{staticClass:"card-body p-t-20"},[s("lesson-plan-form")],1)])])])}),[],!1,null,null,null);t.default=o.exports},NNu8:function(e,t,s){"use strict";var a={components:{},data:function(){return{lessonPlanForm:new Form({batch_id:"",subject_id:"",topic:"",start_date:"",end_date:"",details:[],upload_token:""}),batches:[],selected_batch:null,subjects:[],selected_subject:null,subject_detail:[],module_id:"",clearAttachment:!0}},props:["uuid"],mounted:function(){helper.hasPermission("create-lesson-plan")||helper.hasPermission("edit-lesson-plan")||(helper.notAccessibleMsg(),this.$router.push("/dashboard")),this.uuid?this.get():(this.addRow(),this.lessonPlanForm.upload_token=this.$uuid.v4()),this.getPreRequisite()},methods:{hasPermission:function(e){return helper.hasPermission(e)},addRow:function(){this.lessonPlanForm.details.push({title:"",description:""})},confirmDeleteDetail:function(e){var t=this;return function(s){return t.deleteDetail(e)}},deleteDetail:function(e){this.lessonPlanForm.details.splice(e,1)},getDetailTitleName:function(e){return e+"_detail_title"},getDetailDescriptionName:function(e){return e+"_detail_description"},getPreRequisite:function(){var e=this,t=this.$loading.show();axios.get("/api/lesson/plan/pre-requisite").then((function(s){e.batches=s.batches,t.hide()})).catch((function(e){t.hide(),helper.showErrorMsg(e)}))},getSubjects:function(){var e=this;this.uuid||(this.lessonPlanForm.subject_id="",this.selected_subject=null);var t=this.$loading.show();axios.post("/api/batch/"+this.lessonPlanForm.batch_id+"/subjects").then((function(s){e.subjects=s.subjects,e.subject_details=s.subject_details,t.hide()})).catch((function(e){t.hide(),helper.showErrorMsg(e)}))},proceed:function(){this.uuid?this.update():this.store()},store:function(){var e=this,t=this.$loading.show();this.lessonPlanForm.post("/api/lesson/plan").then((function(s){toastr.success(s.message),e.clearAttachment=!e.clearAttachment,e.lessonPlanForm.upload_token=e.$uuid.v4(),e.selected_batch=null,e.selected_subject=null,e.lessonPlanForm.details=[],e.addRow(),e.$emit("completed"),t.hide()})).catch((function(e){t.hide(),helper.showErrorMsg(e)}))},get:function(){var e=this,t=this.$loading.show();axios.get("/api/lesson/plan/"+this.uuid).then((function(s){var a=s.lesson_plan;e.lessonPlanForm.title=a.title,e.lessonPlanForm.topic=a.topic,e.lessonPlanForm.start_date=a.start_date,e.lessonPlanForm.end_date=a.end_date,e.lessonPlanForm.batch_id=a.subject.batch_id,e.lessonPlanForm.subject_id=a.subject_id,e.selected_batch=e.lessonPlanForm.batch_id?{id:a.subject.batch_id,name:a.subject.batch.course.name+" "+a.subject.batch.name}:null,e.selected_subject=a.subject_id?{id:a.subject_id,name:a.subject.name+" ("+a.subject.code+")"}:null,e.lessonPlanForm.upload_token=a.upload_token,a.lesson_plan_details.forEach((function(t){e.lessonPlanForm.details.push({title:t.title,description:t.description})})),e.module_id=a.id,t.hide()})).catch((function(s){t.hide(),helper.showErrorMsg(s),e.$router.push("/resource/lesson/plan")}))},update:function(){var e=this,t=this.$loading.show();this.lessonPlanForm.patch("/api/lesson/plan/"+this.uuid).then((function(s){toastr.success(s.message),t.hide(),e.$router.push("/resource/lesson/plan")})).catch((function(e){t.hide(),helper.showErrorMsg(e)}))},onBatchSelect:function(e){this.lessonPlanForm.batch_id=e.id},onSubjectSelect:function(e){this.lessonPlanForm.subject_id=e.id}},watch:{"lessonPlanForm.batch_id":function(e){e&&this.getSubjects()}}},n=(s("c221"),s("KHd+")),o=Object(n.a)(a,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("form",{on:{submit:function(t){return t.preventDefault(),e.proceed(t)},keydown:function(t){return e.lessonPlanForm.errors.clear(t.target.name)}}},[s("div",{staticClass:"row"},[s("div",{staticClass:"col-12 col-sm-3"},[s("div",{staticClass:"form-group"},[s("label",{attrs:{for:""}},[e._v(e._s(e.trans("academic.batch"))+" ")]),e._v(" "),s("v-select",{attrs:{label:"name","group-values":"batches","group-label":"course_group","group-select":!1,name:"batch_id",id:"batch_id",options:e.batches,placeholder:e.trans("academic.select_batch")},on:{select:e.onBatchSelect,close:function(t){return e.lessonPlanForm.errors.clear("batch_id")},remove:function(t){e.lessonPlanForm.batch_id=""}},model:{value:e.selected_batch,callback:function(t){e.selected_batch=t},expression:"selected_batch"}},[e.batches.length?e._e():s("div",{staticClass:"multiselect__option",attrs:{slot:"afterList"},slot:"afterList"},[e._v("\n "+e._s(e.trans("general.no_option_found"))+"\n ")])]),e._v(" "),s("show-error",{attrs:{"form-name":e.lessonPlanForm,"prop-name":"batch_id"}})],1)]),e._v(" "),s("div",{staticClass:"col-12 col-sm-3"},[e.lessonPlanForm.batch_id?s("div",{staticClass:"form-group"},[s("label",{attrs:{for:""}},[e._v(e._s(e.trans("academic.subject"))+" ")]),e._v(" "),s("v-select",{attrs:{label:"name",name:"subject_id",id:"subject_id",options:e.subjects,placeholder:e.trans("resource.select_subject")},on:{select:e.onSubjectSelect,close:function(t){return e.lessonPlanForm.errors.clear("subject_id")},remove:function(t){e.lessonPlanForm.subject_id=""}},model:{value:e.selected_subject,callback:function(t){e.selected_subject=t},expression:"selected_subject"}},[e.subjects.length?e._e():s("div",{staticClass:"multiselect__option",attrs:{slot:"afterList"},slot:"afterList"},[e._v("\n "+e._s(e.trans("general.no_option_found"))+"\n ")])]),e._v(" "),s("show-error",{attrs:{"form-name":e.lessonPlanForm,"prop-name":"subject_id"}})],1):e._e()]),e._v(" "),s("div",{staticClass:"col-12 col-sm-3"},[s("div",{staticClass:"form-group"},[s("label",{attrs:{for:""}},[e._v(e._s(e.trans("resource.lesson_plan_start_date")))]),e._v(" "),s("datepicker",{attrs:{bootstrapStyling:!0,placeholder:e.trans("resource.lesson_plan_start_date")},on:{selected:function(t){return e.lessonPlanForm.errors.clear("start_date")}},model:{value:e.lessonPlanForm.start_date,callback:function(t){e.$set(e.lessonPlanForm,"start_date",t)},expression:"lessonPlanForm.start_date"}}),e._v(" "),s("show-error",{attrs:{"form-name":e.lessonPlanForm,"prop-name":"start_date"}})],1)]),e._v(" "),s("div",{staticClass:"col-12 col-sm-3"},[s("div",{staticClass:"form-group"},[s("label",{attrs:{for:""}},[e._v(e._s(e.trans("resource.lesson_plan_end_date")))]),e._v(" "),s("datepicker",{attrs:{bootstrapStyling:!0,placeholder:e.trans("resource.lesson_plan_end_date")},on:{selected:function(t){return e.lessonPlanForm.errors.clear("end_date")}},model:{value:e.lessonPlanForm.end_date,callback:function(t){e.$set(e.lessonPlanForm,"end_date",t)},expression:"lessonPlanForm.end_date"}}),e._v(" "),s("show-error",{attrs:{"form-name":e.lessonPlanForm,"prop-name":"end_date"}})],1)])]),e._v(" "),s("div",{staticClass:"row"},[s("div",{staticClass:"col-12"},[s("div",{staticClass:"form-group"},[s("label",{attrs:{for:""}},[e._v(e._s(e.trans("resource.lesson_plan_topic")))]),e._v(" "),s("input",{directives:[{name:"model",rawName:"v-model",value:e.lessonPlanForm.topic,expression:"lessonPlanForm.topic"}],staticClass:"form-control",attrs:{type:"text",name:"topic",placeholder:e.trans("resource.lesson_plan_topic")},domProps:{value:e.lessonPlanForm.topic},on:{input:function(t){t.target.composing||e.$set(e.lessonPlanForm,"topic",t.target.value)}}}),e._v(" "),s("show-error",{attrs:{"form-name":e.lessonPlanForm,"prop-name":"topic"}})],1),e._v(" "),e._l(e.lessonPlanForm.details,(function(t,a){return[s("div",{staticClass:"row"},[s("div",{staticClass:"col-12 col-sm-6"},[s("div",{staticClass:"form-group"},[s("label",{attrs:{for:""}},[e._v(e._s(e.trans("resource.lesson_plan_detail_title"))+" \n "),s("button",{directives:[{name:"confirm",rawName:"v-confirm",value:{ok:e.confirmDeleteDetail(a)},expression:"{ok: confirmDeleteDetail(index)}"},{name:"tooltip",rawName:"v-tooltip",value:e.trans("general.delete"),expression:"trans('general.delete')"}],key:a+"_delete_detail",staticClass:"btn btn-xs btn-danger m-l-20",attrs:{type:"button"}},[s("i",{staticClass:"fas fa-times"})])]),e._v(" "),s("input",{directives:[{name:"model",rawName:"v-model",value:t.title,expression:"detail.title"}],staticClass:"form-control",attrs:{type:"text",name:e.getDetailTitleName(a),placeholder:e.trans("resource.lesson_plan_detail_title")},domProps:{value:t.title},on:{input:function(s){s.target.composing||e.$set(t,"title",s.target.value)}}}),e._v(" "),s("show-error",{attrs:{"form-name":e.lessonPlanForm,"prop-name":e.getDetailTitleName(a)}})],1)]),e._v(" "),s("div",{staticClass:"col-12 col-sm-6"},[s("div",{staticClass:"form-group"},[s("label",{attrs:{for:""}},[e._v(e._s(e.trans("resource.lesson_plan_detail_description")))]),e._v(" "),s("autosize-textarea",{attrs:{rows:"2",name:e.getDetailDescriptionName(a),placeholder:e.trans("resource.lesson_plan_detail_description")},model:{value:t.description,callback:function(s){e.$set(t,"description",s)},expression:"detail.description"}}),e._v(" "),s("show-error",{attrs:{"form-name":e.lessonPlanForm,"prop-name":e.getDetailDescriptionName(a)}})],1)])])]})),e._v(" "),s("div",{staticClass:"form-group"},[s("button",{staticClass:"btn btn-info btn-sm waves-effect waves-light",attrs:{type:"button"},on:{click:e.addRow}},[e._v(e._s(e.trans("resource.lesson_plan_add_new_detail")))])]),e._v(" "),s("div",{staticClass:"form-group"},[s("file-upload-input",{attrs:{"button-text":e.trans("general.upload_document"),token:e.lessonPlanForm.upload_token,module:"lesson_plan","clear-file":e.clearAttachment,"module-id":e.module_id}})],1)],2)]),e._v(" "),s("div",{staticClass:"card-footer text-right"},[s("router-link",{staticClass:"btn btn-danger waves-effect waves-light ",attrs:{to:"/resource/lesson/plan"}},[e._v(e._s(e.trans("general.cancel")))]),e._v(" "),s("button",{staticClass:"btn btn-info waves-effect waves-light",attrs:{type:"submit"}},[e.uuid?s("span",[e._v(e._s(e.trans("general.update")))]):s("span",[e._v(e._s(e.trans("general.save")))])])],1)])])}),[],!1,null,null,null);t.a=o.exports},OLZL:function(e,t,s){var a=s("4AD2");"string"==typeof a&&(a=[[e.i,a,""]]);var n={hmr:!0,transform:void 0,insertInto:void 0};s("aET+")(a,n);a.locals&&(e.exports=a.locals)},c221:function(e,t,s){"use strict";var a=s("OLZL");s.n(a).a}}]);
//# sourceMappingURL=create.js.map?id=fed545e9814098a22a17