(window.webpackJsonp=window.webpackJsonp||[]).push([[117],{"7Jpt":function(t,e,a){"use strict";a.r(e);var o={components:{localeForm:a("g+gU").a},data:function(){return{id:this.$route.params.id}},mounted:function(){helper.hasPermission("access-configuration")||(helper.notAccessibleMsg(),this.$router.push("/dashboard")),helper.featureAvailable("multilingual")||(helper.featureNotAvailableMsg(),this.$router.push("/dashboard"))}},s=a("KHd+"),l=Object(s.a)(o,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"page-titles"},[a("div",{staticClass:"row"},[a("div",{staticClass:"col-12 col-sm-6"},[a("h3",{staticClass:"text-themecolor"},[t._v(t._s(t.trans("configuration.edit_locale")))])]),t._v(" "),a("div",{staticClass:"col-12 col-sm-6"},[a("div",{staticClass:"action-buttons pull-right"},[a("button",{staticClass:"btn btn-info btn-sm",on:{click:function(e){return t.$router.push("/configuration/locale")}}},[a("i",{staticClass:"fas fa-globe"}),t._v(" "),a("span",{staticClass:"d-none d-sm-inline"},[t._v(t._s(t.trans("configuration.locale")))])])])])])]),t._v(" "),a("div",{staticClass:"container-fluid"},[a("div",{staticClass:"card card-form"},[a("div",{staticClass:"card-body p-t-20"},[a("locale-form",{attrs:{id:t.id}})],1)])])])}),[],!1,null,null,null);e.default=l.exports},"g+gU":function(t,e,a){"use strict";var o={data:function(){return{localeForm:new Form({name:"",locale:""})}},props:["id"],mounted:function(){this.id&&this.getLocale()},methods:{proceed:function(){this.id?this.updateLocale():this.storeLocale()},storeLocale:function(){var t=this,e=this.$loading.show();this.localeForm.post("/api/locale").then((function(a){toastr.success(a.message),t.$emit("completed"),e.hide()})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))},getLocale:function(){var t=this,e=this.$loading.show();axios.get("/api/locale/"+this.id).then((function(a){t.localeForm.name=a.name,t.localeForm.locale=a.locale,e.hide()})).catch((function(a){e.hide(),helper.showErrorMsg(a),t.$router.push("/configuration/locale")}))},updateLocale:function(){var t=this,e=this.$loading.show();this.localeForm.patch("/api/locale/"+this.id).then((function(a){toastr.success(a.message),t.$router.push("/configuration/locale"),e.hide()})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))}}},s=a("KHd+"),l=Object(s.a)(o,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("form",{on:{submit:function(e){return e.preventDefault(),t.proceed(e)},keydown:function(e){return t.localeForm.errors.clear(e.target.name)}}},[a("div",{staticClass:"row"},[a("div",{staticClass:"col-12 col-sm-6"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[t._v(t._s(t.trans("configuration.locale_name")))]),t._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:t.localeForm.name,expression:"localeForm.name"}],staticClass:"form-control",attrs:{type:"text",name:"name",placeholder:t.trans("configuration.locale_name")},domProps:{value:t.localeForm.name},on:{input:function(e){e.target.composing||t.$set(t.localeForm,"name",e.target.value)}}}),t._v(" "),a("show-error",{attrs:{"form-name":t.localeForm,"prop-name":"name"}})],1)]),t._v(" "),a("div",{staticClass:"col-12 col-sm-6"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[t._v(t._s(t.trans("configuration.locale")))]),t._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:t.localeForm.locale,expression:"localeForm.locale"}],staticClass:"form-control",attrs:{type:"text",name:"locale",placeholder:t.trans("configuration.locale")},domProps:{value:t.localeForm.locale},on:{input:function(e){e.target.composing||t.$set(t.localeForm,"locale",e.target.value)}}}),t._v(" "),a("show-error",{attrs:{"form-name":t.localeForm,"prop-name":"locale"}})],1)])]),t._v(" "),a("div",{staticClass:"card-footer text-right"},[a("router-link",{directives:[{name:"show",rawName:"v-show",value:t.id,expression:"id"}],staticClass:"btn btn-danger waves-effect waves-light ",attrs:{to:"/configuration/locale"}},[t._v(t._s(t.trans("general.cancel")))]),t._v(" "),t.id?t._e():a("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(" "),a("button",{staticClass:"btn btn-info waves-effect waves-light",attrs:{type:"submit"}},[t.id?a("span",[t._v(t._s(t.trans("general.update")))]):a("span",[t._v(t._s(t.trans("general.save")))])])],1)])}),[],!1,null,null,null);e.a=l.exports}}]);
//# sourceMappingURL=edit.js.map?id=af83bc3c4084aee505dd