UNPKG

yekonga-server

Version:
2 lines (1 loc) 2.63 kB
import{H as a,g as o,o as l,c as e,m as t,q as n,h as s,v as r,t as i}from"./vendor.38a5f540.js";const c={name:"TranslatorLanguageViewComponent",computed:a({currentUser:"user"}),components:{},props:{oneLine:{type:Boolean,default:!0},isProfile:Boolean,translatorLanguageId:String},watch:{translatorLanguageId:function(a,o){this.reset(a)},"$route.params.locale":function(a,o){this.reset(a)}},created(){this.locale=this.$route.params.locale,this.translatorLanguageId&&!this.locale&&(this.locale=this.translatorLanguageId),this.fetchJson()},data:()=>({locale:null,loading:!1,formQuery:"{translatorLanguageId,locale,name,flag}",translatorLanguage:{locale:"",name:"",flag:"",translatorTranslation:[]}}),methods:{reset:function(a){this.locale=a;for(const o in this.translatorLanguage)Object.prototype.hasOwnProperty.call(this.translatorLanguage,o)&&(this.translatorLanguage[o]=null);this.locale&&this.fetchJson()},fetchJson:async function(){this.loading=!0;var a=await window.ajaxGraphql(`query {translatorLanguage(where:{locale:{equalTo:"${this.locale}"}})${this.formQuery}}`,null);if(console.log(a),a&&a.translatorLanguage){var o=a.translatorLanguage;for(const a in this.translatorLanguage)Object.prototype.hasOwnProperty.call(this.translatorLanguage,a)&&(this.translatorLanguage[a]=o[a]);this.$emit("update",this.translatorLanguage)}this.loading=!1},onUpdated:async function(a){console.log(a),this.translatorLanguage=await a}}},g={class:"main-container-middle pt-3"},u={key:1,class:"clearfix"},m={class:"d-block"},d={class:"d-block"},f={class:"d-block"};c.render=function(a,c,h,L,p,b){const y=o("processing-block");return l(),e("div",g,[p.loading?(l(),t(y,{key:0})):n("",!0),p.loading?n("",!0):(l(),e("div",u,[s("div",{class:r(["form-group form-view mx-0 mb-1",{"row g-2":h.oneLine}])},[s("label",{class:r(["form-label mb-0 py-1",{"col-auto col-form-label":h.oneLine}])},i(a.$t("translatorLanguage.locale"))+":",3),s("div",{class:r(["py-1",{col:h.oneLine}])},[s("div",m,i(p.translatorLanguage.locale),1)],2)],2),s("div",{class:r(["form-group form-view mx-0 mb-1",{"row g-2":h.oneLine}])},[s("label",{class:r(["form-label mb-0 py-1",{"col-auto col-form-label":h.oneLine}])},i(a.$t("translatorLanguage.name"))+":",3),s("div",{class:r(["py-1",{col:h.oneLine}])},[s("div",d,i(p.translatorLanguage.name),1)],2)],2),s("div",{class:r(["form-group form-view mx-0 mb-1",{"row g-2":h.oneLine}])},[s("label",{class:r(["form-label mb-0 py-1",{"col-auto col-form-label":h.oneLine}])},i(a.$t("translatorLanguage.flag"))+":",3),s("div",{class:r(["py-1",{col:h.oneLine}])},[s("span",f,i(p.translatorLanguage.flag),1)],2)],2)]))])};export{c as default};