- Dynamic Pages (MyPage)

- Uploading files to the Server FTP.
This commit is contained in:
Paolo Arena
2019-12-27 12:43:42 +01:00
parent ad8f335d6c
commit ad94721b7d
35 changed files with 355 additions and 232 deletions

View File

@@ -136,7 +136,7 @@ module.exports = function (ctx) {
.test(/\.(gql|graphql)$/) .test(/\.(gql|graphql)$/)
.loader('graphql-tag/loader') */ .loader('graphql-tag/loader') */
// extendPrerender(config); extendPrerender(config);
} }
}, },
dev: { dev: {

View File

@@ -23,6 +23,7 @@ export default class CDateTime extends Vue {
@Prop({ required: false, default: false }) public disable!: boolean @Prop({ required: false, default: false }) public disable!: boolean
@Prop({ required: false, default: '' }) public bgcolor!: string @Prop({ required: false, default: '' }) public bgcolor!: string
@Prop({ required: false, default: false }) public dense: boolean @Prop({ required: false, default: false }) public dense: boolean
@Prop({ required: false, default: '5' }) public minuteinterval: boolean
public mystyleicon: string = 'font-size: 1.5rem;' public mystyleicon: string = 'font-size: 1.5rem;'
public showDateTimeScroller: boolean = false public showDateTimeScroller: boolean = false
@@ -61,6 +62,7 @@ export default class CDateTime extends Vue {
public changevalueDate() { public changevalueDate() {
if (this.valueDate) if (this.valueDate)
this.myvalue = tools.getstrYYMMDDDateTime(this.valueDate) this.myvalue = tools.getstrYYMMDDDateTime(this.valueDate)
// console.log('changevalueDate myvalue', this.myvalue) // console.log('changevalueDate myvalue', this.myvalue)
} }
@Watch('value') @Watch('value')
@@ -70,9 +72,10 @@ export default class CDateTime extends Vue {
} }
public savetoclose() { public savetoclose() {
// console.log('Close')
this.saveit = true this.saveit = true
this.showDateTimeScroller = false this.showDateTimeScroller = false
// this.$emit('savetoclose', this.myvalue, this.valueprec) this.$emit('savetoclose', this.myvalue, this.valueprec)
} }
get scrollerPopupStyle280() { get scrollerPopupStyle280() {
@@ -100,7 +103,7 @@ export default class CDateTime extends Vue {
else else
this.myvalue = tools.getstrYYMMDDDateTime(this.valueDate) this.myvalue = tools.getstrYYMMDDDateTime(this.valueDate)
console.log('created myvalue', this.myvalue) // console.log('created myvalue', this.myvalue)
} }
public changeval(newval) { public changeval(newval) {

View File

@@ -48,7 +48,7 @@
bar-color="#2196f3" bar-color="#2196f3"
text-color="white" text-color="white"
color="primary" color="primary"
minute-interval="5" :minute-interval="minuteinterval"
inner-text-color="primary" inner-text-color="primary"
inner-color="white" inner-color="white"
:style="scrollerPopupStyle280" :style="scrollerPopupStyle280"

View File

@@ -273,7 +273,7 @@ export default class CEventsCalendar extends MixinEvents {
} }
get dayHeight() { get dayHeight() {
if (Screen.height < 400) if (Screen.height < 410)
return 80 return 80
else if (Screen.height < 500) else if (Screen.height < 500)
return 100 return 100

View File

@@ -45,9 +45,9 @@ export default class CFacebookFrame extends Vue {
get mywidth() { get mywidth() {
let myw = 340 let myw = 340
if (tools.getwidth(this) < 400) if (tools.getwidth(this) < 410)
return myw return myw
if ((tools.getwidth(this) > 400) && (tools.getwidth(this) < 1100)) if ((tools.getwidth(this) > 410) && (tools.getwidth(this) < 1100))
return Math.round((tools.getwidth(this) / 3) - 30) return Math.round((tools.getwidth(this) / 3) - 30)
else else
return myw return myw

View File

@@ -1,5 +1,5 @@
<template> <template>
<div class="q-pa-sm"> <div class="q-pa-xs">
<q-table <q-table
:data="serverData" :data="serverData"
@@ -100,6 +100,7 @@
:row.sync="props.row" :row.sync="props.row"
:field="col.field" :field="col.field"
:subfield="col.subfield" :subfield="col.subfield"
minuteinterval="1"
@save="SaveValue" @save="SaveValue"
@show="selItem(props.row, col)" @show="selItem(props.row, col)"
@showandsave="showandsel"> @showandsave="showandsel">
@@ -142,6 +143,7 @@
<div class="q-ma-sm q-pa-sm colmodif col-grow rounded-borders " style="border: 1px solid #bbb" <div class="q-ma-sm q-pa-sm colmodif col-grow rounded-borders " style="border: 1px solid #bbb"
@click="colclicksel = mycol"> @click="colclicksel = mycol">
<CMyPopupEdit :canEdit="true" <CMyPopupEdit :canEdit="true"
view="field"
:col="mycol" :col="mycol"
:showall="true" :showall="true"
:row="rowclicksel" :row="rowclicksel"

View File

@@ -49,7 +49,6 @@
<q-toggle dark color="green" v-model="myvalue" :label="col.title" <q-toggle dark color="green" v-model="myvalue" :label="col.title"
@input="savefield"></q-toggle> @input="savefield"></q-toggle>
</div> </div>
<div v-else> <div v-else>
{{ myvalprinted }} {{ myvalprinted }}
</div> </div>

View File

@@ -10,10 +10,11 @@ import { CDateTime } from '../CDateTime'
import { CMyToggleList } from '../CMyToggleList' import { CMyToggleList } from '../CMyToggleList'
import { CMySelect } from '../CMySelect' import { CMySelect } from '../CMySelect'
import { CMyEditor } from '../CMyEditor' import { CMyEditor } from '../CMyEditor'
import { CGallery } from '../CGallery'
@Component({ @Component({
name: 'CMyPopupEdit', name: 'CMyPopupEdit',
components: {CMyChipList, CDateTime, CMyToggleList, CMySelect, CMyEditor} components: {CMyChipList, CDateTime, CMyToggleList, CMySelect, CMyEditor, CGallery }
}) })
export default class CMyPopupEdit extends Vue { export default class CMyPopupEdit extends Vue {
@@ -23,6 +24,8 @@ export default class CMyPopupEdit extends Vue {
@Prop({ required: false, default: '' }) public field @Prop({ required: false, default: '' }) public field
@Prop({ required: false, default: '' }) public subfield @Prop({ required: false, default: '' }) public subfield
@Prop({ required: false, default: false }) public showall @Prop({ required: false, default: false }) public showall
@Prop({ required: false, default: 'row' }) public view
@Prop({ required: false, default: '5' }) public minuteinterval
public myvalue = '' public myvalue = ''
@@ -30,6 +33,10 @@ export default class CMyPopupEdit extends Vue {
return tools return tools
} }
get isviewfield() {
return this.view === 'field'
}
get db_fieldsTable() { get db_fieldsTable() {
return fieldsTable return fieldsTable
} }
@@ -60,7 +67,7 @@ export default class CMyPopupEdit extends Vue {
public SaveValueInt(newVal, valinitial) { public SaveValueInt(newVal, valinitial) {
// console.log('SaveValueInt', newVal) console.log('SaveValueInt', newVal)
// Update value in table memory // Update value in table memory
if (this.subfield !== '') { if (this.subfield !== '') {
@@ -146,7 +153,7 @@ export default class CMyPopupEdit extends Vue {
public getclassCol(col) { public getclassCol(col) {
if (col) { if (col) {
let mycl = (col.disable) ? '' : 'colmodif' let mycl = (col.disable || this.isviewfield) ? '' : 'colmodif'
mycl += (col.fieldtype === tools.FieldType.date) ? ' coldate flex flex-container' : '' mycl += (col.fieldtype === tools.FieldType.date) ? ' coldate flex flex-container' : ''
return mycl return mycl

View File

@@ -1,148 +1,147 @@
<template> <template>
<div :class="getclassCol(col)"> <div :class="getclassCol(col)">
<div v-if="col.fieldtype === tools.FieldType.date"> <div v-if="col.fieldtype === tools.FieldType.listimages">
<CDateTime <CGallery :gall="row" :listimages="myvalue" :edit="isviewfield"
:label="col.label" @showandsave="Savedb">
class="cursor-pointer"
:valueDate="myvalue" </CGallery>
:readonly="false"
:dense="true"
:canEdit="canEdit"
@savetoclose="SaveValueInt"
@show="OpenEdit">
</CDateTime>
</div> </div>
<div v-else> <div v-else>
<div v-if="col.fieldtype === tools.FieldType.binary">
<CMyChipList
:type="tools.FieldType.binary"
:value="myvalue"
:options="db_fieldsTable.getTableJoinByName(col.jointable)"
:optval="db_fieldsTable.getKeyByTable(col.jointable)"
:optlab="db_fieldsTable.getLabelByTable(col.jointable)"
:opticon="db_fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
</div>
<!-- Show Value -->
<div v-else-if="col.fieldtype === tools.FieldType.multiselect">
<CMyChipList
:type="tools.FieldType.multiselect"
:value="myvalue"
:options="db_fieldsTable.getTableJoinByName(col.jointable)"
:optval="db_fieldsTable.getKeyByTable(col.jointable)"
:optlab="db_fieldsTable.getLabelByTable(col.jointable)"
:opticon="db_fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.boolean">
<q-toggle dark color="green" v-model="myvalue" :label="col.title"
@input="Savedb"></q-toggle>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.html">
<div v-html="visuValByType(myvalue, col, row)">
</div>
</div>
<div v-else>
{{ visuValByType(myvalue, col, row) }}
</div>
<!--<q-select v-model="myvalue"-->
<!--rounded-->
<!--outlined-->
<!--dense-->
<!--:options="db_fieldsTable.getTableJoinByName(col.jointable)"-->
<!--:display-value="db_fieldsTable.getLabelByTable(col.jointable)"-->
<!--emit-value-->
<!--@input="SaveValueInt"-->
<!--&gt;-->
<!--</q-select>-->
<!-- Edit Value --> <!-- Edit Value -->
<q-popup-edit <span v-if="col.fieldtype === tools.FieldType.date">
v-if="canEdit" <CDateTime
v-model="myvalue" :label="col.label"
:disable="col.disable" class="cursor-pointer"
:title="col.title" :valueDate="myvalue"
buttons :readonly="false"
@save="SaveValueInt" :minuteinterval="minuteinterval"
@show="OpenEdit"> :dense="true"
:canEdit="canEdit"
@savetoclose="SaveValueInt"
@show="OpenEdit">
</CDateTime>
</span>
<div v-if="col.fieldtype !== tools.FieldType.date">
<div>
<div v-if="col.fieldtype === tools.FieldType.binary">
<CMyChipList
:type="tools.FieldType.binary"
:value="myvalue"
:options="db_fieldsTable.getTableJoinByName(col.jointable)"
:optval="db_fieldsTable.getKeyByTable(col.jointable)"
:optlab="db_fieldsTable.getLabelByTable(col.jointable)"
:opticon="db_fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
</div>
<!-- Show Value -->
<div v-else-if="col.fieldtype === tools.FieldType.multiselect">
<CMyChipList
:type="tools.FieldType.multiselect"
:value="myvalue"
:options="db_fieldsTable.getTableJoinByName(col.jointable)"
:optval="db_fieldsTable.getKeyByTable(col.jointable)"
:optlab="db_fieldsTable.getLabelByTable(col.jointable)"
:opticon="db_fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.boolean">
<q-toggle dark color="green" v-model="myvalue" :label="col.title"
@input="Savedb"></q-toggle>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.html">
<div v-html="visuValByType(myvalue, col, row)">
<div v-if="col.fieldtype === tools.FieldType.boolean"> </div>
<q-checkbox v-model="myvalue" :label="col.title"> </div>
</q-checkbox> <div v-else>
{{ visuValByType(myvalue, col, row) }} {{ visuValByType(myvalue, col, row) }}
</div>
</div> </div>
<div v-else-if="col.fieldtype === tools.FieldType.string"> <q-popup-edit
<q-input v-model="myvalue" v-if="canEdit"
autogrow v-model="myvalue"
@keyup.enter.stop :disable="col.disable"
autofocus> :title="col.title"
buttons
persistent
@save="SaveValueInt"
@show="OpenEdit">
</q-input> <div v-if="col.fieldtype === tools.FieldType.boolean">
</div> <q-checkbox v-model="myvalue" :label="col.title">
<div v-else-if="col.fieldtype === tools.FieldType.password"> </q-checkbox>
<q-input v-model="myvalue" {{ visuValByType(myvalue, col, row) }}
type="password" </div>
@keyup.enter.stop <div v-else-if="col.fieldtype === tools.FieldType.string">
autofocus> <q-input v-model="myvalue"
autogrow
@keyup.enter.stop
autofocus>
</q-input> </q-input>
</div> </div>
<div v-else-if="col.fieldtype === tools.FieldType.number"> <div v-else-if="col.fieldtype === tools.FieldType.password">
<q-input v-model="myvalue" type="number" <q-input v-model="myvalue"
autofocus> type="password"
@keyup.enter.stop
autofocus>
</q-input> </q-input>
</div> </div>
<div v-else-if="col.fieldtype === tools.FieldType.binary"> <div v-else-if="col.fieldtype === tools.FieldType.number">
<CMyToggleList :label="col.title" <q-input v-model="myvalue" type="number"
:options="db_fieldsTable.getTableJoinByName(col.jointable)" autofocus>
</q-input>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.binary">
<CMyToggleList :label="col.title"
:options="db_fieldsTable.getTableJoinByName(col.jointable)"
:value.sync="myvalue"
:optval="db_fieldsTable.getKeyByTable(col.jointable)"
:optlab="db_fieldsTable.getLabelByTable(col.jointable)">
</CMyToggleList>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.html">
<CMyEditor :value.sync="myvalue" :title="col.title" @keyup.enter.stop>
</CMyEditor>
<!--<q-input v-model="myvalue"-->
<!--autofocus-->
<!--@keyup.enter.stop-->
<!--type="textarea"></q-input>-->
</div>
<div v-else-if="col.fieldtype === tools.FieldType.select">
<CMySelect :label="col.title"
:value.sync="myvalue" :value.sync="myvalue"
:optval="db_fieldsTable.getKeyByTable(col.jointable)" :optval="db_fieldsTable.getKeyByTable(col.jointable)"
:optlab="db_fieldsTable.getLabelByTable(col.jointable)"> :optlab="db_fieldsTable.getLabelByTable(col.jointable)"
</CMyToggleList> :options="db_fieldsTable.getTableJoinByName(col.jointable)"
</div> :useinput="false">
<div v-else-if="col.fieldtype === tools.FieldType.html"> </CMySelect>
<CMyEditor :value.sync="myvalue" :title="col.title" @keyup.enter.stop> </div>
<div v-else-if="col.fieldtype === tools.FieldType.multiselect">
<q-select
v-model="myvalue"
rounded
outlined
multiple
dense
options-dense
:display-value="db_fieldsTable.getTitleByTable(col.jointable)"
emit-value
map-options
:options="db_fieldsTable.getTableJoinByName(col.jointable)"
:option-label="db_fieldsTable.getLabelByTable(col.jointable)"
:option-value="db_fieldsTable.getKeyByTable(col.jointable)"
style="min-width: 150px"
@input="changeCol">
</CMyEditor> </q-select>
<!--<q-input v-model="myvalue"--> </div>
<!--autofocus-->
<!--@keyup.enter.stop-->
<!--type="textarea"></q-input>-->
</div>
<div v-else-if="col.fieldtype === tools.FieldType.select">
<CMySelect :label="col.title"
:value.sync="myvalue"
:optval="db_fieldsTable.getKeyByTable(col.jointable)"
:optlab="db_fieldsTable.getLabelByTable(col.jointable)"
:options="db_fieldsTable.getTableJoinByName(col.jointable)"
:useinput="false">
</CMySelect>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.multiselect">
<q-select
v-model="myvalue"
rounded
outlined
multiple
dense
options-dense
:display-value="db_fieldsTable.getTitleByTable(col.jointable)"
emit-value
map-options
:options="db_fieldsTable.getTableJoinByName(col.jointable)"
:option-label="db_fieldsTable.getLabelByTable(col.jointable)"
:option-value="db_fieldsTable.getKeyByTable(col.jointable)"
style="min-width: 150px"
@input="changeCol">
</q-select> </q-popup-edit>
</div> </div>
</q-popup-edit>
</div> </div>
</div> </div>
</template> </template>
<script lang="ts" src="./CMyPopupEdit.ts"> <script lang="ts" src="./CMyPopupEdit.ts">

View File

@@ -14,9 +14,9 @@
</div> </div>
<div v-else> <div v-else>
<div class="q-my-md"> <div class="q-my-md">
<p class="text-subtitle2 text-center"> <p v-if="urlmap" class="text-subtitle2 text-center">
<span v-html="title"></span> <span v-html="title"></span>
- <a href="urlmap" target="_blank" class="text-black">Apri Mappa</a> - <a :href="urlmap" target="_blank" class="text-black">Apri Mappa</a>
</p> </p>
<a :href="urlmap" target="_blank"> <a :href="urlmap" target="_blank">
<q-img :src="`statics/` + imgmap" class="imgautosize" alt="my map"> <q-img :src="`statics/` + imgmap" class="imgautosize" alt="my map">

View File

@@ -17,6 +17,7 @@ import router from '@router'
import globalroutines from '../../globalroutines/index' import globalroutines from '../../globalroutines/index'
import { ICategory } from '../../model' import { ICategory } from '../../model'
import { static_data } from '../../db/static_data'
// import {Loading, QSpinnerFacebook, QSpinnerGears} from 'quasar' // import {Loading, QSpinnerFacebook, QSpinnerGears} from 'quasar'
@@ -39,6 +40,10 @@ export default class CSignIn extends Vue {
password: process.env.TEST_PASSWORD || '' password: process.env.TEST_PASSWORD || ''
} }
get static_data() {
return static_data
}
public created() { public created() {
this.$v.$reset() this.$v.$reset()

View File

@@ -55,7 +55,7 @@
:disable="$v.$error || iswaitingforRes">{{$t('login.enter')}} :disable="$v.$error || iswaitingforRes">{{$t('login.enter')}}
</q-btn> </q-btn>
</div> </div>
<div align="center" style="margin-top:10px;"> <div v-if="static_data.functionality.ENABLE_REGISTRATION" align="center" style="margin-top:10px;">
<q-btn flat rounded size="md" color="primary" to="/signup">{{$t('reg.submit')}} <q-btn flat rounded size="md" color="primary" to="/signup">{{$t('reg.submit')}}
</q-btn> </q-btn>
</div> </div>

View File

@@ -0,0 +1,3 @@
.myshad {
text-shadow: .125rem .125rem .125rem darkgray;
}

View File

@@ -26,6 +26,23 @@ import { Screen } from 'quasar'
export default class CTitleBanner extends Vue { export default class CTitleBanner extends Vue {
@Prop({ required: true}) public title: string @Prop({ required: true}) public title: string
@Prop({ required: false, default: 'bg-primary' }) public bgcolor: string @Prop({ required: false, default: 'bg-primary' }) public bgcolor: string
@Prop({ required: false, default: 'primary' }) public color: string @Prop({ required: false, default: 'text-white' }) public clcolor: string
@Prop({ required: false, default: '' }) public mystyle: string
@Prop({ required: false, default: '' }) public myclass: string
@Prop({ required: false, default: '' }) public myclasstext: string
@Prop({ required: false, default: '' }) public icon: string
@Prop({ required: false, default: true }) public visible: boolean
public myvisible: boolean = true
public mounted() {
this.myvisible = this.visible
}
get iconopen() {
if (!this.myvisible)
return 'fas fa-chevron-down q-icon q-expansion-item__toggle-icon q-focusable '
else
return 'fas fa-chevron-down q-icon q-expansion-item__toggle-icon q-focusable rotate-180'
}
} }

View File

@@ -1,11 +1,27 @@
<template> <template>
<div> <div>
<q-banner <q-banner
class="q-my-md" inline-actions
rounded dense :class="bgcolor+` text-white`" rounded dense
:color="color+` q-title`" style="text-align: center;"> :class="bgcolor+` q-my-md `+clcolor+ ` ` + myclass"
<span class="mybanner">{{title}}</span> style="text-align: center; "
@click="myvisible = !myvisible"
>
<template v-slot:avatar>
<q-icon :name="icon" color="white" />
</template>
<template v-slot:action>
<q-icon :name="iconopen" color="white" />
</template>
<span :class="`mybanner `+ myclasstext" :style="mystyle">{{title}}</span>
</q-banner> </q-banner>
<q-slide-transition>
<div v-show="myvisible">
<slot></slot>
</div>
</q-slide-transition>
</div> </div>
</template> </template>

View File

@@ -137,13 +137,6 @@ $textcol_scuro: darkblue;
font-size: 0.6rem; font-size: 0.6rem;
} }
.carousel_img_3 {
//background-image: url(../../statics/images/cibo_sano.jpg);
background-size: 620px 620px !important;
background-position: 50% top !important;
background-repeat: no-repeat !important;
}
} }
.custom-caption { .custom-caption {

View File

@@ -44,7 +44,7 @@
</div> </div>
</div> </div>
<div class="text-center"> <div v-if="getValDb('URLMAP', false)" class="text-center">
<span v-html="getValDb('MAP_TITLE', false)"></span> <span v-html="getValDb('MAP_TITLE', false)"></span>
<br> <br>
<a :href="getValDb('URLMAP', false)" target="_blank" class="footer_link">Apri Mappa</a> <a :href="getValDb('URLMAP', false)" target="_blank" class="footer_link">Apri Mappa</a>
@@ -61,7 +61,6 @@
<div class="q-mt-xs mycontacts"> <div class="q-mt-xs mycontacts">
<p class="mycontacts_title">{{$t('homepage.titlecontatti')}}</p> <p class="mycontacts_title">{{$t('homepage.titlecontatti')}}</p>
<div class="mycontacts_text"> <div class="mycontacts_text">
<i v-if="getValDb('MAIN_EMAIL', false)" aria-hidden="true" <i v-if="getValDb('MAIN_EMAIL', false)" aria-hidden="true"
class="q-icon fas fa-envelope q-mx-sm"></i> class="q-icon fas fa-envelope q-mx-sm"></i>

View File

@@ -7,7 +7,14 @@
font-weight: 350; font-weight: 350;
} }
.q-toolbar__title{
padding: 0 12px;
}
@media screen and (max-width: 600px) { @media screen and (max-width: 600px) {
.q-toolbar__title{
padding: 0;
}
.layout-padding { .layout-padding {
padding: 1.5em .5em; padding: 1.5em .5em;
} }

View File

@@ -308,7 +308,7 @@ export default class Header extends Vue {
} }
get getappname() { get getappname() {
return tools.getappname(this) return tools.getappname(this, tools.isMobile())
} }
public toggleanimation() { public toggleanimation() {

View File

@@ -34,3 +34,4 @@ export * from './Shen/CTesseraElettronica'
export * from './CGoogleMap' export * from './CGoogleMap'
export * from './COpenStreetMap' export * from './COpenStreetMap'
export * from './CTitleBanner' export * from './CTitleBanner'
export * from './CGallery'

View File

@@ -1,7 +1,6 @@
import Vue from 'vue' import Vue from 'vue'
import { Watch } from 'vue-property-decorator' import { Watch } from 'vue-property-decorator'
import { GlobalStore } from '../../store/Modules' import { GlobalStore } from '../../store/Modules'
import Component from 'vue-class-component'
import { static_data } from '../../db/static_data' import { static_data } from '../../db/static_data'
import { tools } from '../../store/Modules/tools' import { tools } from '../../store/Modules/tools'
import { IListRoutes } from '@src/model' import { IListRoutes } from '@src/model'

View File

@@ -7,10 +7,11 @@ import { toolsext } from '@src/store/Modules/toolsext'
import { GlobalStore } from '../store/Modules' import { GlobalStore } from '../store/Modules'
import { fieldsTable } from '@src/store/Modules/fieldsTable' import { fieldsTable } from '@src/store/Modules/fieldsTable'
import { CalendarStore } from '@store' import { CalendarStore } from '@store'
import MixinMetaTags from '@src/mixins/mixin-metatags'
// You can declare a mixin as the same style as components. // You can declare a mixin as the same style as components.
@Component @Component
export default class MixinBase extends Vue { export default class MixinBase extends MixinMetaTags {
public mythis() { public mythis() {
return this return this
} }
@@ -103,8 +104,8 @@ export default class MixinBase extends Vue {
try { try {
if (myval) { if (myval) {
const myrec = JSON.parse(myval) const myrec = JSON.parse(myval)
// console.log('*************** getarrValDb') console.log('*************** getarrValDb')
// console.table(myrec) console.table(myrec)
return myrec return myrec
} else { } else {
return [] return []

View File

@@ -149,6 +149,7 @@ export interface IGlobalState {
settings: ISettings[], settings: ISettings[],
disciplines: IDiscipline[], disciplines: IDiscipline[],
newstosent: INewsToSent[], newstosent: INewsToSent[],
gallery: IGallery[],
mypage: IMyPage[], mypage: IMyPage[],
templemail: ITemplEmail[], templemail: ITemplEmail[],
opzemail: ISettings[], opzemail: ISettings[],
@@ -258,14 +259,20 @@ export interface ITimeLineMain {
body: ITimeLineEntry[] body: ITimeLineEntry[]
} }
export interface IImgGallery {
_id?:string
imagefile: string
order?: number
alt?: string
description?: string
}
export interface IGallery { export interface IGallery {
_id?: string
author_username: string
title: string title: string
subtitle?: IAllLang directory: string
img: string list: IImgGallery[]
width?: number
height?: number
ingallery?: boolean
inexibitions?: boolean
} }
export interface IColl { export interface IColl {
@@ -293,6 +300,7 @@ export interface IParamDialog {
export interface IFunctionality { export interface IFunctionality {
PWA?: boolean PWA?: boolean
ENABLE_REGISTRATION?: boolean
SHOW_USER_MENU?: boolean SHOW_USER_MENU?: boolean
SHOW_IF_IS_SERVER_CONNECTION?: boolean SHOW_IF_IS_SERVER_CONNECTION?: boolean
ENABLE_TODOS_LOADING?: boolean ENABLE_TODOS_LOADING?: boolean

View File

@@ -107,7 +107,7 @@
</div> </div>
</CMyPage> </CMyPage>
</template> </template>
<script lang="ts" src="eventlist.ts"> <script lang="ts" src="./eventlist.ts">
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import './eventlist.scss'; @import './eventlist.scss';

View File

@@ -2,16 +2,15 @@ import Vue from 'vue'
import { Component, Prop } from 'vue-property-decorator' import { Component, Prop } from 'vue-property-decorator'
import { GlobalStore, UserStore } from '@store' import { GlobalStore, UserStore } from '@store'
import { tools } from '../../../../../associazioneShen/src/store/Modules/tools' import { static_data } from '../../../db/static_data'
import { static_data } from '../../../../../associazioneShen/src/db/static_data'
import { Screen } from 'quasar' import { Screen } from 'quasar'
import { colgallery } from 'store/Modules/fieldsTable' import { colgallery } from '@src/store/Modules/fieldsTable'
import { CImgText } from '../../../../../associazioneShen/src/components/CImgText/index' import { CImgText } from '../../../components/CImgText/index'
import { CCard, CGridTableRec, CMyPage, CTitleBanner } from '@components' import { CCard, CGridTableRec, CMyPage, CTitleBanner } from '@components'
import MixinMetaTags from '../../../../../associazioneShen/src/mixins/mixin-metatags' import MixinMetaTags from '../../../../../associazioneShen/src/mixins/mixin-metatags'
import MixinBase from 'mixins/mixin-base' import MixinBase from '../../../mixins/mixin-base'
@Component({ @Component({
mixins: [MixinBase], mixins: [MixinBase],

View File

@@ -14,7 +14,7 @@
</div> </div>
</CMyPage> </CMyPage>
</template> </template>
<script lang="ts" src="gallery.ts"> <script lang="ts" src="./gallery.ts">
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@@ -1,16 +1,16 @@
import Vue from 'vue' import Vue from 'vue'
import { Component, Watch } from 'vue-property-decorator' import { Component, Watch } from 'vue-property-decorator'
import { tools } from 'store/Modules/tools' import { tools } from '@src/store/Modules/tools'
import { func_tools } from 'store/Modules/toolsext' import { func_tools } from 'store/Modules/toolsext'
import { CTitle } from '../../../../../associazioneShen/src/components/CTitle/index'
import { CMyPage } from '../../../../../associazioneShen/src/components/CMyPage/index'
import MixinBase from 'mixins/mixin-base'
import { CalendarStore, GlobalStore, UserStore } from '@store' import { CalendarStore, GlobalStore, UserStore } from '@store'
import { CGridTableRec, CMyFieldDb, CTitleBanner } from '@components' import { CGridTableRec, CMyFieldDb, CTitleBanner } from '@components'
import { colnewstosent, coltemplemail, colopzemail, colmailinglist } from 'store/Modules/fieldsTable' import { colnewstosent, coltemplemail, colopzemail, colmailinglist } from '@src/store/Modules/fieldsTable'
import { DefaultNewsState, INewsState } from 'model/index' import { DefaultNewsState, INewsState } from '@src/model/index'
import translate from 'globalroutines/util' import translate from '../../../globalroutines/util'
import { getCookie } from 'utils/auth' import { getCookie } from 'utils/auth'
import { CTitle } from '../../../components/CTitle'
import { CMyPage } from '../../../components/CMyPage'
import MixinBase from '../../../mixins/mixin-base'
const namespace = 'CalendarModule' const namespace = 'CalendarModule'

View File

@@ -536,7 +536,7 @@
</CMyPage> </CMyPage>
</template> </template>
<script lang="ts" src="newsletter.ts"> <script lang="ts" src="./newsletter.ts">
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import './newsletter.scss'; @import './newsletter.scss';

View File

@@ -21,6 +21,7 @@ const msgglobal = {
newsletter: 'Newsletter', newsletter: 'Newsletter',
pages: 'Pagine', pages: 'Pagine',
media: 'Media', media: 'Media',
gallery: 'Gallerie',
}, },
manage: { manage: {
menu: 'Gestione', menu: 'Gestione',
@@ -359,8 +360,10 @@ const msgglobal = {
lastemailsent_Job: 'Ultima Inviata', lastemailsent_Job: 'Ultima Inviata',
starting_job: 'Invio Iniziato', starting_job: 'Invio Iniziato',
finish_job: 'Invio Terminato', finish_job: 'Invio Terminato',
processing_job: 'Lavoro in corso',
error_job: 'Info Errori', error_job: 'Info Errori',
statesub: 'Sottoscritto', statesub: 'Sottoscritto',
wrongerr: 'Email non valida',
}, },
privacy_policy:'Privacy Policy', privacy_policy:'Privacy Policy',
cookies: 'Usiamo i Cookie per una migliore prestazione web.' cookies: 'Usiamo i Cookie per una migliore prestazione web.'
@@ -712,8 +715,10 @@ const msgglobal = {
lastemailsent_Job: 'Ùltimo enviado', lastemailsent_Job: 'Ùltimo enviado',
starting_job: 'Comenzó a enviar', starting_job: 'Comenzó a enviar',
finish_job: 'Envio terminado', finish_job: 'Envio terminado',
processing_job: 'En curso',
error_job: 'Info Error', error_job: 'Info Error',
statesub: 'Subscribir', statesub: 'Subscribir',
wrongerr: 'Email invalide',
}, },
privacy_policy:'Política de privacidad', privacy_policy:'Política de privacidad',
cookies: 'Utilizamos cookies para un mejor rendimiento web.' cookies: 'Utilizamos cookies para un mejor rendimiento web.'
@@ -1064,8 +1069,10 @@ const msgglobal = {
lastemailsent_Job: 'Dernier envoyé', lastemailsent_Job: 'Dernier envoyé',
starting_job: 'Envoyé', starting_job: 'Envoyé',
finish_job: 'Envoy Terminé', finish_job: 'Envoy Terminé',
processing_job: 'travaux en cours',
error_job: 'info d\'erreur', error_job: 'info d\'erreur',
statesub: 'Abonné', statesub: 'Abonné',
wrongerr: 'Email inválido',
}, },
privacy_policy:'Politique de confidentialité', privacy_policy:'Politique de confidentialité',
cookies: 'Nous utilisons des cookies pour améliorer les performances Web.' cookies: 'Nous utilisons des cookies pour améliorer les performances Web.'
@@ -1414,9 +1421,11 @@ const msgglobal = {
datefinishJob: 'End Job', datefinishJob: 'End Job',
lastemailsent_Job: 'Last Sent', lastemailsent_Job: 'Last Sent',
starting_job: 'Job started', starting_job: 'Job started',
finish_job: 'Sent terminated', finish_job: 'Work in progress',
processing_job: 'Lavoro in corso',
error_job: 'Info Error', error_job: 'Info Error',
statesub: 'Subscribed', statesub: 'Subscribed',
wrongerr: 'Invalid Email',
}, },
privacy_policy:'Privacy Policy', privacy_policy:'Privacy Policy',
cookies: 'We use cookies for better web performance.' cookies: 'We use cookies for better web performance.'
@@ -1768,8 +1777,10 @@ const msgglobal = {
lastemailsent_Job: 'Last Sent', lastemailsent_Job: 'Last Sent',
starting_job: 'Job started', starting_job: 'Job started',
finish_job: 'Sent terminated', finish_job: 'Sent terminated',
processing_job: 'Work in progress',
error_job: 'Info Error', error_job: 'Info Error',
statesub: 'Subscribed', statesub: 'Subscribed',
wrongerr: 'Invalid Email',
}, },
privacy_policy:'Privacy Policy', privacy_policy:'Privacy Policy',
cookies: 'Wir verwenden Cookies für eine bessere Webleistung.' cookies: 'Wir verwenden Cookies für eine bessere Webleistung.'

View File

@@ -1,14 +1,10 @@
function geturl() { function geturl() {
const miaurl = document.location.href const miaurl = document.location.href
if (miaurl.includes('test.')) { if (miaurl.includes('localhost')) {
return 'https://test.associazioneshen.it/' return 'http://localhost:8084/'
} else { } else {
if (miaurl.includes('localhost')) { return 'https://mandalasolidale.freeplanet.app/'
return 'http://localhost:8080/'
} else {
return 'https://associazioneshen.it/'
}
} }
} }

View File

@@ -76,6 +76,7 @@ const state: IGlobalState = {
disciplines: [], disciplines: [],
autoplaydisc: 8000, autoplaydisc: 8000,
newstosent: [], newstosent: [],
gallery: [],
mailinglist: [], mailinglist: [],
mypage: [] mypage: []
} }
@@ -182,6 +183,8 @@ namespace Getters {
return GlobalStore.state.disciplines return GlobalStore.state.disciplines
else if (table === tools.TABNEWSLETTER) else if (table === tools.TABNEWSLETTER)
return GlobalStore.state.newstosent return GlobalStore.state.newstosent
else if (table === tools.TABGALLERY)
return GlobalStore.state.gallery
else if (table === tools.TABTEMPLEMAIL) else if (table === tools.TABTEMPLEMAIL)
return GlobalStore.state.templemail return GlobalStore.state.templemail
else if (table === tools.TABOPZEMAIL) else if (table === tools.TABOPZEMAIL)
@@ -771,6 +774,7 @@ namespace Actions {
CalendarStore.state.contribtype = (res.data.contribtype) ? res.data.contribtype : [] CalendarStore.state.contribtype = (res.data.contribtype) ? res.data.contribtype : []
GlobalStore.state.settings = (res.data.settings) ? [...res.data.settings] : [] GlobalStore.state.settings = (res.data.settings) ? [...res.data.settings] : []
GlobalStore.state.disciplines = (res.data.disciplines) ? [...res.data.disciplines] : [] GlobalStore.state.disciplines = (res.data.disciplines) ? [...res.data.disciplines] : []
GlobalStore.state.gallery = (res.data.gallery) ? [...res.data.gallery] : []
if (showall) { if (showall) {
GlobalStore.state.newstosent = (res.data.newstosent) ? [...res.data.newstosent] : [] GlobalStore.state.newstosent = (res.data.newstosent) ? [...res.data.newstosent] : []

View File

@@ -709,7 +709,7 @@ namespace Actions {
if (static_data.functionality.ENABLE_PROJECTS_LOADING) if (static_data.functionality.ENABLE_PROJECTS_LOADING)
await Projects.actions.dbLoad({ checkPending: true, onlyiffirsttime: true }) await Projects.actions.dbLoad({ checkPending: true, onlyiffirsttime: true })
console.log('add routes') // console.log('add routes')
GlobalStore.actions.addDynamicPages() GlobalStore.actions.addDynamicPages()

View File

@@ -58,10 +58,23 @@ export const colmailinglist = [
AddCol({ name: 'surname', label_trans: 'reg.surname' }), AddCol({ name: 'surname', label_trans: 'reg.surname' }),
AddCol({ name: 'email', label_trans: 'reg.email' }), AddCol({ name: 'email', label_trans: 'reg.email' }),
AddCol({ name: 'statesub', label_trans: 'newsletter.statesub', fieldtype: tools.FieldType.boolean }), AddCol({ name: 'statesub', label_trans: 'newsletter.statesub', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'wrongerr', label_trans: 'newsletter.wrongerr', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'lastid_newstosent', label_trans: 'reg.lastid_newstosent', fieldtype: tools.FieldType.string }), AddCol({ name: 'lastid_newstosent', label_trans: 'reg.lastid_newstosent', fieldtype: tools.FieldType.string }),
AddCol(DeleteRec) AddCol(DeleteRec)
] ]
export const colgallery = [
AddCol({ name: 'author_username', label_trans: 'gallery.author_username' }),
AddCol({ name: 'title', label_trans: 'gallery.title' }),
AddCol({ name: 'directory', label_trans: 'gallery.directory' }),
AddCol({
name: 'list',
label_trans: 'gallery.list',
fieldtype: tools.FieldType.listimages,
jointable: ''
}),
]
export const colmypage = [ export const colmypage = [
AddCol({ name: 'title', label_trans: 'pages.title' }), AddCol({ name: 'title', label_trans: 'pages.title' }),
AddCol({ name: 'path', label_trans: 'pages.path' }), AddCol({ name: 'path', label_trans: 'pages.path' }),
@@ -117,6 +130,7 @@ export const colnewstosent = [
AddCol({ name: 'lastemailsent_Job', label_trans: 'newsletter.lastemailsent_Job', fieldtype: tools.FieldType.date }), AddCol({ name: 'lastemailsent_Job', label_trans: 'newsletter.lastemailsent_Job', fieldtype: tools.FieldType.date }),
AddCol({ name: 'starting_job', label_trans: 'newsletter.starting_job', fieldtype: tools.FieldType.boolean }), AddCol({ name: 'starting_job', label_trans: 'newsletter.starting_job', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'finish_job', label_trans: 'newsletter.finish_job', fieldtype: tools.FieldType.boolean }), AddCol({ name: 'finish_job', label_trans: 'newsletter.finish_job', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'processing_job', label_trans: 'newsletter.processing_job', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'error_job', label_trans: 'newsletter.error_job', fieldtype: tools.FieldType.string }), AddCol({ name: 'error_job', label_trans: 'newsletter.error_job', fieldtype: tools.FieldType.string }),
AddCol(DeleteRec), AddCol(DeleteRec),
AddCol(DuplicateRec) AddCol(DuplicateRec)
@@ -418,6 +432,13 @@ export const fieldsTable = {
collabel: 'label', collabel: 'label',
onlyAdmin: true onlyAdmin: true
}, },
{
value: 'gallery',
label: 'Gallerie',
columns: colgallery,
colkey: '_id',
collabel: 'title',
},
{ {
value: 'templemail', value: 'templemail',
label: 'Template Email', label: 'Template Email',

View File

@@ -24,7 +24,7 @@ import translate from '@src/globalroutines/util'
import { RouteNames } from '@src/router/route-names' import { RouteNames } from '@src/router/route-names'
import { lists } from './lists' import { lists } from './lists'
import { static_data } from '@src/db/static_data' import { preloadedimages, static_data } from '@src/db/static_data'
import { IColl, ITimeLineEntry, ITimeLineMain } from '@src/model/GlobalStore' import { IColl, ITimeLineEntry, ITimeLineMain } from '@src/model/GlobalStore'
import { func_tools } from '@src/store/Modules/toolsext' import { func_tools } from '@src/store/Modules/toolsext'
import { serv_constants } from '@src/store/Modules/serv_constants' import { serv_constants } from '@src/store/Modules/serv_constants'
@@ -66,6 +66,7 @@ export const tools = {
TABEVENTS: 'myevents', TABEVENTS: 'myevents',
TABNEWSLETTER: 'newstosent', TABNEWSLETTER: 'newstosent',
TABGALLERY: 'gallery',
TABMAILINGLIST: 'mailinglist', TABMAILINGLIST: 'mailinglist',
TABMYPAGE: 'mypage', TABMYPAGE: 'mypage',
TABTEMPLEMAIL: 'templemail', TABTEMPLEMAIL: 'templemail',
@@ -139,6 +140,7 @@ export const tools = {
typeinrec: 128, typeinrec: 128,
multiselect: 256, multiselect: 256,
password: 512, password: 512,
listimages: 1024,
}, },
FieldTypeArr: [ FieldTypeArr: [
@@ -2120,29 +2122,25 @@ export const tools = {
} }
, ,
heightgallery() { heightgallery(coeff) {
return tools.heightGallVal().toString() + 'px' return tools.heightGallVal(coeff).toString() + 'px'
} }
, ,
heightGallVal() { heightGallVal(coeff = 1.33) {
let maxh2 = 0 let maxh2 = 0
if (Screen.width < 400) { let myw = Screen.width
maxh2 = 350 if (!this.isMobile())
} else if (Screen.width < 600) { if (GlobalStore.state.leftDrawerOpen)
maxh2 = 400 myw -= 300
} else if (Screen.width < 700) { if (!this.isMobile())
maxh2 = 450 if (GlobalStore.state.RightDrawerOpen)
} else if (Screen.width < 800) { myw -= 300
maxh2 = 550
} else if (Screen.width < 1000) { maxh2 = (myw / coeff) + 20
maxh2 = 650 if (maxh2 > 750)
} else if (Screen.width < 1200) {
maxh2 = 700
} else {
maxh2 = 750 maxh2 = 750
}
return maxh2 return maxh2
} }
@@ -2186,7 +2184,7 @@ export const tools = {
, ,
myheight_dialog() { myheight_dialog() {
if (Screen.width < 400) { if (Screen.width < 410) {
return '337' return '337'
} else if (Screen.width < 600) { } else if (Screen.width < 600) {
return '400' return '400'
@@ -2199,7 +2197,7 @@ export const tools = {
if (!!sized) { if (!!sized) {
return sized return sized
} else { } else {
if (Screen.width < 400) { if (Screen.width < 410) {
return 'max-height: 250px' return 'max-height: 250px'
} else { } else {
return 'max-height: 350px' return 'max-height: 350px'
@@ -2236,7 +2234,7 @@ export const tools = {
, ,
maxwidth_imgtitle() { maxwidth_imgtitle() {
if (Screen.width < 400) { if (Screen.width < 410) {
return 'max-width: 250px' return 'max-width: 250px'
} else { } else {
return 'max-width: 350px' return 'max-width: 350px'
@@ -2245,12 +2243,12 @@ export const tools = {
, ,
isMobile() { isMobile() {
return (Screen.width < 400) return (Screen.width < 450)
} }
, ,
mywidth_imgtitle() { mywidth_imgtitle() {
if (Screen.width < 400) { if (Screen.width < 450) {
return '250' return '250'
} else if (Screen.width < 600) { } else if (Screen.width < 600) {
return '350' return '350'
@@ -2266,7 +2264,7 @@ export const tools = {
, ,
showthumbnails() { showthumbnails() {
if (Screen.width < 400) { if (Screen.width < 410) {
return false return false
} else if (Screen.width < 600) { } else if (Screen.width < 600) {
return true return true
@@ -2404,7 +2402,7 @@ export const tools = {
const myimage = dir + file const myimage = dir + file
// console.log('includes = ', static_data.preLoadImages.map((a) => a.imgname).includes(myimage), myimage) // console.log('includes = ', static_data.preLoadImages.map((a) => a.imgname).includes(myimage), myimage)
let ris = '' let ris = ''
if (this.isMobile() && (static_data.preLoadImages.map((a) => a.imgname).includes(myimage))) { if (this.isMobile() && (preloadedimages().map((a) => a.imgname).includes(myimage))) {
ris = dir + 'mobile/' + file ris = dir + 'mobile/' + file
} else { } else {
ris = myimage ris = myimage
@@ -2451,14 +2449,21 @@ export const tools = {
return '"' + myevent.title + '" (' + tools.getstrDateEmailTime(mythis, myevent.dateTimeStart) + ')' return '"' + myevent.title + '" (' + tools.getstrDateEmailTime(mythis, myevent.dateTimeStart) + ')'
}, },
getlangforQuasar(mylang) {
if (mylang === 'enUs')
return 'en-us'
else
return mylang
},
setLangAtt(mylang) { setLangAtt(mylang) {
console.log('setLangAtt =', mylang) console.log('setLangAtt =', mylang)
// console.log('PRIMA this.$q.lang.isoName', this.$q.lang.isoName) // console.log('PRIMA this.$q.lang.isoName', this.$q.lang.isoName)
// dynamic import, so loading on demand only // dynamic import, so loading on demand only
import(`quasar/lang/${mylang}`).then((lang) => { import(`quasar/lang/${this.getlangforQuasar(mylang)}`).then((lang) => {
console.log(' Import dinamically lang =', lang) console.log(' Import dinamically lang =', lang)
Quasar.lang.set(lang.default) Quasar.lang.set(this.getlangforQuasar(lang.default))
import(`../../statics/i18n`).then(() => { import(`../../statics/i18n`).then(() => {
console.log(' *** MY LANG DOPO=', Quasar.lang.isoName) console.log(' *** MY LANG DOPO=', Quasar.lang.isoName)
}) })
@@ -2468,12 +2473,12 @@ export const tools = {
} }
, ,
getappname(mythis) { getappname(mythis, short) {
if (mythis === undefined) if (mythis === undefined)
return '' return ''
if (mythis.$t === undefined) if (mythis.$t === undefined)
return '' return ''
if (Screen.width < 400) { if (short) {
return mythis.$t('msg.myAppNameShort') return mythis.$t('msg.myAppNameShort')
} else { } else {
return mythis.$t('msg.myAppName') return mythis.$t('msg.myAppName')
@@ -2652,31 +2657,36 @@ export const tools = {
// return height() // return height()
return mythis.$q.screen.height return mythis.$q.screen.height
}, },
getwidth(mythis) { getwidth(mythis, withright = false, withleft = true) {
// return height() // return height()
let myw = mythis.$q.screen.width let myw = mythis.$q.screen.width
if (GlobalStore.state.leftDrawerOpen) if (withleft) {
myw -= 300 if (GlobalStore.state.leftDrawerOpen)
// if (GlobalStore.state.RightDrawerOpen) myw -= 300
// myw -= 300 }
if (withright)
if (GlobalStore.state.RightDrawerOpen)
myw -= 300
return myw return myw
}, },
getwidthscale(mythis, mywidth, maxwidth) { getwidthscale(mythis, mywidth, maxwidth) {
if (this.isMobile()) { if (this.isMobile()) {
if (mywidth > this.getwidth(mythis) - 20) // if (mywidth > this.getwidth(mythis) - 20)
mywidth = this.getwidth(mythis) - 20 mywidth = this.getwidth(mythis, false, false) - 32
// console.log('mywidth', mywidth)
return mywidth return mywidth
} else { } else {
// console.log('this.getwidth(mythis) = ', this.getwidth(mythis)) // console.log('this.getwidth(mythis) = ', this.getwidth(mythis))
let myw = mywidth + ((this.getwidth(mythis) - mywidth) * 0.6) let myw = mywidth + ((this.getwidth(mythis, true) - mywidth) * 0.6)
// console.log('myw1 = ', myw) // console.log('myw1 = ', myw)
if (myw > maxwidth) if (myw > maxwidth)
myw = maxwidth myw = maxwidth
if (myw > this.getwidth(mythis) - 20) if (myw > this.getwidth(mythis) - 24)
myw = this.getwidth(mythis) - 20 myw = this.getwidth(mythis) - 24
// console.log('myw = ', myw) // console.log('myw = ', myw)
return myw return myw
@@ -2826,6 +2836,24 @@ export const tools = {
return process.env.DEV return process.env.DEV
}, },
geturlupload() {
return process.env.MONGODB_HOST + '/upload'
},
getheaders() {
return [{ name: 'x-auth', value: UserStore.state.x_auth_token }]
},
getelembylang(arr) {
const mylang = toolsext.getLocale()
for (const elem in arr) {
if (arr[elem][mylang])
return arr[elem][mylang]
}
},
isChristmasHoliday() {
const now = new Date()
return ((now.getMonth() === 11 && now.getDate() > 20) || (now.getMonth() === 0 && now.getDate() < 8))
}
// getLocale() { // getLocale() {
// if (navigator.languages && navigator.languages.length > 0) { // if (navigator.languages && navigator.languages.length > 0) {

View File

@@ -1286,6 +1286,11 @@
"@types/minimatch" "*" "@types/minimatch" "*"
"@types/node" "*" "@types/node" "*"
"@types/googlemaps@^3.38.0":
version "3.38.1"
resolved "https://registry.yarnpkg.com/@types/googlemaps/-/googlemaps-3.38.1.tgz#34f0be176f899bab5563103d7103fa7c3a72c02c"
integrity sha512-6rVIwaJOKXAMzg+Cz22+fJkgQd8IMK8q9DBSL3Wg9GAffGCy71MdTEf+8T9bIa4mvC0DClEsyzwrOfuf9rM0Zg==
"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0":
version "2.0.1" version "2.0.1"
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff" resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff"