/home/techb158/ileadtechnology.com/SSM/public/js/utility/todo
NameSizeModeActions
edit.js49250644editdlrm
edit.js.map1530644editdlrm
index.js125240644editdlrm
index.js.map1460644editdlrm
Edit: /home/techb158/ileadtechnology.com/SSM/public/js/utility/todo/index.js (12524B)
(window.webpackJsonp=window.webpackJsonp||[]).push([[386],{"R1+T":function(t,e,o){"use strict";o.r(e);var s={components:{todoForm:o("XlOy").a},data:function(){return{todos:{total:0,data:[]},filter:{keyword:"",status:!1,start_date:"",end_date:"",sort_by:"created_at",order:"desc",page_length:helper.getConfig("page_length")},orderByOptions:[{value:"title",translation:i18n.utility.todo_title},{value:"description",translation:i18n.utility.todo_description},{value:"created_at",translation:i18n.utility.todo_date},{value:"status",translation:i18n.utility.todo_status}],showCreatePanel:!1,showFilterPanel:!1,help_topic:""}},mounted:function(){helper.hasPermission("access-todo")||(helper.notAccessibleMsg(),this.$router.push("/dashboard")),helper.featureAvailable("todo")||(helper.featureNotAvailableMsg(),this.$router.push("/dashboard")),this.getTodos()},methods:{hasPermission:function(t){return helper.hasPermission(t)},getTodos:function(t){var e=this,o=this.$loading.show();"number"!=typeof t&&(t=1),this.filter.start_date=helper.toDate(this.filter.start_date),this.filter.end_date=helper.toDate(this.filter.end_date);var s=helper.getFilterURL(this.filter);axios.get("/api/todo?page="+t+s).then((function(t){e.todos=t,o.hide()})).catch((function(t){o.hide(),helper.showErrorMsg(t)}))},editTodo:function(t){this.$router.push("/utility/todo/"+t.id+"/edit")},confirmDelete:function(t){var e=this;return function(o){return e.deleteTodo(t)}},deleteTodo:function(t){var e=this,o=this.$loading.show();axios.delete("/api/todo/"+t.id).then((function(t){toastr.success(t.message),e.getTodos(),o.hide()})).catch((function(t){o.hide(),helper.showErrorMsg(t)}))},getStatus:function(t){return t.status?''+i18n.utility.todo_complete+"":''+i18n.utility.todo_incomplete+""},toggleStatus:function(t){var e=this,o=this.$loading.show();axios.post("/api/todo/"+t.id+"/status").then((function(t){e.getTodos(),toastr.success(t.message),o.hide()})).catch((function(t){o.hide(),helper.showErrorMsg()}))}},filters:{moment:function(t){return helper.formatDate(t)},momentDateTime:function(t){return helper.formatDateTime(t)}},watch:{filter:{handler:function(t){var e=this;setTimeout((function(){e.getTodos()}),500)},deep:!0}}},a=o("KHd+"),i=Object(a.a)(s,(function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("div",{staticClass:"page-titles"},[o("div",{staticClass:"row"},[o("div",{staticClass:"col-12 col-sm-6"},[o("h3",{staticClass:"text-themecolor"},[t._v(t._s(t.trans("utility.todo"))+" \n "),t.todos.total?o("span",{staticClass:"card-subtitle d-none d-sm-inline"},[t._v(t._s(t.trans("general.total_result_found",{count:t.todos.total,from:t.todos.from,to:t.todos.to})))]):o("span",{staticClass:"card-subtitle d-none d-sm-inline"},[t._v(t._s(t.trans("general.no_result_found")))])])]),t._v(" "),o("div",{staticClass:"col-12 col-sm-6"},[o("div",{staticClass:"action-buttons pull-right"},[t.todos.total&&!t.showCreatePanel?o("button",{staticClass:"btn btn-info btn-sm",on:{click:function(e){t.showCreatePanel=!t.showCreatePanel}}},[o("i",{staticClass:"fas fa-plus"}),t._v(" "),o("span",{staticClass:"d-none d-sm-inline"},[t._v(t._s(t.trans("utility.add_new_todo")))])]):t._e(),t._v(" "),t.showFilterPanel?t._e():o("button",{staticClass:"btn btn-info btn-sm",on:{click:function(e){t.showFilterPanel=!t.showFilterPanel}}},[o("i",{staticClass:"fas fa-filter"}),t._v(" "),o("span",{staticClass:"d-none d-sm-inline"},[t._v(t._s(t.trans("general.filter")))])]),t._v(" "),o("sort-by",{attrs:{"order-by-options":t.orderByOptions,"sort-by":t.filter.sort_by,order:t.filter.order},on:{updateSortBy:function(e){t.filter.sort_by=e},updateOrder:function(e){t.filter.order=e}}}),t._v(" "),o("help-button",{on:{clicked:function(e){t.help_topic="utility.todo"}}})],1)])])]),t._v(" "),o("div",{staticClass:"container-fluid"},[o("transition",{attrs:{name:"fade"}},[t.showCreatePanel?o("div",{staticClass:"card card-form"},[o("div",{staticClass:"card-body"},[o("h4",{staticClass:"card-title"},[t._v(t._s(t.trans("utility.add_new_todo")))]),t._v(" "),o("todo-form",{on:{completed:t.getTodos,cancel:function(e){t.showCreatePanel=!t.showCreatePanel}}})],1)]):t._e()]),t._v(" "),o("transition",{attrs:{name:"fade"}},[t.showFilterPanel?o("div",{staticClass:"card card-form"},[o("div",{staticClass:"card-body"},[o("h4",{staticClass:"card-title"},[t._v(t._s(t.trans("general.filter")))]),t._v(" "),o("div",{staticClass:"row"},[o("div",{staticClass:"col-6"},[o("div",{staticClass:"form-group"},[o("label",{attrs:{for:""}},[t._v(t._s(t.trans("utility.todo_keyword")))]),t._v(" "),o("input",{directives:[{name:"model",rawName:"v-model",value:t.filter.keyword,expression:"filter.keyword"}],staticClass:"form-control",attrs:{name:"keyword"},domProps:{value:t.filter.keyword},on:{input:function(e){e.target.composing||t.$set(t.filter,"keyword",e.target.value)}}})])]),t._v(" "),o("div",{staticClass:"col-6"},[o("date-range-picker",{attrs:{"start-date":t.filter.start_date,"end-date":t.filter.end_date,label:t.trans("general.date_between")},on:{"update:startDate":function(e){return t.$set(t.filter,"start_date",e)},"update:start-date":function(e){return t.$set(t.filter,"start_date",e)},"update:endDate":function(e){return t.$set(t.filter,"end_date",e)},"update:end-date":function(e){return t.$set(t.filter,"end_date",e)}}})],1),t._v(" "),o("div",{staticClass:"col-6"},[o("div",{staticClass:"form-group"},[o("switches",{attrs:{theme:"bootstrap",color:"success"},model:{value:t.filter.status,callback:function(e){t.$set(t.filter,"status",e)},expression:"filter.status"}}),t._v(" "+t._s(t.trans("utility.todo_show_completed"))+"\n ")],1)])]),t._v(" "),o("div",{staticClass:"card-footer text-right"},[o("button",{staticClass:"btn btn-danger",attrs:{type:"button"},on:{click:function(e){t.showFilterPanel=!1}}},[t._v(t._s(t.trans("general.cancel")))])])])]):t._e()]),t._v(" "),o("div",{staticClass:"card"},[o("div",{staticClass:"card-body"},[t.todos.total?o("div",{staticClass:"table-responsive"},[o("table",{staticClass:"table table-sm"},[o("thead",[o("tr",[o("th",[t._v(t._s(t.trans("utility.todo_title")))]),t._v(" "),o("th",[t._v(t._s(t.trans("utility.todo_date")))]),t._v(" "),o("th",[t._v(t._s(t.trans("utility.todo_status")))]),t._v(" "),o("th",[t._v(t._s(t.trans("utility.todo_completed_at")))]),t._v(" "),o("th",[t._v(t._s(t.trans("utility.todo_description")))]),t._v(" "),o("th",{staticClass:"table-option"},[t._v(t._s(t.trans("general.action")))])])]),t._v(" "),o("tbody",t._l(t.todos.data,(function(e){return o("tr",[o("td",{domProps:{textContent:t._s(e.title)}}),t._v(" "),o("td",[t._v(t._s(t._f("moment")(e.date)))]),t._v(" "),o("td",{domProps:{innerHTML:t._s(t.getStatus(e))}}),t._v(" "),o("td",[t._v(t._s(t._f("momentDateTime")(e.completed_at)))]),t._v(" "),o("td",{domProps:{textContent:t._s(e.description)}}),t._v(" "),o("td",{staticClass:"table-option"},[o("div",{staticClass:"btn-group"},[o("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.status?t.trans("utility.todo_mark_as_incomplete"):t.trans("utility.todo_mark_as_complete"),expression:"todo.status ? trans('utility.todo_mark_as_incomplete') : trans('utility.todo_mark_as_complete')"}],staticClass:"btn btn-secondary btn-sm",on:{click:function(o){return o.preventDefault(),t.toggleStatus(e)}}},[o("i",{class:["fa",e.status?"fa-times":"fa-check"]})]),t._v(" "),o("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.trans("utility.edit_todo"),expression:"trans('utility.edit_todo')"}],staticClass:"btn btn-info btn-sm",on:{click:function(o){return o.preventDefault(),t.editTodo(e)}}},[o("i",{staticClass:"fas fa-edit"})]),t._v(" "),o("button",{directives:[{name:"confirm",rawName:"v-confirm",value:{ok:t.confirmDelete(e)},expression:"{ok: confirmDelete(todo)}"},{name:"tooltip",rawName:"v-tooltip",value:t.trans("utility.delete_todo"),expression:"trans('utility.delete_todo')"}],key:e.id,staticClass:"btn btn-danger btn-sm"},[o("i",{staticClass:"fas fa-trash"})])])])])})),0)])]):t._e(),t._v(" "),t.todos.total?t._e():o("module-info",{attrs:{module:"utility",title:"todo_module_title",description:"todo_module_description",icon:"list"}},[o("div",{attrs:{slot:"btn"},slot:"btn"},[t.showCreatePanel?t._e():o("button",{staticClass:"btn btn-info btn-md",on:{click:function(e){t.showCreatePanel=!t.showCreatePanel}}},[o("i",{staticClass:"fas fa-plus"}),t._v(" "+t._s(t.trans("general.add_new")))])])]),t._v(" "),o("pagination-record",{attrs:{"page-length":t.filter.page_length,records:t.todos},on:{"update:pageLength":function(e){return t.$set(t.filter,"page_length",e)},"update:page-length":function(e){return t.$set(t.filter,"page_length",e)},updateRecords:t.getTodos}})],1)])],1),t._v(" "),o("right-panel",{attrs:{topic:t.help_topic}})],1)}),[],!1,null,null,null);e.default=i.exports},XlOy:function(t,e,o){"use strict";var s={components:{},data:function(){return{todoForm:new Form({title:"",description:"",date:""})}},props:["id"],mounted:function(){this.id&&this.getTodo()},methods:{proceed:function(){this.id?this.updateTodo():this.storeTodo()},storeTodo:function(){var t=this,e=this.$loading.show();this.todoForm.post("/api/todo").then((function(o){toastr.success(o.message),t.$emit("completed"),e.hide()})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))},getTodo:function(){var t=this,e=this.$loading.show();axios.get("/api/todo/"+this.id).then((function(o){t.todoForm.title=o.title,t.todoForm.description=o.description,t.todoForm.date=o.date,e.hide()})).catch((function(o){e.hide(),helper.showErrorMsg(o),t.$router.push("/utility/todo")}))},updateTodo:function(){var t=this,e=this.$loading.show();this.todoForm.patch("/api/todo/"+this.id).then((function(o){toastr.success(o.message),e.hide(),t.$router.push("/utility/todo")})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))}}},a=o("KHd+"),i=Object(a.a)(s,(function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("form",{on:{submit:function(e){return e.preventDefault(),t.proceed(e)},keydown:function(e){return t.todoForm.errors.clear(e.target.name)}}},[o("div",{staticClass:"row"},[o("div",{staticClass:"col-12 col-sm-3"},[o("div",{staticClass:"form-group"},[o("label",{attrs:{for:""}},[t._v(t._s(t.trans("utility.todo_title")))]),t._v(" "),o("input",{directives:[{name:"model",rawName:"v-model",value:t.todoForm.title,expression:"todoForm.title"}],staticClass:"form-control",attrs:{type:"text",name:"title",placeholder:t.trans("utility.todo_title")},domProps:{value:t.todoForm.title},on:{input:function(e){e.target.composing||t.$set(t.todoForm,"title",e.target.value)}}}),t._v(" "),o("show-error",{attrs:{"form-name":t.todoForm,"prop-name":"title"}})],1)]),t._v(" "),o("div",{staticClass:"col-12 col-sm-3"},[o("div",{staticClass:"form-group"},[o("label",{attrs:{for:""}},[t._v(t._s(t.trans("utility.todo_date")))]),t._v(" "),o("datepicker",{attrs:{bootstrapStyling:!0,placeholder:t.trans("utility.todo_date")},on:{selected:function(e){return t.todoForm.errors.clear("date")}},model:{value:t.todoForm.date,callback:function(e){t.$set(t.todoForm,"date",e)},expression:"todoForm.date"}}),t._v(" "),o("show-error",{attrs:{"form-name":t.todoForm,"prop-name":"date"}})],1)]),t._v(" "),o("div",{staticClass:"col-12 col-sm-6"},[o("div",{staticClass:"form-group"},[o("label",{attrs:{for:""}},[t._v(t._s(t.trans("utility.todo_description")))]),t._v(" "),o("autosize-textarea",{attrs:{rows:"1",name:"description",placeholder:t.trans("utility.todo_description")},model:{value:t.todoForm.description,callback:function(e){t.$set(t.todoForm,"description",e)},expression:"todoForm.description"}}),t._v(" "),o("show-error",{attrs:{"form-name":t.todoForm,"prop-name":"description"}})],1)])]),t._v(" "),o("div",{staticClass:"card-footer text-right"},[o("router-link",{directives:[{name:"show",rawName:"v-show",value:t.id,expression:"id"}],staticClass:"btn btn-danger waves-effect waves-light ",attrs:{to:"/utility/todo"}},[t._v(t._s(t.trans("general.cancel")))]),t._v(" "),t.id?t._e():o("button",{staticClass:"btn btn-danger waves-effect waves-light ",attrs:{type:"button"},on:{click:function(e){return t.$emit("cancel")}}},[t._v(t._s(t.trans("general.cancel")))]),t._v(" "),o("button",{staticClass:"btn btn-info waves-effect waves-light",attrs:{type:"submit"}},[t.id?o("span",[t._v(t._s(t.trans("general.update")))]):o("span",[t._v(t._s(t.trans("general.save")))])])],1)])}),[],!1,null,null,null);e.a=i.exports}}]); //# sourceMappingURL=index.js.map?id=ca1fb8d535c37154793f