- Message notify when 'Ask Info' and user is not logged

- Ask Info and Book show message if not logged
- TableField fixed and added some features
This commit is contained in:
Paolo Arena
2019-11-04 20:29:35 +01:00
parent f30e6afd9e
commit b27f7e3cbf
26 changed files with 577 additions and 372 deletions

View File

@@ -33,11 +33,12 @@ import { IMessagePage, IMessage, IIdentity, MsgDefault } from '../../model'
import MixinUsers from '../../mixins/mixin-users'
import { CDateTime } from '../CDateTime'
import MixinOperator from '../../mixins/mixin-operator'
import { CMyAvatar } from '../CMyAvatar'
@Component({
mixins: [MixinOperator, MixinUsers],
name: 'CEventsCalendar',
components: { Logo, Footer, CTitle, CImgText, QDateTimeScroller, QDateScroller, CMySelect, CMyEditor, CDateTime }
components: { Logo, Footer, CTitle, CImgText, QDateTimeScroller, QDateScroller, CMySelect, CMyEditor, CDateTime, CMyAvatar }
})
export default class CEventsCalendar extends Vue {
public $q
@@ -442,6 +443,10 @@ export default class CEventsCalendar extends Vue {
if (!UserStore.state.isLogged || !UserStore.state.my.verified_email) {
// Visu right Toolbar to make SignIn
GlobalStore.state.RightDrawerOpen = true
tools.showNeutralNotif(this.$q, this.$t('login.needlogin'))
tools.scrollToTop()
// window.scrollTo(0, 0)
// this.$router.push('/signin')
} else {
console.log('addBookEventMenu')
@@ -461,6 +466,10 @@ export default class CEventsCalendar extends Vue {
if (!UserStore.state.isLogged || !UserStore.state.my.verified_email) {
// Visu right Toolbar to make SignIn
GlobalStore.state.RightDrawerOpen = true
tools.showNeutralNotif(this.$q, this.$t('login.needlogin'))
tools.scrollToTop()
// this.$router.push('/signin')
} else {
console.log('askForInfoEventMenu')

View File

@@ -55,17 +55,13 @@
<!--<span class="cal__teacher-content">{{myevent.teacher}}</span>-->
<span class="cal__teacher-content">
<q-chip>
<q-avatar>
<img :src="getImgTeacherByUsername(myevent.teacher)">
</q-avatar>
<CMyAvatar :myimg="getImgTeacherByUsername(myevent.teacher)"></CMyAvatar>
<span class="cal__teacher-content">{{getTeacherByUsername(myevent.teacher)}}</span>
</q-chip>
<span v-if="getImgTeacherByUsername(myevent.teacher2) && isValidUsername(myevent.teacher2)"
class="margin_avatar2"></span>
<q-chip v-if="getImgTeacherByUsername(myevent.teacher2) && isValidUsername(myevent.teacher2)">
<q-avatar>
<img :src="getImgTeacherByUsername(myevent.teacher2)">
</q-avatar>
<CMyAvatar :myimg="getImgTeacherByUsername(myevent.teacher2)"></CMyAvatar>
<span class="cal__teacher-content">{{getTeacherByUsername(myevent.teacher2)}}</span>
</q-chip>
</span>
@@ -297,6 +293,7 @@
<q-input v-model="bookEventForm.msgbooking" :label="$t('cal.msgbooking')+':'"
type="textarea" debounce="500"
input-class="myinput-area"
>
</q-input>
</q-card-section>
@@ -358,7 +355,8 @@
<q-card class="text-white windowcol">
<q-card-section>
<q-input v-model="askInfoForm.message" :label="$t('cal.msgbooking')+':'"
autofocus debounce="500" type="textarea">
autofocus debounce="500" type="textarea"
input-class="myinput-area">
</q-input>
</q-card-section>
</q-card>
@@ -610,17 +608,13 @@
class="margin_with"></span></span>
<q-chip>
<q-avatar>
<img :src="getImgTeacherByUsername(event.teacher)">
</q-avatar>
<CMyAvatar :myimg="getImgTeacherByUsername(event.teacher)"></CMyAvatar>
<span class="cal__teacher-content">{{getTeacherByUsername(event.teacher)}}</span>
</q-chip>
<span v-if="getImgTeacherByUsername(event.teacher2) && isValidUsername(event.teacher2)"
class="margin_avatar2"></span>
<q-chip v-if="getImgTeacherByUsername(event.teacher2) && isValidUsername(event.teacher2)">
<q-avatar>
<img :src="getImgTeacherByUsername(event.teacher2)">
</q-avatar>
<CMyAvatar :myimg="getImgTeacherByUsername(event.teacher2)"></CMyAvatar>
<span class="cal__teacher-content">{{getTeacherByUsername(event.teacher2)}}</span>
</q-chip>

View File

@@ -11,12 +11,10 @@ import { SingleProject } from '../projects/SingleProject'
import { lists } from '../../store/Modules/lists'
import { IParamsQuery } from '../../model/GlobalStore'
import { fieldsTable } from '../../store/Modules/fieldsTable'
import { CDateTime } from '../CDateTime'
import { CMyToggleList } from '../CMyToggleList'
import { CMyChipList } from '../CMyChipList'
import { CMyPopupEdit } from '../CMyPopupEdit'
@Component({
components: { CDateTime, CMyToggleList, CMyChipList }
components: { CMyPopupEdit }
})
export default class CGridTableRec extends Vue {
@Prop({ required: false }) public prop_mytable: string
@@ -54,7 +52,7 @@ export default class CGridTableRec extends Vue {
public valPrec: string = ''
public separator: 'horizontal'
public filter: string = ''
public filter = undefined
public rowsel: any
public dark: boolean = true
public canEdit: boolean = false
@@ -84,8 +82,16 @@ export default class CGridTableRec extends Vue {
public undoVal() {
console.log('undoVal', 'colsel', this.colsel, 'valprec', this.valPrec, 'this.colkey', this.colkey, 'this.selected', this.rowsel)
console.table(this.serverData)
if (this.colsel)
this.rowsel[this.colsel.field] = this.valPrec
if (this.colsel) {
if (this.colsel.subfield !== '') {
if (this.rowsel[this.colsel.field] === undefined)
this.rowsel[this.colsel.field] = {}
this.rowsel[this.colsel.field][this.colsel.subfield] = this.valPrec
} else {
this.rowsel[this.colsel.field] = this.valPrec
}
}
// this.serverData[this.colsel] = this.valPrec
}
@@ -93,13 +99,29 @@ export default class CGridTableRec extends Vue {
public SaveValue(newVal, valinitial) {
console.log('SaveValue', newVal, 'rowsel', this.rowsel)
// Update value in table memory
if (this.colsel.subfield !== '') {
if (this.rowsel[this.colsel.field] === undefined)
this.rowsel[this.colsel.field] = {}
this.rowsel[this.colsel.field][this.colsel.subfield] = newVal
} else {
this.rowsel[this.colsel.field] = newVal
}
const mydata = {
id: this.idsel,
table: this.mytable,
fieldsvalue: {}
}
mydata.fieldsvalue[this.colsel.field] = newVal
if (this.colsel.subfield !== '') {
if (mydata.fieldsvalue[this.colsel.field] === undefined) {
mydata.fieldsvalue[this.colsel.field] = {}
}
mydata.fieldsvalue[this.colsel.field][this.colsel.subfield] = newVal
} else {
mydata.fieldsvalue[this.colsel.field] = newVal
}
this.valPrec = valinitial
@@ -124,7 +146,7 @@ export default class CGridTableRec extends Vue {
this.colExtra = []
this.mycolumns.forEach((elem) => {
if (elem.field !== tools.NOFIELD)
this.colVisib.push(elem.field)
this.colVisib.push(elem.field + elem.subfield)
if (elem.visible && elem.field === tools.NOFIELD)
this.colExtra.push(elem.name)
@@ -138,7 +160,7 @@ export default class CGridTableRec extends Vue {
}
public onRequest(props) {
console.log('onRequest')
console.log('onRequest', 'filter = ' , this.filter)
const { page, rowsPerPage, rowsNumber, sortBy, descending } = props.pagination
const filter = this.filter
@@ -273,13 +295,6 @@ export default class CGridTableRec extends Vue {
return this.returnedCount
}
public getclassCol(col) {
let mycl = (col.disable || !this.canEdit) ? '' : 'colmodif'
mycl += (col.fieldtype === tools.FieldType.date) ? ' coldate flex flex-container' : ''
return mycl
}
public async createNewRecord() {
this.loading = true
@@ -331,16 +346,19 @@ export default class CGridTableRec extends Vue {
}
public refresh() {
this.serverData = []
console.log('refresh')
// console.log('this.search', this.search)
if (!!this.search && this.search !== '')
this.filter = this.search
else
this.filter = ''
this.filter = undefined
// console.log('this.filter', this.filter)
this.onRequest({
pagination: this.pagination
pagination: this.pagination,
})
}
@@ -373,38 +391,6 @@ export default class CGridTableRec extends Vue {
}
}
public visuValByType(col: IColGridTable, val) {
if (col.fieldtype === tools.FieldType.date) {
if (val === undefined) {
return '[]'
} else {
return tools.getstrDateTime(val)
}
} else if (col.fieldtype === tools.FieldType.boolean) {
return (val) ? this.$t('dialog.yes') : this.$t('dialog.no')
} else if (col.fieldtype === tools.FieldType.binary) {
if (val === undefined)
return '[---]'
else
return fieldsTable.getArrStrByValueBinary(this, col, val)
} else {
if (val === undefined)
return '[]'
else if (val === '') {
return '[]'
} else {
let mystr = tools.firstchars(val, tools.MAX_CHARACTERS)
if (val) {
if (val.length > tools.MAX_CHARACTERS)
mystr += '...'
} else {
return val
}
return mystr
}
}
}
public changeCol(newval) {
tools.setCookie(this.mytable, this.colVisib.join('|'))
}
@@ -420,6 +406,13 @@ export default class CGridTableRec extends Vue {
mytab = this.tablesList.find((rec) => rec.value === this.tablesel)
}
if (mytab === undefined) {
this.tablesel = this.tablesList[0].value
if (this.tablesList) {
mytab = this.tablesList.find((rec) => rec.value === this.tablesel)
}
}
console.log('this.tablesel', this.tablesel, 'mytab', mytab)
if (mytab) {
@@ -428,10 +421,10 @@ export default class CGridTableRec extends Vue {
this.mycolumns = [...mytab.columns]
}
console.log('this.mycolumns')
console.log(this.mycolumns)
console.log('this.tablesList:')
console.table(this.tablesList)
// console.log('this.mycolumns')
// console.log(this.mycolumns)
// console.log('this.tablesList:')
// console.table(this.tablesList)
if (!!this.mycolumns) {
this.mycolumns.forEach((rec: IColGridTable) => {

View File

@@ -20,7 +20,7 @@
<q-tr :props="props">
<q-th
v-for="col in props.cols"
v-if="colVisib.includes(col.field)"
v-if="colVisib.includes(col.field + col.subfield)"
:key="col.name"
:props="props"
class="text-italic text-weight-bold"
@@ -56,8 +56,9 @@
<q-select
v-if="mytable"
v-model="colVisib"
rounded
outlined
multiple
borderless
dense
options-dense
:display-value="$t('grid.columns')"
@@ -90,95 +91,16 @@
</template>
<q-tr v-if="mytable" slot="body" slot-scope="props" :props="props">
<q-td v-for="col in mycolumns" :key="col.name" :props="props" v-if="colVisib.includes(col.field)">
<div v-if="col.fieldtype === tools.FieldType.date">
<div :class="getclassCol(col)">
<CDateTime
:label="col.label"
class="cursor-pointer"
:valueDate="props.row[col.name]"
:readonly="false"
:dense="true"
:canEdit="canEdit"
@savetoclose="SaveValue"
@show="selItem(props.row, col)"
>
</CDateTime>
</div>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.boolean">
<div :class="getclassCol(col)">
{{ visuValByType(col, props.row[col.name]) }}
<q-popup-edit v-if="canEdit" v-model="props.row[col.name]" :disable="col.disable"
:title="col.title" buttons
@save="SaveValue" @show="selItem(props.row, col)">
<q-checkbox v-model="props.row[col.name]" label="">
<q-td v-for="col in mycolumns" :key="col.name" :props="props" v-if="colVisib.includes(col.field + col.subfield)">
<CMyPopupEdit :canEdit="canEdit"
:col="col"
:row.sync="props.row"
:field="col.field"
:subfield="col.subfield"
@save="SaveValue"
@show="selItem(props.row, col)">
</q-checkbox>
{{ visuValByType(col, props.row[col.name]) }}
</q-popup-edit>
</div>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.binary">
<div :class="getclassCol(col)">
<CMyChipList
:value="props.row[col.name]"
: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>
<q-popup-edit v-if="canEdit" v-model="props.row[col.name]" :disable="col.disable"
:title="col.title" buttons
@save="SaveValue" @show="selItem(props.row, col)">
<CMyToggleList :label="col.title"
:options="db_fieldsTable.getTableJoinByName(col.jointable)"
:value.sync="props.row[col.name]"
:optval="db_fieldsTable.getKeyByTable(col.jointable)"
:optlab="db_fieldsTable.getLabelByTable(col.jointable)"
>
</CMyToggleList>
</q-popup-edit>
</div>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.string">
<div :class="getclassCol(col)">
{{ visuValByType(col, props.row[col.name]) }}
<q-popup-edit v-if="canEdit" v-model="props.row[col.name]" :disable="col.disable"
:title="col.title" buttons
@save="SaveValue" @show="selItem(props.row, col)">
<q-input v-model="props.row[col.name]"
autofocus
>
</q-input>
</q-popup-edit>
</div>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.html">
<div :class="getclassCol(col)">
{{ visuValByType(col, props.row[col.name]) }}
<q-popup-edit v-if="canEdit" v-model="props.row[col.name]" :disable="col.disable"
:title="col.title" buttons
@save="SaveValue" @show="selItem(props.row, col)">
<q-input v-model="props.row[col.name]"
autofocus
@keyup.enter.stop
type="textarea">
</q-input>
</q-popup-edit>
</div>
</div>
</CMyPopupEdit>
</q-td>
<q-td v-for="col in mycolumns" :key="col.name" :props="props" v-if="colExtra.includes(col.name)">
<div v-if="col.action && visCol(col)">

View File

@@ -3,7 +3,6 @@ import { Component, Prop, Watch } from 'vue-property-decorator'
import { tools } from '../../store/Modules/tools'
import { toolsext } from '@src/store/Modules/toolsext'
import { IOperators } from '../../model/GlobalStore'
@Component({
name: 'CMySelect'
@@ -26,14 +25,7 @@ export default class CMySelect extends Vue {
return tools
}
public nothing() {
}
public changeval(newval) {
// console.log('changeval', newval)
// const newvallab = newval[`${this.optval}`]
// this.myvalue = newvallab
this.$emit('update:value', newval)
}

View File

@@ -2,8 +2,9 @@
<div>
<div v-if="useinput">
<q-select
rounded
outlined
:input-class="myclass"
filled
v-model="myvalue"
:use-input="useinput"
input-debounce="0"
@@ -20,8 +21,10 @@
</div>
<div v-else>
<q-select
rounded
outlined
dense
:input-class="myclass"
filled
v-model="myvalue"
:options="options"
:option-value="optval"

View File

@@ -12,6 +12,7 @@ import { static_data } from '@src/db/static_data'
import Quasar from 'quasar'
import { FormNewsletter } from '../FormNewsletter'
import { IUserState } from '../../model'
@Component({
name: 'Footer',
@@ -32,18 +33,25 @@ export default class Footer extends Vue {
}
get TelegramSupport() {
return db_data.TELEGRAM_SUPPORT
return GlobalStore.getters.getValueSettingsByKey('TELEGRAM_SUPPORT')
}
get Whatsapp_Cell() {
return GlobalStore.getters.getValueSettingsByKey('WHATSAPP_CELL')
}
get FBPage() {
return db_data.URL_FACEBOOK
const fb = GlobalStore.getters.getValueSettingsByKey('URL_FACEBOOK')
return fb
}
get InstagramPage() {
return db_data.URL_INSTAGRAM
const insta = GlobalStore.getters.getValueSettingsByKey('URL_INSTAGRAM')
return insta
}
get static_data(){
get static_data() {
return static_data
}
}

View File

@@ -80,6 +80,9 @@
<q-page-scroller position="bottom-right" :scroll-offset="850" :offset="[18, 18]" style="opacity: 0.3">
<q-btn fab icon="keyboard_arrow_up" color="accent"/>
</q-page-scroller>
<q-page-sticky position="bottom-right" :offset="[18, 78]">
<q-btn fab icon="fab fa-whatsapp" color="green" />
</q-page-sticky>
</div>
</template>

View File

@@ -16,13 +16,14 @@ import { static_data } from '../../db/static_data'
import globalroutines from '../../globalroutines'
import MixinUsers from '../../mixins/mixin-users'
import { CMyAvatar } from '../CMyAvatar'
@Component({
name: 'Header',
mixins: [MixinUsers],
components: {
drawer,
messagePopover, CSignIn
messagePopover, CSignIn, CMyAvatar
}
})

View File

@@ -109,9 +109,7 @@
</q-btn>
<q-btn class="q-mx-xs" v-if="static_data.functionality.SHOW_USER_MENU && isLogged" round dense flat
@click="rightDrawerOpen = !rightDrawerOpen">
<q-avatar size="30px">
<img :src="getMyImg">
</q-avatar>
<CMyAvatar :myimg="getMyImg"></CMyAvatar>
</q-btn>
</q-toolbar>
@@ -130,6 +128,7 @@
</q-drawer>
<!-- USER BAR -->
<q-drawer v-if="static_data.functionality.SHOW_USER_MENU" v-model="rightDrawerOpen" side="right" elevated>
<div id="profile">
@@ -138,9 +137,8 @@
</q-img>
<div class="absolute-top bg-transparent text-black center_img" style="margin-top: 10px;">
<q-avatar class="q-mb-sm center_img">
<img :src="`../../` + getMyImg">
</q-avatar>
<CMyAvatar :myimg="getMyImg"></CMyAvatar>
<q-btn class="absolute-top-right" style="margin-right: 10px; color: white;"
dense flat round icon="close" @click="rightDrawerOpen = !rightDrawerOpen">
</q-btn>

View File

@@ -7,6 +7,8 @@ export * from './CBook'
export * from './CMyPage'
export * from './CTitle'
export * from './CMySelect'
export * from './CMyAvatar'
export * from './CMyPopupEdit'
export * from './CMyToggleList'
export * from './CMyChipList'
export * from './CMyEditor'