diff --git a/src/common/pattern.ts b/src/common/pattern.ts
index 55653a5..01e1d59 100644
--- a/src/common/pattern.ts
+++ b/src/common/pattern.ts
@@ -1,19 +1,22 @@
-
export class Patterns {
- /**
- * Alphanumeric, spaces and dashes allowed. Min 2 characters length.
- */
- public static DisplayName: RegExp = /^[0-9a-zA-Z\s\-]{2,}/i
+ /**
+ * Alphanumeric, spaces and dashes allowed. Min 2 characters length.
+ */
+ public static DisplayName: RegExp = /^[0-9a-zA-Z\s\-]{2,}/i
- /**
- * Same pattern used by JQuery userName validation
- */
- public static Email: RegExp = /^((“[\w-\s]+”)|([\w-]+(?:\.[\w-]+)*)|(“[\w-\s]+”)([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}[0-9];{1,2})\]?$)/i
+ /**
+ * Same pattern used by JQuery userName validation
+ */
+ public static Email: RegExp = /^((“[\w-\s]+”)|([\w-]+(?:\.[\w-]+)*)|(“[\w-\s]+”)([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}[0-9];{1,2})\]?$)/i
- /**
- * 6 to 20 characters string with at least one digit, one upper case letter, one lower case letter and one special symbol
- */
- public static Password: RegExp = /^((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%!\-]).{6,20})/i
+ /**
+ * 6 to 20 characters string with at least one digit, one upper case letter, one lower case letter and one special symbol
+ *
+ * public static Password: RegExp = /^((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%!\-]).{6,20})/i
+ *
+ * 8 to 20 characters string with at least one digit, one upper case letter, one lower case letter and one special symbol
+ */
+ public static Password: RegExp = /^((?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,30})/i
}
diff --git a/src/common/shared_vuejs.ts b/src/common/shared_vuejs.ts
index 1b740b2..05de598 100644
--- a/src/common/shared_vuejs.ts
+++ b/src/common/shared_vuejs.ts
@@ -27,7 +27,7 @@ export const shared_consts = {
},
fieldsUserToChange() {
- return ['_id', 'username', 'email', 'cell', 'name', 'surname', 'perm', 'date_reg', 'verified_email', 'img', 'ipaddr', 'lasttimeonline', 'profile', 'news_on']
+ return ['_id', 'username', 'email', 'name', 'surname', 'perm', 'date_reg', 'verified_email', 'img', 'ipaddr', 'lasttimeonline', 'profile', 'news_on']
}
}
diff --git a/src/components/CGallery/CGallery.vue b/src/components/CGallery/CGallery.vue
index 2f5022d..bbca7dc 100644
--- a/src/components/CGallery/CGallery.vue
+++ b/src/components/CGallery/CGallery.vue
@@ -2,7 +2,7 @@
-
+
+
+
+
+
+
diff --git a/src/components/CSignIn/CSignIn.vue b/src/components/CSignIn/CSignIn.vue
index 5569740..fc030e6 100644
--- a/src/components/CSignIn/CSignIn.vue
+++ b/src/components/CSignIn/CSignIn.vue
@@ -1,73 +1,73 @@
-
-
diff --git a/src/components/CSignUp/CSignUp.ts b/src/components/CSignUp/CSignUp.ts
index 62b5f8a..0d43ce3 100644
--- a/src/components/CSignUp/CSignUp.ts
+++ b/src/components/CSignUp/CSignUp.ts
@@ -21,6 +21,7 @@ import { Logo } from '../../components/logo'
})
export default class CSignUp extends Vue {
+ @Prop({ required: false, default: false }) public adult: boolean
public $v
public $q
public $t: any
@@ -35,14 +36,23 @@ export default class CSignUp extends Vue {
surname: process.env.TEST_SURNAME || '',
password: process.env.TEST_PASSWORD || '',
repeatPassword: process.env.TEST_PASSWORD || '',
- terms: !process.env.PROD
+ terms: !process.env.PROD,
}
public created() {
this.$v.$reset()
+
+ this.signup.aportador_solidario = tools.getCookie(tools.APORTADOR_SOLIDARIO, this.$route.params.invited || process.env.TEST_APORTADOR)
+ }
+
+ @Watch('$route.params.invited')
+ public changeaportador() {
+ if (!this.signup.aportador_solidario)
+ this.signup.aportador_solidario = this.$route.params.invited
}
public mounted() {
+
}
get allowSubmit() {
diff --git a/src/components/CSignUp/CSignUp.vue b/src/components/CSignUp/CSignUp.vue
index e00243c..04de7a7 100644
--- a/src/components/CSignUp/CSignUp.vue
+++ b/src/components/CSignUp/CSignUp.vue
@@ -1,144 +1,169 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{$t('reg.submit')}}
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{$t('reg.submit')}}
+
+
+
+
+
+
+
diff --git a/src/components/Header/Header.ts b/src/components/Header/Header.ts
index ddebbf6..13a88a7 100644
--- a/src/components/Header/Header.ts
+++ b/src/components/Header/Header.ts
@@ -308,7 +308,7 @@ export default class Header extends Vue {
}
get getappname() {
- return tools.getappname(this, tools.isMobile())
+ return tools.getsuffisso() + tools.getappname(this, tools.isMobile())
}
public toggleanimation() {
@@ -368,4 +368,13 @@ export default class Header extends Vue {
this.rightDrawerOpen = false
this.$router.replace('/signup')
}
+
+ get getClassColorHeader() {
+ if (tools.isTest())
+ return 'bg-warning'
+ else if (tools.isDebug())
+ return 'bg-info'
+ else
+ return 'bg-primary'
+ }
}
diff --git a/src/components/Header/Header.vue b/src/components/Header/Header.vue
index 179127a..ac5671b 100644
--- a/src/components/Header/Header.vue
+++ b/src/components/Header/Header.vue
@@ -1,6 +1,6 @@
-
+
{{$t('reg.non_verificato')}} -->
-
-
+
+
diff --git a/src/components/index.ts b/src/components/index.ts
index b0f4929..7761371 100644
--- a/src/components/index.ts
+++ b/src/components/index.ts
@@ -35,3 +35,4 @@ export * from './CGoogleMap'
export * from './COpenStreetMap'
export * from './CTitleBanner'
export * from './CGallery'
+export * from './CProfile'
diff --git a/src/mixins/mixin-base.ts b/src/mixins/mixin-base.ts
index 0194a03..ad76c56 100644
--- a/src/mixins/mixin-base.ts
+++ b/src/mixins/mixin-base.ts
@@ -4,7 +4,7 @@ import Component from 'vue-class-component'
import { func_tools } from '../store/Modules/toolsext'
import { tools } from '../store/Modules/tools'
import { toolsext } from '@src/store/Modules/toolsext'
-import { GlobalStore } from '../store/Modules'
+import { GlobalStore, UserStore } from '../store/Modules'
import { fieldsTable } from '@src/store/Modules/fieldsTable'
import { CalendarStore } from '@store'
import MixinMetaTags from '@src/mixins/mixin-metatags'
@@ -16,6 +16,10 @@ export default class MixinBase extends MixinMetaTags {
return this
}
+ public showNotif(msg) {
+ tools.showNotif(this.$q, this.$t(msg))
+ }
+
get toolsext() {
return toolsext
}
@@ -32,57 +36,95 @@ export default class MixinBase extends MixinMetaTags {
return tools
}
- public getValDb(keystr, serv, def?) {
- const ris = GlobalStore.getters.getValueSettingsByKey(keystr, serv)
- if (ris === '')
- if (def !== undefined)
- return def
+ public getValDb(keystr, serv, def?, table?, subkey?) {
+ if (table === 'users') {
+ if (keystr === 'profile') {
+ return UserStore.state.my.profile[subkey]
+ } else {
+ return UserStore.state.my[keystr]
+ }
+ }else {
+ const ris = GlobalStore.getters.getValueSettingsByKey(keystr, serv)
+ if (ris === '')
+ if (def !== undefined)
+ return def
+ else
+ return ''
else
- return ''
- else
- return ris
+ return ris
+ }
+
}
- public async setValDb(key, value, type, serv: boolean) {
+ public async setValDb(key, value, type, serv: boolean, table?, subkey?) {
- console.log('setValDb', key, value, serv)
- GlobalStore.mutations.setValueSettingsByKey({ key, value, serv })
+ console.log('setValDb', key, value, serv, table, subkey)
+ let mydatatosave = null
+ if (table === 'users') {
+ const myid = UserStore.state.my._id
- let myrec = GlobalStore.getters.getrecSettingsByKey(key, serv)
- if (myrec === undefined) {
- myrec = {
- idapp: process.env.APP_ID,
- key,
- type
+ let myfield = {}
+
+ if (key === 'profile') {
+ UserStore.state.my.profile[subkey] = value
+ } else {
+ UserStore.state.my[key] = value
}
- myrec.serv = serv
- if (myrec.type === tools.FieldType.date)
- myrec.value_date = value
- else if (myrec.type === tools.FieldType.number)
- myrec.value_num = value
- else if (myrec.type === tools.FieldType.boolean)
- myrec.value_bool = value
- else
- myrec.value_str = value
- myrec = await tools.createNewRecord(this, 'settings', myrec).then((myrecris) => {
- // console.log('myrec')
- let recsett = null
- if (serv)
- recsett = GlobalStore.state.serv_settings
+ // Save to the DB:
+ if (subkey) {
+ myfield[key + '.' + subkey] = value
+ } else {
+ myfield[key] = value
+ }
+
+ console.log('myfield', myfield)
+
+ mydatatosave = {
+ id: myid,
+ table,
+ fieldsvalue: myfield
+ }
+
+ } else {
+ GlobalStore.mutations.setValueSettingsByKey({ key, value, serv })
+
+ let myrec = GlobalStore.getters.getrecSettingsByKey(key, serv)
+ if (myrec === undefined) {
+ myrec = {
+ idapp: process.env.APP_ID,
+ key,
+ type
+ }
+ myrec.serv = serv
+ if (myrec.type === tools.FieldType.date)
+ myrec.value_date = value
+ else if (myrec.type === tools.FieldType.number)
+ myrec.value_num = value
+ else if (myrec.type === tools.FieldType.boolean)
+ myrec.value_bool = value
else
- recsett = GlobalStore.state.settings
+ myrec.value_str = value
- recsett.push(myrecris)
- return recsett.find((rec) => rec.key === key)
- })
- }
- console.log('myrec', myrec)
+ myrec = await tools.createNewRecord(this, 'settings', myrec).then((myrecris) => {
+ // console.log('myrec')
+ let recsett = null
+ if (serv)
+ recsett = GlobalStore.state.serv_settings
+ else
+ recsett = GlobalStore.state.settings
- const mydatatosave = {
- id: myrec._id,
- table: 'settings',
- fieldsvalue: myrec
+ recsett.push(myrecris)
+ return recsett.find((rec) => rec.key === key)
+ })
+ }
+ console.log('myrec', myrec)
+
+ mydatatosave = {
+ id: myrec._id,
+ table: 'settings',
+ fieldsvalue: myrec
+ }
}
console.log('mydatatosave', mydatatosave)
diff --git a/src/model/GlobalStore.ts b/src/model/GlobalStore.ts
index 9a581d9..c1b4e15 100644
--- a/src/model/GlobalStore.ts
+++ b/src/model/GlobalStore.ts
@@ -302,6 +302,7 @@ export interface IParamDialog {
export interface IFunctionality {
PWA?: boolean
ENABLE_REGISTRATION?: boolean
+ SHOW_PROFILE?: boolean
SHOW_USER_MENU?: boolean
SHOW_IF_IS_SERVER_CONNECTION?: boolean
ENABLE_TODOS_LOADING?: boolean
diff --git a/src/model/UserStore.ts b/src/model/UserStore.ts
index 9a59682..9333b2d 100644
--- a/src/model/UserStore.ts
+++ b/src/model/UserStore.ts
@@ -11,6 +11,8 @@ export interface IUserProfile {
cell?: string
dateofbirth?: Date
sex?: ESexType
+ email_paypal?: string
+ username_telegram?: string
}
export interface IUserFields {
diff --git a/src/model/signup-option.ts b/src/model/signup-option.ts
index 44b9eb8..f535d4e 100644
--- a/src/model/signup-option.ts
+++ b/src/model/signup-option.ts
@@ -8,4 +8,5 @@ export interface ISignupOptions {
lang?: string
repeatPassword?: string
terms?: boolean
+ aportador_solidario?: string
}
diff --git a/src/statics/i18n.js b/src/statics/i18n.js
index c578b6c..7479f83 100644
--- a/src/statics/i18n.js
+++ b/src/statics/i18n.js
@@ -105,11 +105,14 @@ const msgglobal = {
options: 'Opzioni',
},
reg: {
+ aportador_solidario: 'Chi ti ha Invitato',
page_title: 'Registrazione',
incorso: 'Registrazione in corso...',
richiesto: 'Campo Richiesto',
email: 'Email',
cell: 'Telefono',
+ email_paypal: 'Email Paypal',
+ username_telegram: 'Username Telegram',
img: 'Immagine',
date_reg: 'Data Reg.',
perm: 'Permessi',
@@ -120,6 +123,7 @@ const msgglobal = {
password: 'Password',
repeatPassword: 'Ripeti password',
terms: "Accetto i termini e le condizioni",
+ onlyadult: "Confermo di essere Maggiorenne",
submit: "Registrati",
title_verif_reg: "Verifica Registrazione",
verificato: "Verificato",
@@ -130,7 +134,8 @@ const msgglobal = {
email: 'inserire una email valida',
errore_generico: 'Si prega di compilare correttamente i campi',
atleast: 'dev\'essere lungo almeno di',
- complexity: 'deve contenere almeno 1 minuscola, 1 maiuscola, 1 cifra e 1 carattere speciale (!,$,#,%,-) ',
+ // complexity: 'deve contenere almeno 1 minuscola, 1 maiuscola, 1 cifra e 1 carattere speciale (!,$,#,%,-) ',
+ complexity: 'deve contenere almeno 1 minuscola, 1 maiuscola, 1 cifra',
notmore: 'non dev\'essere lungo più di',
char: 'caratteri',
terms: 'Devi accettare le condizioni, per continuare.',
@@ -469,11 +474,14 @@ const msgglobal = {
options: 'Opciones',
},
reg: {
+ aportador_solidario: 'Aportador Solidario',
page_title: 'Registro',
incorso: 'Registro en curso...',
richiesto: 'Campo requerido',
email: 'Email',
cell: 'Móvil',
+ email_paypal: 'Email Paypal',
+ username_telegram: 'Usuario Telegram',
img: 'File image',
date_reg: 'Fecha Reg.',
perm: 'Permisos',
@@ -484,6 +492,7 @@ const msgglobal = {
password: 'contraseña',
repeatPassword: 'Repetir contraseña',
terms: "Acepto los términos y condiciones",
+ onlyadult: "Confirmo que soy mayor de edad",
submit: "Registrarse",
title_verif_reg: "Verifica registro",
verificato: "Verificado",
@@ -494,7 +503,7 @@ const msgglobal = {
email: 'Debe ser una email válida.',
errore_generico: 'Por favor, rellene los campos correctamente',
atleast: 'debe ser al menos largo',
- complexity: 'debe contener al menos 1 minúscula, 1 mayúscula, 1 dígito y 1 caractér especial (!,$,#,%,-)',
+ complexity: 'debe contener al menos 1 minúscula, 1 mayúscula, 1 dígito',
notmore: 'no tiene que ser más largo que',
char: 'caracteres',
terms: 'Debes aceptar las condiciones, para continuar..',
@@ -824,10 +833,13 @@ const msgglobal = {
options: 'Options',
},
reg: {
+ aportador_solidario: 'Contributeur de solidarité',
incorso: 'Inscription en cours...',
richiesto: 'Champ obligatoire',
email: 'Email',
cell: 'Téléphone',
+ email_paypal: 'Email Paypal',
+ username_telegram: 'Nom d\'utilisateur du Telegram',
img: 'Fichier image',
date_reg: 'Date Inscript.',
perm: 'Autorisations',
@@ -838,6 +850,7 @@ const msgglobal = {
password: 'mot de passe',
repeatPassword: 'Répéter le mot de passe',
terms: "J'accepte les termes et conditions",
+ onlyadult: "Je confirme que je suis majeur",
submit: "S'inscrire",
title_verif_reg: "Vérifier l'inscription",
verificato: "Vérifié",
@@ -848,7 +861,7 @@ const msgglobal = {
email: 'Ce doit être un email valide.',
errore_generico: 'S\'il vous plaît remplir les champs correctement',
atleast: 'ça doit être au moins long',
- complexity: 'doit contenir au moins 1 minuscule, 1 majuscule, 1 chiffre et 1 caractère spécial (!,$,#,%,-)',
+ complexity: 'doit contenir au moins 1 minuscule, 1 majuscule, 1 chiffre',
notmore: 'il ne doit pas être plus long que',
char: 'caractères',
terms: 'Vous devez accepter les conditions, pour continuer..',
@@ -1178,10 +1191,13 @@ const msgglobal = {
options: 'Options',
},
reg: {
+ aportador_solidario: 'Solidarity Contributor',
incorso: 'Registration please wait...',
richiesto: 'Field Required',
email: 'Email',
cell: 'Phone',
+ email_paypal: 'Email Paypal',
+ username_telegram: 'Username Telegram',
img: 'File Image',
date_reg: 'Reg. Date',
perm: 'Permissions',
@@ -1192,6 +1208,7 @@ const msgglobal = {
password: 'Password',
repeatPassword: 'Repeat password',
terms: "I agree with the terms and conditions",
+ onlyadult: "I confirm that I'm at least 18 years old",
submit: "Submit",
title_verif_reg: "Verify Registration",
verificato: "Verified",
@@ -1202,7 +1219,7 @@ const msgglobal = {
email: 'must be a valid email',
errore_generico: 'Please review fields again',
atleast: 'must be at least',
- complexity: 'must contains at least 1 lowercase letter, 1 uppercase letter, 1 digit and one special symbol (!,$,#,%,-)',
+ complexity: 'must contains at least 1 lowercase letter, 1 uppercase letter, 1 digit',
notmore: 'must not be more than',
char: 'characters long',
terms: 'You need to agree with the terms & conditions.',
@@ -1531,11 +1548,14 @@ const msgglobal = {
options: 'Options',
},
reg: {
+ aportador_solidario: 'Solidarity Contributor',
page_title: 'Registration',
incorso: 'Registration please wait...',
richiesto: 'Field Required',
email: 'Email',
cell: 'Phone',
+ email_paypal: 'Email Paypal',
+ username_telegram: 'Username Telegram',
img: 'File Image',
date_reg: 'Reg. Date',
perm: 'Permissions',
@@ -1546,6 +1566,7 @@ const msgglobal = {
password: 'Password',
repeatPassword: 'Repeat password',
terms: "I agree with the terms and conditions",
+ onlyadult: "I confirm that I'm at least 18 years old",
submit: "Submit",
title_verif_reg: "Verify Registration",
verificato: "Verified",
@@ -1556,7 +1577,7 @@ const msgglobal = {
email: 'must be a valid email',
errore_generico: 'Please review fields again',
atleast: 'must be at least',
- complexity: 'must contains at least 1 lowercase letter, 1 uppercase letter, 1 digit and one special symbol (!,$,#,%,-)',
+ complexity: 'must contains at least 1 lowercase letter, 1 uppercase letter, 1 digit',
notmore: 'must not be more than',
char: 'characters long',
terms: 'You need to agree with the terms & conditions.',
diff --git a/src/store/Modules/GlobalStore.ts b/src/store/Modules/GlobalStore.ts
index b1cf598..f09fa48 100644
--- a/src/store/Modules/GlobalStore.ts
+++ b/src/store/Modules/GlobalStore.ts
@@ -800,6 +800,12 @@ namespace Actions {
GlobalStore.state.mypage = (res.data.mypage) ? [...res.data.mypage] : []
}
+ if (res.data.myuser) {
+ UserStore.mutations.authUser(res.data.myuser)
+
+ UserStore.mutations.updateLocalStorage(res.data.myuser)
+ }
+
CalendarStore.state.editable = UserStore.state.isAdmin || UserStore.state.isManager
})
diff --git a/src/store/Modules/UserStore.ts b/src/store/Modules/UserStore.ts
index 13e1c5d..73b00a1 100644
--- a/src/store/Modules/UserStore.ts
+++ b/src/store/Modules/UserStore.ts
@@ -1,5 +1,5 @@
import Api from '@api'
-import { ISignupOptions, ISigninOptions, IUserState, IUserFields } from 'model'
+import { ISignupOptions, ISigninOptions, IUserState, IUserFields, IUserProfile } from 'model'
import { ILinkReg, IResult, IIdToken, IToken } from 'model/other'
import { storeBuilder } from './Store/Store'
import router from '@router'
@@ -34,6 +34,15 @@ const DefaultUser: IUserFields = {
}
}
+const DefaultProfile: IUserProfile = {
+ img: '',
+ cell: '',
+ dateofbirth: new Date(),
+ sex: 0,
+ email_paypal: '',
+ username_telegram: ''
+}
+
// State
const state: IUserState = {
my: DefaultUser,
@@ -203,6 +212,9 @@ namespace Getters {
namespace Mutations {
function authUser(mystate: IUserState, data: IUserFields) {
mystate.my = { ...data }
+ if (!mystate.my.profile) {
+ mystate.my.profile = DefaultProfile
+ }
mystate.isAdmin = tools.isBitActive(mystate.my.perm, shared_consts.Permissions.Admin.value)
mystate.isManager = tools.isBitActive(mystate.my.perm, shared_consts.Permissions.Manager.value)
@@ -231,6 +243,29 @@ namespace Mutations {
mystate.my.password = newstr
}
+ function updateLocalStorage(mystate: IUserState, myuser: IUserFields) {
+ const now = tools.getDateNow()
+ // const expirationDate = new Date(now.getTime() + myres.data.expiresIn * 1000);
+ const expirationDate = new Date(now.getTime() * 1000)
+ localStorage.setItem(tools.localStorage.lang, state.lang)
+ localStorage.setItem(tools.localStorage.userId, myuser._id)
+ localStorage.setItem(tools.localStorage.username, myuser.username)
+ localStorage.setItem(tools.localStorage.name, myuser.name)
+ localStorage.setItem(tools.localStorage.surname, myuser.surname)
+ localStorage.setItem(tools.localStorage.perm, String(myuser.perm) || '')
+ if (myuser.profile !== undefined)
+ localStorage.setItem(tools.localStorage.img, (!!myuser.profile.img) ? String(myuser.profile.img) || '' : '')
+ else
+ localStorage.setItem(tools.localStorage.img, '')
+ localStorage.setItem(tools.localStorage.token, state.x_auth_token)
+ localStorage.setItem(tools.localStorage.expirationDate, expirationDate.toString())
+ localStorage.setItem(tools.localStorage.isLogged, String(true))
+ localStorage.setItem(tools.localStorage.verified_email, String(myuser.verified_email))
+ localStorage.setItem(tools.localStorage.wasAlreadySubOnDb, String(GlobalStore.state.wasAlreadySubOnDb))
+
+ }
+
+
function setusersList(mystate: IUserState, usersList: IUserFields[]) {
// console.log('setusersList', usersList)
mystate.usersList = [...usersList]
@@ -325,6 +360,7 @@ namespace Mutations {
}
export const mutations = {
+ updateLocalStorage: b.commit(updateLocalStorage),
authUser: b.commit(authUser),
setpassword: b.commit(setpassword),
setemail: b.commit(setemail),
@@ -609,24 +645,7 @@ namespace Actions {
Mutations.mutations.authUser(myuser)
- const now = tools.getDateNow()
- // const expirationDate = new Date(now.getTime() + myres.data.expiresIn * 1000);
- const expirationDate = new Date(now.getTime() * 1000)
- localStorage.setItem(tools.localStorage.lang, state.lang)
- localStorage.setItem(tools.localStorage.userId, myuser._id)
- localStorage.setItem(tools.localStorage.username, myuser.username)
- localStorage.setItem(tools.localStorage.name, myuser.name)
- localStorage.setItem(tools.localStorage.surname, myuser.surname)
- localStorage.setItem(tools.localStorage.perm, String(myuser.perm) || '')
- if (myuser.profile !== undefined)
- localStorage.setItem(tools.localStorage.img, (!!myuser.profile.img) ? String(myuser.profile.img) || '' : '')
- else
- localStorage.setItem(tools.localStorage.img, '')
- localStorage.setItem(tools.localStorage.token, state.x_auth_token)
- localStorage.setItem(tools.localStorage.expirationDate, expirationDate.toString())
- localStorage.setItem(tools.localStorage.isLogged, String(true))
- localStorage.setItem(tools.localStorage.verified_email, String(myuser.verified_email))
- localStorage.setItem(tools.localStorage.wasAlreadySubOnDb, String(GlobalStore.state.wasAlreadySubOnDb))
+ Mutations.mutations.updateLocalStorage(myuser)
}
}
@@ -739,6 +758,7 @@ namespace Actions {
const token = localStorage.getItem(tools.localStorage.token)
if (token) {
+
const expirationDateStr = localStorage.getItem(tools.localStorage.expirationDate)
const expirationDate = new Date(String(expirationDateStr))
const now = tools.getDateNow()
@@ -753,7 +773,7 @@ namespace Actions {
GlobalStore.state.wasAlreadySubOnDb = localStorage.getItem(tools.localStorage.wasAlreadySubOnDb) === 'true'
- console.log('************* autologin _id', _id)
+ // console.log('************* autologin _id', _id)
UserStore.mutations.setAuth(token)
diff --git a/src/store/Modules/fieldsTable.ts b/src/store/Modules/fieldsTable.ts
index 15cb1e1..ea89bc3 100644
--- a/src/store/Modules/fieldsTable.ts
+++ b/src/store/Modules/fieldsTable.ts
@@ -378,7 +378,9 @@ export const fieldsTable = {
AddCol({ name: 'name', label_trans: 'reg.name' }),
AddCol({ name: 'surname', label_trans: 'reg.surname' }),
AddCol({ name: 'email', label_trans: 'reg.email' }),
- AddCol({ name: 'cell', label_trans: 'reg.cell' }),
+ AddCol({ name: 'profile.cell', field: 'profile', subfield: 'cell', label_trans: 'reg.cell' }),
+ AddCol({ name: 'profile.email_paypal', field: 'profile', subfield: 'email_paypal', label_trans: 'reg.email_paypal' }),
+ AddCol({ name: 'profile.username_telegram', field: 'profile', subfield: 'username_telegram', label_trans: 'reg.username_telegram' }),
AddCol({ name: 'profile.img', field: 'profile', subfield: 'img', label_trans: 'reg.img', sortable: false }),
AddCol({ name: 'date_reg', label_trans: 'reg.date_reg', fieldtype: tools.FieldType.date }),
// AddCol({ name: 'idapp', label_trans: 'reg.idapp', fieldtype: tools.FieldType.string }),
diff --git a/src/store/Modules/tools.ts b/src/store/Modules/tools.ts
index 06b174c..16acc45 100644
--- a/src/store/Modules/tools.ts
+++ b/src/store/Modules/tools.ts
@@ -47,6 +47,8 @@ export interface INotify {
export const tools = {
CAN_EDIT: 'q-ce',
+ APORTADOR_SOLIDARIO: 'apsol',
+
listBestColor: [
'blue',
'green',
@@ -141,6 +143,7 @@ export const tools = {
multiselect: 256,
password: 512,
listimages: 1024,
+ image: 2048,
},
FieldTypeArr: [
@@ -2123,6 +2126,7 @@ export const tools = {
,
heightgallery(coeff) {
+ // console.log('heightgallery')
return tools.heightGallVal(coeff).toString() + 'px'
}
,
@@ -2694,6 +2698,7 @@ export const tools = {
},
getheightbywidth(mythis, mywidth, myheight, maxwidth) {
+ console.log('getheightbywidth')
const myw = this.getwidthscale(mythis, mywidth, maxwidth)
return myw * (myheight / mywidth)
},
@@ -2811,10 +2816,16 @@ export const tools = {
else
return ''
},
+ getsuffisso() {
+ if (tools.isTest())
+ return 'TEST: '
+ else
+ return ''
+ },
metafunc(mythis) {
return {
title: mythis.$t('msg.myAppName'),
- titleTemplate: (title) => `${mythis.mymeta.title} - ${mythis.$t('msg.myAppName')}`,
+ titleTemplate: (title) => `${tools.getsuffisso()} ${mythis.mymeta.title} - ${mythis.$t('msg.myAppName')}`,
meta: {
keywords: {
name: 'keywords',
@@ -2836,6 +2847,10 @@ export const tools = {
return process.env.DEV
},
+ isTest() {
+ return process.env.ISTEST === '1'
+ },
+
geturlupload() {
return process.env.MONGODB_HOST + '/upload'
},
diff --git a/src/views/login/signup/signup.ts b/src/views/login/signup/signup.ts
index bcc4bcc..b8e2e3c 100644
--- a/src/views/login/signup/signup.ts
+++ b/src/views/login/signup/signup.ts
@@ -11,5 +11,17 @@ import { CSignUp } from '../../../components/CSignUp'
export default class Signup extends Vue {
public $t: any
+ public adult: boolean = false
+
+ @Watch('$route.params.invited')
+ public changeadult() {
+ console.log('$route.params.invited')
+ this.adult = !!this.$route.params.invited
+ }
+
+ public created() {
+ if (!tools.getCookie(tools.APORTADOR_SOLIDARIO, ''))
+ tools.setCookie(tools.APORTADOR_SOLIDARIO, this.$route.params.invited)
+ }
}
diff --git a/src/views/login/signup/signup.vue b/src/views/login/signup/signup.vue
index f46b326..9391807 100644
--- a/src/views/login/signup/signup.vue
+++ b/src/views/login/signup/signup.vue
@@ -1,6 +1,6 @@
-
+