/home/techb158/ileadtechnology.com/SSM/public/js/frontend/block
NameSizeModeActions
edit~js/-0755rm
edit.js78490644editdlrm
edit.js.map1570644editdlrm
index.js192940644editdlrm
index.js.map1500644editdlrm
Edit: /home/techb158/ileadtechnology.com/SSM/public/js/frontend/block/edit.js (7849B)
(window.webpackJsonp=window.webpackJsonp||[]).push([[241],{bHc9:function(t,e,o){"use strict";var r={components:{},data:function(){return{blockForm:new Form({title:"",is_draft:0,menu_id:"",url:"",body:"",featured_image:"",upload_token:""}),menus:[],module_id:"",image:"",clearAttachment:!0}},props:["uuid"],mounted:function(){helper.frontendConfigurationAccessible()||(helper.notAccessibleMsg(),this.$router.push("/dashboard")),this.uuid?this.get():this.blockForm.upload_token=this.$uuid.v4(),this.getPreRequisite()},methods:{hasPermission:function(t){return helper.hasPermission(t)},getPreRequisite:function(){var t=this,e=this.$loading.show();axios.get("/api/frontend/block/pre-requisite").then((function(o){t.menus=o.menus,e.hide()})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))},proceed:function(){this.uuid?this.update():this.store()},store:function(){var t=this,e=this.$loading.show();this.blockForm.post("/api/frontend/block").then((function(o){toastr.success(o.message),t.clearAttachment=!t.clearAttachment,t.blockForm.upload_token=t.$uuid.v4(),t.$emit("completed"),e.hide()})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))},get:function(){var t=this,e=this.$loading.show();axios.get("/api/frontend/block/"+this.uuid).then((function(o){t.blockForm.title=o.block.title,t.blockForm.body=o.block.body,t.blockForm.is_draft=o.block.is_draft,t.blockForm.menu_id=o.block.frontend_menu_id,t.blockForm.url=o.block.url,t.blockForm.featured_image=o.block.featured_image,t.blockForm.upload_token=o.block.upload_token,t.module_id=o.block.id,e.hide()})).catch((function(o){e.hide(),helper.showErrorMsg(o),t.$router.push("/frontend/block")}))},update:function(){var t=this,e=this.$loading.show();this.blockForm.patch("/api/frontend/block/"+this.uuid).then((function(o){toastr.success(o.message),e.hide(),t.$router.push("/frontend/block")})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))},updateImage:function(t){this.blockForm.featured_image=t}}},s=o("KHd+"),a=Object(s.a)(r,(function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("form",{on:{submit:function(e){return e.preventDefault(),t.proceed(e)},keydown:function(e){return t.blockForm.errors.clear(e.target.name)}}},[o("div",{staticClass:"row"},[o("div",{staticClass:"col-12 col-sm-6"},[o("div",{staticClass:"form-group"},[o("label",{attrs:{for:""}},[t._v(t._s(t.trans("frontend.block_title")))]),t._v(" "),o("input",{directives:[{name:"model",rawName:"v-model",value:t.blockForm.title,expression:"blockForm.title"}],staticClass:"form-control",attrs:{type:"text",name:"title",placeholder:t.trans("frontend.block_title")},domProps:{value:t.blockForm.title},on:{input:function(e){e.target.composing||t.$set(t.blockForm,"title",e.target.value)}}}),t._v(" "),o("show-error",{attrs:{"form-name":t.blockForm,"prop-name":"title"}})],1),t._v(" "),o("div",{staticClass:"form-group"},[o("label",{attrs:{for:""}},[t._v(t._s(t.trans("frontend.menu")))]),t._v(" "),o("select",{directives:[{name:"model",rawName:"v-model",value:t.blockForm.menu_id,expression:"blockForm.menu_id"}],staticClass:"custom-select col-12",attrs:{name:"menu_id"},on:{change:[function(e){var o=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(t.blockForm,"menu_id",e.target.multiple?o:o[0])},function(e){return t.blockForm.errors.clear("menu_id")}]}},[o("option",{attrs:{value:""}},[t._v(t._s(t.trans("general.select_one")))]),t._v(" "),t._l(t.menus,(function(e){return o("option",{domProps:{value:e.value}},[t._v("\n "+t._s(e.text)+"\n ")])}))],2),t._v(" "),o("show-error",{attrs:{"form-name":t.blockForm,"prop-name":"menu_id"}})],1),t._v(" "),t.blockForm.menu_id?t._e():o("div",{staticClass:"form-group"},[o("label",{attrs:{for:""}},[t._v(t._s(t.trans("frontend.block_url")))]),t._v(" "),o("input",{directives:[{name:"model",rawName:"v-model",value:t.blockForm.url,expression:"blockForm.url"}],staticClass:"form-control",attrs:{type:"text",name:"url",placeholder:t.trans("frontend.block_url")},domProps:{value:t.blockForm.url},on:{input:function(e){e.target.composing||t.$set(t.blockForm,"url",e.target.value)}}}),t._v(" "),o("show-error",{attrs:{"form-name":t.blockForm,"prop-name":"url"}})],1),t._v(" "),o("div",{staticClass:"form-group"},[o("label",{staticClass:"custom-control custom-checkbox"},[o("input",{directives:[{name:"model",rawName:"v-model",value:t.blockForm.is_draft,expression:"blockForm.is_draft"}],staticClass:"custom-control-input",attrs:{type:"checkbox",value:"1"},domProps:{checked:Array.isArray(t.blockForm.is_draft)?t._i(t.blockForm.is_draft,"1")>-1:t.blockForm.is_draft},on:{change:function(e){var o=t.blockForm.is_draft,r=e.target,s=!!r.checked;if(Array.isArray(o)){var a=t._i(o,"1");r.checked?a<0&&t.$set(t.blockForm,"is_draft",o.concat(["1"])):a>-1&&t.$set(t.blockForm,"is_draft",o.slice(0,a).concat(o.slice(a+1)))}else t.$set(t.blockForm,"is_draft",s)}}}),t._v(" "),o("span",{staticClass:"custom-control-label"},[t._v(t._s(t.trans("frontend.block_is_draft")))])])])]),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("frontend.block_body")))]),t._v(" "),o("autosize-textarea",{attrs:{rows:"4",name:"body",placeholder:t.trans("frontend.block_body")},model:{value:t.blockForm.body,callback:function(e){t.$set(t.blockForm,"body",e)},expression:"blockForm.body"}}),t._v(" "),o("show-error",{attrs:{"form-name":t.blockForm,"prop-name":"body"}})],1),t._v(" "),o("div",{staticClass:"form-group"},[o("upload-image",{attrs:{id:"block_image","button-text":t.trans("frontend.choose_featured_image"),"upload-path":"/frontend/block/featured/image","remove-path":"/frontend/block/featured/image","image-source":t.blockForm.featured_image},on:{uploaded:t.updateImage,removed:function(e){t.blockForm.featured_image=""}}})],1)])]),t._v(" "),o("div",{staticClass:"card-footer text-right"},[o("router-link",{directives:[{name:"show",rawName:"v-show",value:t.uuid,expression:"uuid"}],staticClass:"btn btn-danger waves-effect waves-light ",attrs:{to:"/frontend/block"}},[t._v(t._s(t.trans("general.cancel")))]),t._v(" "),t.uuid?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.uuid?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=a.exports},fDQB:function(t,e,o){"use strict";o.r(e);var r={components:{blockForm:o("bHc9").a},data:function(){return{uuid:this.$route.params.uuid}},mounted:function(){helper.frontendConfigurationAccessible()||(helper.notAccessibleMsg(),this.$router.push("/dashboard"))}},s=o("KHd+"),a=Object(s.a)(r,(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("frontend.edit_block")))])]),t._v(" "),o("div",{staticClass:"col-12 col-sm-6"},[o("div",{staticClass:"action-buttons pull-right"},[o("button",{staticClass:"btn btn-info btn-sm",on:{click:function(e){return t.$router.push("/frontend/block")}}},[o("i",{staticClass:"fas fa-list"}),t._v(" "),o("span",{staticClass:"d-none d-sm-inline"},[t._v(t._s(t.trans("frontend.block")))])])])])])]),t._v(" "),o("div",{staticClass:"container-fluid"},[o("div",{staticClass:"card card-form"},[o("div",{staticClass:"card-body p-t-20"},[o("block-form",{attrs:{uuid:t.uuid}})],1)])])])}),[],!1,null,null,null);e.default=a.exports}}]); //# sourceMappingURL=edit.js.map?id=9e99df3a260272e85b3b