- Booking not available if is in the past

- Delete record only if "Active Edit" is on
- Image stretch width reduced.
- Signin more dense
This commit is contained in:
Paolo Arena
2019-10-16 15:27:49 +02:00
parent 9462f6ef24
commit 35b360bf9a
14 changed files with 160 additions and 76 deletions

View File

@@ -858,4 +858,17 @@ export default class CEventsCalendar extends Vue {
get mythis() {
return this
}
public isEventEnabled(myevent) {
// check if event is in the past
const datenow = tools.addDays(tools.getDateNow(), -1)
let dateEvent = new Date(myevent.date + ' 00:00:00')
if (myevent.days) {
dateEvent = tools.addDays(dateEvent, myevent.days)
}
return (dateEvent >= datenow)
}
}

View File

@@ -90,7 +90,7 @@ $t('
</q-card-section>
<q-card-actions align="right">
<q-btn rounded v-if="!myevent.nobookable && static_data.functionality.BOOKING_EVENTS"
color="primary" @click="addBookEventMenu(myevent)"
color="primary" @click="addBookEventMenu(myevent)" :disable="!isEventEnabled(myevent)"
:label="$t('cal.booking')">
</q-btn>
<q-btn v-else :label="$t('dialog.ok')" color="primary" v-close-popup></q-btn>
@@ -258,7 +258,7 @@ $t('
<div class="q-pa-xs">
<q-card class="text-white windowcol">
<q-card-section>
<q-checkbox :disable="(bookEventpage.bookedevent && bookEventpage.bookedevent.booked) || (bookEventpage.bookedevent === undefined)" style="color: black;" v-model="bookEventForm.booked" :label="$t('cal.bookingtextdefault')" color="green">
<q-checkbox :disable="((bookEventpage.bookedevent && bookEventpage.bookedevent.booked) || (bookEventpage.bookedevent === undefined)) || !isEventEnabled(myevent)" style="color: black;" v-model="bookEventForm.booked" :label="$t('cal.bookingtextdefault')" color="green">
</q-checkbox>
<div v-if="bookEventForm.booked" class="q-gutter-md centermydiv" style="max-width: 150px; margin-top:10px;">
@@ -550,7 +550,7 @@ $t('
<q-btn rounded outline
v-if="!event.nobookable && !isAlreadyBooked(event) && static_data.functionality.BOOKING_EVENTS"
color="primary" @click="addBookEventMenu(event)"
:label="$t('cal.booking')">
:label="$t('cal.booking')" :disable="!isEventEnabled(event)">
</q-btn>
<q-btn rounded outline
v-if="!event.nobookable && isAlreadyBooked(event) && static_data.functionality.BOOKING_EVENTS"

View File

@@ -16,6 +16,8 @@ export default class CGridTableRec extends Vue {
@Prop({ required: true }) public mytitle: string
@Prop({ required: true }) public mycolumns: any[]
@Prop({ required: true }) public colkey: string
@Prop({ required: false, default: '' }) public nodataLabel: string
@Prop({ required: false, default: '' }) public noresultLabel: string
public $q
public $t
public loading: boolean = false
@@ -42,6 +44,7 @@ export default class CGridTableRec extends Vue {
public returnedData
public returnedCount
public colVisib: any[] = []
public colExtra: any[] = []
get canEdit() {
return this.funcActivated.includes(lists.MenuAction.CAN_EDIT_TABLE)
@@ -101,8 +104,12 @@ export default class CGridTableRec extends Vue {
public created() {
// this.serverData = this.mylist.slice() // [{ chiave: 'chiave1', valore: 'valore 1' }]
this.mycolumns.forEach((elem) => {
if (elem.field)
if (elem.field !== '')
this.colVisib.push(elem.field)
if (elem.visible && elem.field === '')
this.colExtra.push(elem.name)
})
}
@@ -253,7 +260,8 @@ export default class CGridTableRec extends Vue {
public mounted() {
this.mycolumns.forEach((rec: IColGridTable) => {
rec.label = this.$t(rec.label_trans)
if (rec.label_trans)
rec.label = this.$t(rec.label_trans)
})
this.onRequest({
@@ -274,4 +282,24 @@ export default class CGridTableRec extends Vue {
}
}
public visCol(col) {
if (col.visuonlyEditVal) {
if (this.canEdit) {
return col.visuonlyEditVal
} else {
return false
}
} else {
return true
}
}
public visuValByType(col, val) {
if (col.isdate) {
return tools.getstrDateTime(val)
} else {
return val
}
}
}

View File

@@ -10,6 +10,8 @@
@request="onRequest"
binary-state-sort
:visible-columns="colVisib"
:no-data-label="nodataLabel"
:no-results-label="noresultLabel"
>
@@ -20,7 +22,7 @@
v-if="colVisib.includes(col.field)"
:key="col.name"
:props="props"
class="text-italic text-red text-weight-bold"
class="text-italic text-weight-bold"
>
{{ col.label }}
</q-th>
@@ -45,7 +47,7 @@
borderless
dense
options-dense
display-value="Colonne"
:display-value="$t('grid.columns')"
emit-value
map-options
:options="mycolumns"
@@ -57,14 +59,9 @@
</template>
<q-tr 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.action">
<q-btn flat round color="red" icon="fas fa-trash-alt"
@click="clickFunz(props.row, col)"></q-btn>
</div>
<div v-else :class="getclassCol(col)">
{{ props.row[col.name] }}
<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.field)">
@@ -73,6 +70,12 @@
</q-popup-edit>
</div>
</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)">
<q-btn flat round color="red" :icon="col.icon" size="sm"
@click="clickFunz(props.row, col)"></q-btn>
</div>
</q-td>
</q-tr>
<!--
<q-btn

View File

@@ -48,6 +48,7 @@
@media (max-width: 800px) {
.myclimg {
max-height: 400px !important;
width: 100%;
}
}

View File

@@ -12,7 +12,7 @@
<q-input
v-model="signin.username"
rounded outlined
rounded outlined dense
@blur="$v.signin.username.$touch"
:error="$v.signin.username.$error"
:error-message="`${errorMsg('username', $v.signin.username)}`"
@@ -27,7 +27,7 @@
<q-input
v-model="signin.password"
type="password"
rounded outlined
rounded outlined dense
@blur="$v.signin.password.$touch"
:error="$v.signin.password.$error"
:error-message="`${errorMsg('password', $v.signin.password)}`"
@@ -37,27 +37,26 @@
</template>
</q-input>
<div>
<a :href="getlinkforgetpwd">{{$t('reg.forgetpassword')}}</a>
<div class="text-center" style="margin-bottom: 10px;">
<a :href="getlinkforgetpwd" style="color:gray;">{{$t('reg.forgetpassword')}}</a>
</div>
<br>
<q-card class="flex flex-center">
<!--<q-btn v-if="$myconfig.socialLogin.facebook" :loading="loading" class="q-mb-md q-mr-md" rounded icon="fab fa-facebook-f" size="sm" color="blue-10" text-color="white" @click="facebook" :label="$t('components.authentication.login.facebook')"/>-->
<!--
<q-btn v-if="$myconfig.socialLogin.facebook" class="q-mb-md q-mr-md" rounded icon="fab fa-facebook-f" size="sm" color="blue-10" text-color="white" @click="facebook" :label="$t('components.authentication.login.facebook')"/>
<q-btn v-if="$myconfig.socialLogin.google" class="q-mb-md q-mr-md" rounded icon="fab fa-google" size="sm" color="deep-orange-14" text-color="white" @click="google" :label="$t('components.authentication.login.google')"/>
-->
</q-card>
<!--<q-card class="flex flex-center">-->
<!--&lt;!&ndash;<q-btn v-if="$myconfig.socialLogin.facebook" :loading="loading" class="q-mb-md q-mr-md" rounded icon="fab fa-facebook-f" size="sm" color="blue-10" text-color="white" @click="facebook" :label="$t('components.authentication.login.facebook')"/>&ndash;&gt;-->
<!--&lt;!&ndash;-->
<!--<q-btn v-if="$myconfig.socialLogin.facebook" class="q-mb-md q-mr-md" rounded icon="fab fa-facebook-f" size="sm" color="blue-10" text-color="white" @click="facebook" :label="$t('components.authentication.login.facebook')"/>-->
<!--<q-btn v-if="$myconfig.socialLogin.google" class="q-mb-md q-mr-md" rounded icon="fab fa-google" size="sm" color="deep-orange-14" text-color="white" @click="google" :label="$t('components.authentication.login.google')"/>-->
<!--&ndash;&gt;-->
<!--</q-card>-->
<div align="center">
<q-btn rounded size="lg" color="primary" @click="submit"
<q-btn rounded size="md" color="primary" @click="submit"
:disable="$v.$error || iswaitingforRes">{{$t('login.enter')}}
</q-btn>
</div>
<div align="center" style="margin-top:10px;">
<q-btn flat rounded size="lg" color="primary" to="/signup">{{$t('reg.submit')}}
<q-btn flat rounded size="md" color="primary" to="/signup">{{$t('reg.submit')}}
</q-btn>
</div>

View File

@@ -7,7 +7,7 @@ import { CSignIn } from '../../components/CSignIn'
import { GlobalStore, UserStore } from '@modules'
// import { StateConnection } from '../../model'
import { Watch } from 'vue-property-decorator'
import { Prop, Watch } from 'vue-property-decorator'
import { tools } from '../../store/Modules/tools'
import { toolsext } from '@src/store/Modules/toolsext'
@@ -24,6 +24,7 @@ import globalroutines from '../../globalroutines'
})
export default class Header extends Vue {
@Prop({ required: false, default: '' }) public extraContent: string
public $t
public $v
public $q

View File

@@ -108,7 +108,7 @@
@click="right = !right">
</q-btn>
<q-btn v-if="static_data.functionality.SHOW_USER_MENU && isLogged" dense flat round
icon="img:statics/images/avatar-1.svg" @click="right = !right">
icon="img:statics/images/avatar/avatar3_small.png" @click="right = !right">
</q-btn>
</q-toolbar>
@@ -136,12 +136,13 @@
<div class="absolute-top bg-transparent text-black center_img" style="margin-top: 10px;">
<q-avatar class="q-mb-sm center_img">
<img src="../../statics/images/avatar-1.svg">
<img src="../../statics/images/avatar/avatar3_small.png">
</q-avatar>
<q-btn class="absolute-top-right" style="margin-right: 10px; color: white;"
dense flat round icon="close" @click="right = !right">
</q-btn>
<div v-if="isLogged" class="text-weight-bold text-user">{{ Username }} - {{ myName }} <span v-if="isAdmin"> [Admin]</span><span v-if="isManager"> [Manager]</span></div>
<div v-if="isLogged" class="text-weight-bold text-user">{{ Username }} - {{ myName }} <span
v-if="isAdmin"> [Admin]</span><span v-if="isManager"> [Manager]</span></div>
<div v-else class="text-user text-italic bg-red">
{{ $t('user.loggati') }}
</div>
@@ -172,8 +173,11 @@
</div>
</div>
</div>
<div v-if="isLogged" class="q-mt-lg"><br><br></div>
<slot></slot>
</q-drawer>
</div>
</template>

View File

@@ -17,3 +17,4 @@ export * from './BannerCookies'
export * from './PagePolicy'
export * from './FormNewsletter'
export * from './CGridTableRec'
export * from './Shen/CTesseraElettronica'