/home/techb158/ileadtechnology.com/SSM/public/js/configuration/library/bookTopic
NameSizeModeActions
edit.js46210644editdlrm
edit.js.map1910644editdlrm
index.js105370644editdlrm
index.js.map1840644editdlrm
Edit: /home/techb158/ileadtechnology.com/SSM/public/js/configuration/library/bookTopic/index.js (10537B)
(window.webpackJsonp=window.webpackJsonp||[]).push([[115],{HkDg:function(t,o,e){"use strict";var i={data:function(){return{bookTopicForm:new Form({name:"",description:""})}},props:["id"],mounted:function(){this.id&&this.get()},methods:{proceed:function(){this.id?this.update():this.store()},store:function(){var t=this,o=this.$loading.show();this.bookTopicForm.post("/api/library/book/topic").then((function(e){toastr.success(e.message),t.$emit("completed"),o.hide()})).catch((function(t){o.hide(),helper.showErrorMsg(t)}))},get:function(){var t=this,o=this.$loading.show();axios.get("/api/library/book/topic/"+this.id).then((function(e){t.bookTopicForm.name=e.name,t.bookTopicForm.description=e.description,o.hide()})).catch((function(e){o.hide(),helper.showErrorMsg(e),t.$router.push("/configuration/library/book/topic")}))},update:function(){var t=this,o=this.$loading.show();this.bookTopicForm.patch("/api/library/book/topic/"+this.id).then((function(e){toastr.success(e.message),o.hide(),t.$router.push("/configuration/library/book/topic")})).catch((function(t){o.hide(),helper.showErrorMsg(t)}))}}},s=e("KHd+"),n=Object(s.a)(i,(function(){var t=this,o=t.$createElement,e=t._self._c||o;return e("form",{on:{submit:function(o){return o.preventDefault(),t.proceed(o)},keydown:function(o){return t.bookTopicForm.errors.clear(o.target.name)}}},[e("div",{staticClass:"row"},[e("div",{staticClass:"col-12 col-sm-6"},[e("div",{staticClass:"form-group"},[e("label",{attrs:{for:""}},[t._v(t._s(t.trans("library.book_topic_name")))]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.bookTopicForm.name,expression:"bookTopicForm.name"}],staticClass:"form-control",attrs:{type:"text",name:"name",placeholder:t.trans("library.book_topic_name")},domProps:{value:t.bookTopicForm.name},on:{input:function(o){o.target.composing||t.$set(t.bookTopicForm,"name",o.target.value)}}}),t._v(" "),e("show-error",{attrs:{"form-name":t.bookTopicForm,"prop-name":"name"}})],1)]),t._v(" "),e("div",{staticClass:"col-12 col-sm-6"},[e("div",{staticClass:"form-group"},[e("label",{attrs:{for:""}},[t._v(t._s(t.trans("library.book_topic_description")))]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.bookTopicForm.description,expression:"bookTopicForm.description"}],staticClass:"form-control",attrs:{type:"text",name:"description",placeholder:t.trans("library.book_topic_description")},domProps:{value:t.bookTopicForm.description},on:{input:function(o){o.target.composing||t.$set(t.bookTopicForm,"description",o.target.value)}}}),t._v(" "),e("show-error",{attrs:{"form-name":t.bookTopicForm,"prop-name":"description"}})],1)])]),t._v(" "),e("div",{staticClass:"card-footer text-right"},[e("router-link",{directives:[{name:"show",rawName:"v-show",value:t.id,expression:"id"}],staticClass:"btn btn-danger waves-effect waves-light ",attrs:{to:"/configuration/library/book/topic"}},[t._v(t._s(t.trans("general.cancel")))]),t._v(" "),t.id?t._e():e("button",{staticClass:"btn btn-danger waves-effect waves-light ",attrs:{type:"button"},on:{click:function(o){return t.$emit("cancel")}}},[t._v(t._s(t.trans("general.cancel")))]),t._v(" "),e("button",{staticClass:"btn btn-info waves-effect waves-light",attrs:{type:"submit"}},[t.id?e("span",[t._v(t._s(t.trans("general.update")))]):e("span",[t._v(t._s(t.trans("general.save")))])])],1)])}),[],!1,null,null,null);o.a=n.exports},or3W:function(t,o,e){"use strict";e.r(o);var i={components:{bookTopicForm:e("HkDg").a},data:function(){return{book_topics:{total:0,data:[]},filter:{sort_by:"name",order:"asc",page_length:helper.getConfig("page_length")},orderByOptions:[{value:"name",translation:i18n.library.book_topic_name}],showCreatePanel:!1,help_topic:""}},mounted:function(){helper.hasPermission("access-configuration")||(helper.notAccessibleMsg(),this.$router.push("/dashboard")),this.getBookTopics()},methods:{getConfig:function(t){return helper.getConfig(t)},getBookTopics:function(t){var o=this,e=this.$loading.show();"number"!=typeof t&&(t=1);var i=helper.getFilterURL(this.filter);axios.get("/api/library/book/topic?page="+t+i).then((function(t){o.book_topics=t,e.hide()})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))},editBookTopic:function(t){this.$router.push("/configuration/library/book/topic/"+t.id+"/edit")},confirmDelete:function(t){var o=this;return function(e){return o.deleteBookTopic(t)}},deleteBookTopic:function(t){var o=this,e=this.$loading.show();axios.delete("/api/library/book/topic/"+t.id).then((function(t){toastr.success(t.message),o.getBookTopics(),e.hide()})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))},print:function(){var t=this.$loading.show();axios.post("/api/library/book/topic/print",{filter:this.filter}).then((function(o){var e=window.open("/print");t.hide(),e.document.write(o)})).catch((function(o){t.hide(),helper.showErrorMsg(o)}))},pdf:function(){var t=this,o=this.$loading.show();axios.post("/api/library/book/topic/pdf",{filter:this.filter}).then((function(e){o.hide(),window.open("/download/report/"+e+"?token="+t.authToken)})).catch((function(t){o.hide(),helper.showErrorMsg(t)}))}},filters:{momentDateTime:function(t){return helper.formatDateTime(t)}},watch:{"filter.sort_by":function(t){this.getBookTopics()},"filter.order":function(t){this.getBookTopics()},"filter.page_length":function(t){this.getBookTopics()}},computed:{authToken:function(){return helper.getAuthToken()}}},s=e("KHd+"),n=Object(s.a)(i,(function(){var t=this,o=t.$createElement,e=t._self._c||o;return e("div",[e("div",{staticClass:"page-titles"},[e("div",{staticClass:"row"},[e("div",{staticClass:"col-12 col-sm-6"},[e("h3",{staticClass:"text-themecolor"},[t._v(t._s(t.trans("library.book_topic"))+" \n "),t.book_topics.total?e("span",{staticClass:"card-subtitle d-none d-sm-inline"},[t._v(t._s(t.trans("general.total_result_found",{count:t.book_topics.total,from:t.book_topics.from,to:t.book_topics.to})))]):e("span",{staticClass:"card-subtitle d-none d-sm-inline"},[t._v(t._s(t.trans("general.no_result_found")))])])]),t._v(" "),e("div",{staticClass:"col-12 col-sm-6"},[e("div",{staticClass:"action-buttons pull-right"},[t.book_topics.total&&!t.showCreatePanel?e("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.trans("general.add_new"),expression:"trans('general.add_new')"}],staticClass:"btn btn-info btn-sm",on:{click:function(o){t.showCreatePanel=!t.showCreatePanel}}},[e("i",{staticClass:"fas fa-plus"}),t._v(" "),e("span",{staticClass:"d-none d-sm-inline"},[t._v(t._s(t.trans("library.add_new_book_topic")))])]):t._e(),t._v(" "),e("sort-by",{attrs:{"order-by-options":t.orderByOptions,"sort-by":t.filter.sort_by,order:t.filter.order},on:{updateSortBy:function(o){t.filter.sort_by=o},updateOrder:function(o){t.filter.order=o}}}),t._v(" "),e("div",{staticClass:"btn-group"},[e("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.trans("general.more_option"),expression:"trans('general.more_option')"}],staticClass:"btn btn-info btn-sm dropdown-toggle no-caret ",attrs:{type:"button",role:"menu",id:"moreOption","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}},[e("i",{staticClass:"fas fa-ellipsis-h"}),t._v(" "),e("span",{staticClass:"d-none d-sm-inline"})]),t._v(" "),e("div",{class:["dropdown-menu","ltr"==t.getConfig("direction")?"dropdown-menu-right":""],attrs:{"aria-labelledby":"moreOption"}},[e("button",{staticClass:"dropdown-item custom-dropdown",on:{click:t.print}},[e("i",{staticClass:"fas fa-print"}),t._v(" "+t._s(t.trans("general.print")))]),t._v(" "),e("button",{staticClass:"dropdown-item custom-dropdown",on:{click:t.pdf}},[e("i",{staticClass:"fas fa-file-pdf"}),t._v(" "+t._s(t.trans("general.generate_pdf")))])])]),t._v(" "),e("help-button",{on:{clicked:function(o){t.help_topic="configuration.library.book-topic"}}})],1)])])]),t._v(" "),e("div",{staticClass:"container-fluid"},[e("transition",{attrs:{name:"fade"}},[t.showCreatePanel?e("div",{staticClass:"card card-form"},[e("div",{staticClass:"card-body"},[e("h4",{staticClass:"card-title"},[t._v(t._s(t.trans("library.add_new_book_topic")))]),t._v(" "),e("book-topic-form",{on:{completed:t.getBookTopics,cancel:function(o){t.showCreatePanel=!t.showCreatePanel}}})],1)]):t._e()]),t._v(" "),e("div",{staticClass:"card"},[e("div",{staticClass:"card-body"},[t.book_topics.total?e("div",{staticClass:"table-responsive"},[e("table",{staticClass:"table table-sm"},[e("thead",[e("tr",[e("th",[t._v(t._s(t.trans("library.book_topic_name")))]),t._v(" "),e("th",[t._v(t._s(t.trans("library.book_topic_description")))]),t._v(" "),e("th",{staticClass:"table-option"},[t._v(t._s(t.trans("general.action")))])])]),t._v(" "),e("tbody",t._l(t.book_topics.data,(function(o){return e("tr",[e("td",{domProps:{textContent:t._s(o.name)}}),t._v(" "),e("td",{domProps:{textContent:t._s(o.description)}}),t._v(" "),e("td",{staticClass:"table-option"},[e("div",{staticClass:"btn-group"},[e("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.trans("library.edit_book_topic"),expression:"trans('library.edit_book_topic')"}],staticClass:"btn btn-info btn-sm",on:{click:function(e){return e.preventDefault(),t.editBookTopic(o)}}},[e("i",{staticClass:"fas fa-edit"})]),t._v(" "),e("button",{directives:[{name:"confirm",rawName:"v-confirm",value:{ok:t.confirmDelete(o)},expression:"{ok: confirmDelete(book_topic)}"},{name:"tooltip",rawName:"v-tooltip",value:t.trans("library.delete_book_topic"),expression:"trans('library.delete_book_topic')"}],key:o.id,staticClass:"btn btn-danger btn-sm"},[e("i",{staticClass:"fas fa-trash"})])])])])})),0)])]):t._e(),t._v(" "),t.book_topics.total?t._e():e("module-info",{attrs:{module:"library",title:"book_topic_module_title",description:"book_topic_module_description",icon:"list"}},[e("div",{attrs:{slot:"btn"},slot:"btn"},[t.showCreatePanel?t._e():e("button",{staticClass:"btn btn-info btn-md",on:{click:function(o){t.showCreatePanel=!t.showCreatePanel}}},[e("i",{staticClass:"fas fa-plus"}),t._v(" "+t._s(t.trans("general.add_new")))])])]),t._v(" "),e("pagination-record",{attrs:{"page-length":t.filter.page_length,records:t.book_topics},on:{"update:pageLength":function(o){return t.$set(t.filter,"page_length",o)},"update:page-length":function(o){return t.$set(t.filter,"page_length",o)},updateRecords:t.getBookTopics},nativeOn:{change:function(o){return t.getBookTopics(o)}}})],1)])],1),t._v(" "),e("right-panel",{attrs:{topic:t.help_topic}})],1)}),[],!1,null,null,null);o.default=n.exports}}]); //# sourceMappingURL=index.js.map?id=4d18e52cc6576345da76