(window.webpackJsonp=window.webpackJsonp||[]).push([[128],{"L5+w":function(t,i,e){"use strict";e.r(i);var s={components:{religionForm:e("cwZy").a},data:function(){return{id:this.$route.params.id}},mounted:function(){helper.hasPermission("access-configuration")||(helper.notAccessibleMsg(),this.$router.push("/dashboard"))}},n=e("KHd+"),r=Object(n.a)(s,(function(){var t=this,i=t.$createElement,e=t._self._c||i;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("misc.edit_religion")))])]),t._v(" "),e("div",{staticClass:"col-12 col-sm-6"},[e("div",{staticClass:"action-buttons pull-right"},[e("button",{staticClass:"btn btn-info btn-sm",on:{click:function(i){return t.$router.push("/configuration/misc/religion")}}},[e("i",{staticClass:"fas fa-list"}),t._v(" "),e("span",{staticClass:"d-none d-sm-inline"},[t._v(t._s(t.trans("misc.religion")))])])])])])]),t._v(" "),e("div",{staticClass:"container-fluid"},[e("div",{staticClass:"card card-form"},[e("div",{staticClass:"card-body p-t-20"},[e("religion-form",{attrs:{id:t.id}})],1)])])])}),[],!1,null,null,null);i.default=r.exports},cwZy:function(t,i,e){"use strict";var s={data:function(){return{religionForm: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,i=this.$loading.show();this.religionForm.post("/api/misc/religion").then((function(e){toastr.success(e.message),t.$emit("completed"),i.hide()})).catch((function(t){i.hide(),helper.showErrorMsg(t)}))},get:function(){var t=this,i=this.$loading.show();axios.get("/api/misc/religion/"+this.id).then((function(e){t.religionForm.name=e.name,t.religionForm.description=e.description,i.hide()})).catch((function(e){i.hide(),helper.showErrorMsg(e),t.$router.push("/configuration/misc/religion")}))},update:function(){var t=this,i=this.$loading.show();this.religionForm.patch("/api/misc/religion/"+this.id).then((function(e){toastr.success(e.message),i.hide(),t.$router.push("/configuration/misc/religion")})).catch((function(t){i.hide(),helper.showErrorMsg(t)}))}}},n=e("KHd+"),r=Object(n.a)(s,(function(){var t=this,i=t.$createElement,e=t._self._c||i;return e("form",{on:{submit:function(i){return i.preventDefault(),t.proceed(i)},keydown:function(i){return t.religionForm.errors.clear(i.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("misc.religion_name")))]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.religionForm.name,expression:"religionForm.name"}],staticClass:"form-control",attrs:{type:"text",name:"name",placeholder:t.trans("misc.religion_name")},domProps:{value:t.religionForm.name},on:{input:function(i){i.target.composing||t.$set(t.religionForm,"name",i.target.value)}}}),t._v(" "),e("show-error",{attrs:{"form-name":t.religionForm,"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("misc.religion_description")))]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.religionForm.description,expression:"religionForm.description"}],staticClass:"form-control",attrs:{type:"text",name:"description",placeholder:t.trans("misc.religion_description")},domProps:{value:t.religionForm.description},on:{input:function(i){i.target.composing||t.$set(t.religionForm,"description",i.target.value)}}}),t._v(" "),e("show-error",{attrs:{"form-name":t.religionForm,"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/misc/religion"}},[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(i){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);i.a=r.exports}}]);
//# sourceMappingURL=edit.js.map?id=d8ffee265f3cab28950d