From efc97de202d30dcca7bd1a6c6e62279688c6007e Mon Sep 17 00:00:00 2001 From: Paolo Arena Date: Fri, 10 Apr 2020 13:03:19 +0200 Subject: [PATCH] Strutturato le Traduzioni del Sito Specifico Inizio creazione di SalviamoIlPianeta.app --- src/components/CMyDashboard/CMyDashboard.vue | 2 +- src/components/CMyNave/CMyNave.ts | 4 +- src/components/CMyNave/CMyNave.vue | 2 +- src/components/CMyPage/CMyPage.ts | 4 +- .../CMyRequirement/CMyRequirement.vue | 4 +- .../CSignUpNotevole/CSignUpNotevole.ts | 10 +- .../CSignUpNotevole/CSignUpNotevole.vue | 2 +- src/components/CSignUpSIP/CSignUp-validate.ts | 43 +++ src/components/CSignUpSIP/CSignUpSIP.scss | 34 +++ src/components/CSignUpSIP/CSignUpSIP.ts | 289 ++++++++++++++++++ src/components/CSignUpSIP/CSignUpSIP.vue | 282 +++++++++++++++++ src/components/CSignUpSIP/index.ts | 1 + src/components/CStatus/CStatus.ts | 6 +- src/components/CStatus/CStatus.vue | 4 +- .../CVerifyEmail/CVerifyTelegram.vue | 8 +- .../CVerifyTelegram/CVerifyEmail.vue | 2 +- src/components/CVideoPromo/CVideoPromo.vue | 6 +- src/components/Header/Header.vue | 2 +- src/components/index.ts | 1 + src/components/logo/logo.ts | 2 +- src/model/GlobalStore.ts | 1 + src/rootgen/admin/usersList/usersList.ts | 2 + src/statics/i18n.js | 52 ++-- src/statics/lang/de.js | 3 +- src/statics/lang/enUs.js | 32 +- src/statics/lang/es.js | 29 +- src/statics/lang/fr.js | 30 +- src/statics/lang/it.js | 40 ++- src/statics/lang/pt.js | 35 +-- src/statics/lang/si.js | 39 ++- src/store/Modules/GlobalStore.ts | 4 + src/store/Modules/NotevoleStore.ts | 2 +- src/store/Modules/fieldsTable.ts | 35 +++ src/store/Modules/tools.ts | 10 +- src/views/admin/dbop/dbop.ts | 4 +- src/views/admin/dbop/dbop.vue | 7 +- src/views/login/regok/regok.vue | 2 +- src/views/login/signup_sip/signup_sip.scss | 12 + src/views/login/signup_sip/signup_sip.ts | 27 ++ src/views/login/signup_sip/signup_sip.vue | 14 + src/views/user/profile/profile.ts | 4 +- src/views/user/profile/profile.vue | 12 + 42 files changed, 923 insertions(+), 181 deletions(-) create mode 100755 src/components/CSignUpSIP/CSignUp-validate.ts create mode 100755 src/components/CSignUpSIP/CSignUpSIP.scss create mode 100755 src/components/CSignUpSIP/CSignUpSIP.ts create mode 100755 src/components/CSignUpSIP/CSignUpSIP.vue create mode 100755 src/components/CSignUpSIP/index.ts create mode 100755 src/views/login/signup_sip/signup_sip.scss create mode 100755 src/views/login/signup_sip/signup_sip.ts create mode 100755 src/views/login/signup_sip/signup_sip.vue diff --git a/src/components/CMyDashboard/CMyDashboard.vue b/src/components/CMyDashboard/CMyDashboard.vue index 85d979a..b40a9c7 100755 --- a/src/components/CMyDashboard/CMyDashboard.vue +++ b/src/components/CMyDashboard/CMyDashboard.vue @@ -163,7 +163,7 @@
-
{{$t('pages.statusreg.req9')}}
+
{{$t('pages.statusreg.req9', {sitename: $t('ws.sitename')})}}
-
TELEGRAM AYNI BOT {{$t('dialog.sendmsg')}} -> {{seluser.name }} {{ +
TELEGRAM {{$t('ws.sitename')}} BOT {{$t('dialog.sendmsg')}} -> {{seluser.name }} {{ seluser.surname }}:
`${this.title} - ${this.$t('msg.myAppName')}`, + // titleTemplate: (title) => `${this.title} - ${this.$t('ws.sitename')}`, // meta: { // keywords: { name: 'keywords', content: this.keywords }, // description: { name: 'description', content: this.description }, diff --git a/src/components/CMyRequirement/CMyRequirement.vue b/src/components/CMyRequirement/CMyRequirement.vue index f576f06..35e1dfc 100755 --- a/src/components/CMyRequirement/CMyRequirement.vue +++ b/src/components/CMyRequirement/CMyRequirement.vue @@ -11,7 +11,7 @@
-
- { + if (value === '') return true; + return axios.get(process.env.MONGODB_HOST + '/email/' + value) + .then(res => { + return (res.status !== 200) + }).catch((e) => { + return true; + }) + } + }, + password: {required, minLength: minLength(8), maxLength: maxLength(20)}, + username: { + required, minLength: minLength(6), maxLength: maxLength(20), + isUnique: value => { + if (value === '') return true; + return axios.get(process.env.MONGODB_HOST + '/users/' + value) + .then(res => { + return (res.status !== 200) + }).catch((e) => { + return true; + }) + } + }, + repeatPassword: { + sameAsPassword: sameAs('password') + }, + terms: {required}, + + } + }, */ + public env() { + return process.env + } + + public errorMsg(cosa: string, item: any) { + try { + if (!item.$error) { + return '' + } + // console.log('errorMsg', cosa, item) + if (item.$params.email && !item.email) { + return this.$t('reg.err.email') + } + + if (cosa === 'repeatpassword') { + if (!item.sameAsPassword) { + return this.$t('reg.err.sameaspassword') + } + } + + // console.log('item', item) + + if (item.minLength !== undefined) { + if (!item.minLength) { + return this.$t('reg.err.atleast') + ` ${item.$params.minLength.min} ` + this.$t('reg.err.char') + } + } + if (item.complexity !== undefined) { + if (!item.complexity) { + return this.$t('reg.err.complexity') + } + } +// if (!item.maxLength) { return this.$t('reg.err.notmore') + ` ${item.$params.maxLength.max} ` + this.$t('reg.err.char') } + + if (item.required !== undefined) { + if (!item.required) { + return this.$t('reg.err.required') + } + } + + // console.log(' ....avanti') + if (cosa === 'email') { + // console.log("EMAIL " + item.isUnique); + // console.log(item); + if (!item.isUnique) { + return this.$t('reg.err.duplicate_email') + } + } else if (cosa === 'username') { + // console.log(item); + if (!item.isUnique) { + return this.$t('reg.err.duplicate_username') + } + } else if (cosa === 'aportador_solidario') { + // console.log(item); + if (!item.aportadorexist) { + // console.log('!item.aportadorexist !') + return this.$t('reg.err.aportador_not_exist') + } + } else if ((cosa === 'name') || (cosa === 'surname')) { + // console.log(item); + } + + return '' + } catch (error) { + // console.log("ERR : " + error); + } + } + + public submitOk() { + this.$v.signup.$touch() + + this.signup.username = tools.removespaces(this.signup.username) + + this.duplicate_email = false + this.duplicate_username = false + + if (!this.signup.terms) { + tools.showNotif(this.$q, this.$t('reg.err.terms')) + return + } + + if (this.$v.signup.$error) { + tools.showNotif(this.$q, this.$t('reg.err.errore_generico')) + return + } + + this.signup.name = tools.CapitalizeAllWords(this.signup.name).trim() + this.signup.surname = tools.CapitalizeAllWords(this.signup.surname).trim() + this.signup.profile.cell = tools.removespaces(this.signup.profile.cell).trim() + this.signup.profile.intcode_cell = this.signup.profile.intcode_cell.trim() + + this.$q.loading.show({ message: this.$t('reg.incorso') }) + + console.log(this.signup) + return UserStore.actions.signup(tools.clone(this.signup)) + .then((ris) => { + if (tools.SignUpcheckErrors(this, ris.code, ris.msg)) + this.$q.loading.hide() + }).catch((error) => { + console.log('ERROR = ' + error) + this.$q.loading.hide() + }) + + } + + public intcode_change(coderec) { + // console.log('intcode', coderec) + this.signup.profile.intcode_cell = '+' + coderec.dialCode + this.signup.profile.iso2_cell = coderec.iso2 + } + + public selectcountry({ name, iso2, dialCode }) { + // console.log(name, iso2, dialCode) + this.signup.profile.nationality = iso2 + this.countryname = name + } + + public inputUsername(value) { + this.signup.username = value.trim() + } + + get nuovareg() { + return (this.signup.aportador_solidario !== tools.APORTADOR_NONE) + } + + get getplaceholdercell() { + if (this.signup.aportador_solidario !== tools.APORTADOR_NONE) + return this.$t('reg.cell') + else + return this.$t('reg.cellreg') + } + + get regvisibile() { + return true + // return this.signup.already_registered || (!this.signup.already_registered && this.signup.aportador_solidario) + } + + get gettitlereg() { + return this.$t('pages.SignUp') + } +} diff --git a/src/components/CSignUpSIP/CSignUpSIP.vue b/src/components/CSignUpSIP/CSignUpSIP.vue new file mode 100755 index 0000000..3bdf6aa --- /dev/null +++ b/src/components/CSignUpSIP/CSignUpSIP.vue @@ -0,0 +1,282 @@ + + + + diff --git a/src/components/CSignUpSIP/index.ts b/src/components/CSignUpSIP/index.ts new file mode 100755 index 0000000..be0b6e2 --- /dev/null +++ b/src/components/CSignUpSIP/index.ts @@ -0,0 +1 @@ +export {default as CSignUpSIP} from './CSignUpSIP.vue' diff --git a/src/components/CStatus/CStatus.ts b/src/components/CStatus/CStatus.ts index dcfc1a8..4bbc5a0 100755 --- a/src/components/CStatus/CStatus.ts +++ b/src/components/CStatus/CStatus.ts @@ -371,9 +371,9 @@ export default class CStatus extends MixinBase { get telegramtext() { if (this.TelegVerificato) - return this.$t('reg.telegram') + ' ' + this.$t('pages.statusreg.verified') + return this.$t('reg.telegram', {botname: this.$t('ws.botname')}) + ' ' + this.$t('pages.statusreg.verified') else - return this.$t('reg.telegram') + ' ' + this.$t('pages.statusreg.nonverified') + return this.$t('reg.telegram', {botname: this.$t('ws.botname')}) + ' ' + this.$t('pages.statusreg.nonverified') } get paymenttext() { @@ -402,7 +402,7 @@ export default class CStatus extends MixinBase { } public gettextstep(step, index) { - let tit = (index + 1) + ' - ' + this.$t(step.title) + let tit = (index + 1) + ' - ' + this.$t(step.title, {botname: this.$t('ws.botname'), sitename: this.$t('ws.sitename')}) if (step.funcok()) tit += ' ' + this.$t(step.funcok()) diff --git a/src/components/CStatus/CStatus.vue b/src/components/CStatus/CStatus.vue index 4eb5535..3147fd0 100755 --- a/src/components/CStatus/CStatus.vue +++ b/src/components/CStatus/CStatus.vue @@ -97,7 +97,7 @@
-
+
diff --git a/src/components/CVerifyEmail/CVerifyTelegram.vue b/src/components/CVerifyEmail/CVerifyTelegram.vue index bfc1645..386b994 100755 --- a/src/components/CVerifyEmail/CVerifyTelegram.vue +++ b/src/components/CVerifyEmail/CVerifyTelegram.vue @@ -9,21 +9,21 @@ -
+
{{ $t('components.authentication.telegram.open')}}
-
- {{ $t('components.authentication.telegram.ifclose')}} + {{ $t('components.authentication.telegram.ifclose', {botname: $t('ws.botname') })}}
- +
diff --git a/src/components/CVerifyTelegram/CVerifyEmail.vue b/src/components/CVerifyTelegram/CVerifyEmail.vue index 5d0faca..434aa57 100755 --- a/src/components/CVerifyTelegram/CVerifyEmail.vue +++ b/src/components/CVerifyTelegram/CVerifyEmail.vue @@ -6,7 +6,7 @@ {{ `Email ` + $t('pages.statusreg.nonverified') }} -
+
diff --git a/src/components/CVideoPromo/CVideoPromo.vue b/src/components/CVideoPromo/CVideoPromo.vue index 7caf954..f629471 100755 --- a/src/components/CVideoPromo/CVideoPromo.vue +++ b/src/components/CVideoPromo/CVideoPromo.vue @@ -1,10 +1,10 @@