Friends, search
This commit is contained in:
@@ -79,7 +79,7 @@
|
||||
<q-chip>
|
||||
<q-avatar v-if="getWhereIcon(myevent.wherecode)">
|
||||
<img
|
||||
:src="`../../public/images/avatar/` + getWhereIcon(myevent.wherecode)"
|
||||
:src="`images/avatar/` + getWhereIcon(myevent.wherecode)"
|
||||
alt="Località">
|
||||
</q-avatar>
|
||||
<q-avatar v-else color="blue" font-size="20px" text-color="white" icon="home">
|
||||
@@ -837,7 +837,7 @@
|
||||
<q-chip>
|
||||
<q-avatar v-if="getWhereIcon(event.wherecode)">
|
||||
<img
|
||||
:src="`../../public/images/avatar/` + getWhereIcon(event.wherecode)"
|
||||
:src="`images/avatar/` + getWhereIcon(event.wherecode)"
|
||||
:alt="event.wherecode">
|
||||
</q-avatar>
|
||||
<q-avatar color="blue" font-size="20px" text-color="white" icon="home">
|
||||
|
||||
@@ -6,6 +6,7 @@ import { IGallery, IImgGallery } from 'model'
|
||||
import { CMyPage } from '@/components/CMyPage'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { costanti } from '@costanti'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CGallery',
|
||||
@@ -246,7 +247,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function getfullname(rec: any) {
|
||||
return 'upload/' + props.directory + '/' + rec.imagefile
|
||||
return costanti.DIR_UPLOAD + props.directory + '/' + rec.imagefile
|
||||
}
|
||||
|
||||
function copytoclipboard(rec: any) {
|
||||
@@ -306,7 +307,7 @@ export default defineComponent({
|
||||
if (tools.getextfile(gallerylistery.imagefile) === 'pdf')
|
||||
return 'images/images/pdf.jpg'
|
||||
else
|
||||
return 'upload/' + props.directory + '/' + gallerylistery.imagefile
|
||||
return costanti.DIR_UPLOAD + props.directory + '/' + gallerylistery.imagefile
|
||||
} else {
|
||||
return 'images/noimg.png';
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
accept=".jpg, image/*, .pdf"
|
||||
:url="getUrl()"
|
||||
:headers="tools.getheaders()"
|
||||
:max-file-size="2000000"
|
||||
:max-file-size="3000000"
|
||||
multiple
|
||||
auto-upload
|
||||
hide-upload-btn
|
||||
|
||||
@@ -18,6 +18,7 @@ import {
|
||||
} from '../../model'
|
||||
import { lists } from '../../store/Modules/lists'
|
||||
import { IParamsQuery } from '../../model/GlobalStore'
|
||||
import { CMyUser } from '../CMyUser'
|
||||
import { CMyPopupEdit } from '../CMyPopupEdit'
|
||||
import { CMyFieldDb } from '../CMyFieldDb'
|
||||
import { CMySelect } from '../CMySelect'
|
||||
@@ -53,6 +54,11 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
hint: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: 'Cerca',
|
||||
},
|
||||
prop_search: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
@@ -68,6 +74,16 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
showType: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 0,
|
||||
},
|
||||
finder_noNull: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
vertical: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
@@ -131,6 +147,10 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: {},
|
||||
},
|
||||
options: {
|
||||
required: false,
|
||||
default: 0,
|
||||
},
|
||||
prop_pagination: {
|
||||
type: Object as PropType<IPagination>,
|
||||
required: false,
|
||||
@@ -148,7 +168,7 @@ export default defineComponent({
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
components: { CMyPopupEdit, CTitleBanner, CMyFieldDb, CMySelect },
|
||||
components: { CMyPopupEdit, CTitleBanner, CMyFieldDb, CMySelect, CMyUser },
|
||||
setup(props, { emit }) {
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
@@ -272,10 +292,10 @@ export default defineComponent({
|
||||
return true
|
||||
}
|
||||
} else {
|
||||
return true
|
||||
return false
|
||||
}
|
||||
// if (userStore.isAdmin || userStore.isManager)
|
||||
// return true
|
||||
if (userStore.isAdmin || userStore.isManager)
|
||||
return true
|
||||
}
|
||||
|
||||
// emulate 'SELECT count(*) FROM ...WHERE...'
|
||||
@@ -397,7 +417,7 @@ export default defineComponent({
|
||||
})
|
||||
}
|
||||
}
|
||||
if (false && nosearch && props.finder) {
|
||||
if ((false && nosearch && props.finder) || (props.finder_noNull && nosearch)) {
|
||||
returnedData.value = []
|
||||
returnedCount = 0
|
||||
return true
|
||||
@@ -423,6 +443,7 @@ export default defineComponent({
|
||||
descending,
|
||||
userId: userStore.my._id,
|
||||
codeId: '',
|
||||
options: props.options,
|
||||
}
|
||||
|
||||
params.codeId = mycodeid.value
|
||||
@@ -820,7 +841,7 @@ export default defineComponent({
|
||||
|
||||
|
||||
function clickFunz(item: any, col: IColGridTable) {
|
||||
if (col.action) {
|
||||
if (!!col && col.action) {
|
||||
|
||||
const table = mytable.value
|
||||
const ok = translate('dialog.yes')
|
||||
|
||||
@@ -174,7 +174,7 @@
|
||||
|
||||
<div v-if="prop_search" class="q-mr-sm">
|
||||
<q-input
|
||||
v-model="search" filled dense type="search" debounce="500" hint="Cerca"
|
||||
v-model="search" filled dense type="search" debounce="500" :hint="hint"
|
||||
v-on:keyup.enter="doSearch">
|
||||
<template v-slot:after>
|
||||
<q-btn v-if="mytable" dense label="" color="primary" @click="refresh" icon="search"></q-btn>
|
||||
@@ -251,7 +251,14 @@
|
||||
|
||||
|
||||
<template v-slot:item="props">
|
||||
<div v-if="showType === costanti.SHOW_USERINFO">
|
||||
<CMyUser
|
||||
:mycontact="props.row">
|
||||
</CMyUser>
|
||||
|
||||
</div>
|
||||
<div
|
||||
v-else
|
||||
class="q-pa-xs col-xs-12 col-sm-6 col-md-4 col-lg-3 grid-style-transition"
|
||||
:style="props.selected ? 'transform: scale(0.95);' : ''"
|
||||
>
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
<!-- Se c'è un link, allora -->
|
||||
<q-btn
|
||||
class="text-center boldhigh" v-if="myevent.linkpdf" size="md" type="a"
|
||||
:href="`../../public/` + myevent.linkpdf"
|
||||
:href="myevent.linkpdf"
|
||||
target="_blank"
|
||||
ripple rounded :label="myevent.title"
|
||||
:color="myevent.bgcolor" text-color="white" glossy>
|
||||
@@ -117,7 +117,7 @@
|
||||
<q-chip>
|
||||
<q-avatar v-if="getWhereIcon(myevent.wherecode)">
|
||||
<img
|
||||
:src="`../../public/images/avatar/` + getWhereIcon(myevent.wherecode)"
|
||||
:src="`images/avatar/` + getWhereIcon(myevent.wherecode)"
|
||||
alt="località">
|
||||
</q-avatar>
|
||||
<q-avatar
|
||||
@@ -152,7 +152,7 @@
|
||||
<div class="row justify-start q-ma-md">
|
||||
<q-btn
|
||||
v-if="myevent.linkpdf"
|
||||
size="md" type="a" :href="`../../public/` + myevent.linkpdf"
|
||||
size="md" type="a" :href="myevent.linkpdf"
|
||||
target="_blank" rounded outline
|
||||
color="primary" icon="info"
|
||||
:label="$t('cal.showpdf')">
|
||||
|
||||
4
src/components/CMyUser/CMyUser.scss
Executable file
4
src/components/CMyUser/CMyUser.scss
Executable file
@@ -0,0 +1,4 @@
|
||||
.myflex{
|
||||
display: flex;
|
||||
flex: 1;
|
||||
}
|
||||
86
src/components/CMyUser/CMyUser.ts
Executable file
86
src/components/CMyUser/CMyUser.ts
Executable file
@@ -0,0 +1,86 @@
|
||||
import { defineComponent, onMounted, PropType, ref, watch } from 'vue'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { IImgGallery, IUserFields, IUserProfile } from 'model'
|
||||
import { costanti } from '@costanti'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMyUser',
|
||||
emits: ['setCmd'],
|
||||
props: {
|
||||
mycontact: {
|
||||
type: Object as PropType<IUserFields | null>,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
myusername: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
visu: {
|
||||
type: Number,
|
||||
required: true,
|
||||
}
|
||||
},
|
||||
|
||||
setup(props, { emit }) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
const $router = useRouter()
|
||||
const $route = useRoute()
|
||||
|
||||
const username = ref('')
|
||||
|
||||
const contact = ref(<IUserFields | null>null)
|
||||
|
||||
watch(() => props.mycontact, (newval, oldval) => {
|
||||
console.log('watch: mycontact')
|
||||
mounted()
|
||||
})
|
||||
|
||||
function mounted() {
|
||||
if (!props.mycontact) {
|
||||
if (props.myusername) {
|
||||
username.value = props.myusername
|
||||
//++Todo: carica contact
|
||||
contact.value = null
|
||||
}
|
||||
} else {
|
||||
if (props.mycontact) {
|
||||
contact.value = props.mycontact
|
||||
username.value = props.mycontact.username
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getImgUser(profile: IUserFields) {
|
||||
return userStore.getImgByProfile(profile)
|
||||
}
|
||||
|
||||
function naviga(path: string) {
|
||||
$router.push(path)
|
||||
}
|
||||
|
||||
function setCmd(cmd: number, myusername: string, value: any = '') {
|
||||
emit('setCmd', cmd, myusername, value)
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
contact,
|
||||
costanti,
|
||||
getImgUser,
|
||||
naviga,
|
||||
setCmd,
|
||||
shared_consts,
|
||||
}
|
||||
},
|
||||
})
|
||||
84
src/components/CMyUser/CMyUser.vue
Executable file
84
src/components/CMyUser/CMyUser.vue
Executable file
@@ -0,0 +1,84 @@
|
||||
<template>
|
||||
<div v-if="contact">
|
||||
<q-item class="q-my-sm" clickable>
|
||||
<q-item-section avatar @click="naviga(`/my/` + contact.username)">
|
||||
<q-avatar size="60px">
|
||||
<q-img :src="getImgUser(contact)" :alt="contact.username" img-class="imgprofile" height="60px"/>
|
||||
</q-avatar>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section @click="naviga(`/my/` + contact.username)">
|
||||
<q-item-label><strong>{{ contact.name }} {{ contact.surname }}</strong> ({{ contact.username }})
|
||||
</q-item-label>
|
||||
<q-item-label caption lines="1">{{ contact.email }}</q-item-label>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section side v-if="visu === costanti.FRIENDS">
|
||||
<q-item-label>
|
||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item clickable icon="fas fa-user-minus" v-close-popup
|
||||
@click="setCmd(shared_consts.FRIENDSCMD.REMOVE_FROM_MYFRIENDS, contact.username)">
|
||||
<q-item-section>{{ $t('friends.remove_from_myfriends') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item clickable icon="fas fa-ban" v-close-popup @click="setCmd(shared_consts.FRIENDSCMD.BLOCK_USER, contact.username)">
|
||||
<q-item-section>{{ $t('friends.block_user') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side v-if="visu === costanti.ASK_TRUST">
|
||||
<q-item-label>
|
||||
<q-btn color="positive" :label="$t('friends.accept_trust')" @click="setCmd(shared_consts.FRIENDSCMD.SETTRUST, contact.username, true)"/>
|
||||
</q-item-label>
|
||||
<q-item-label>
|
||||
<q-btn color="negative" :label="$t('friends.reject_trust')" @click="setCmd(shared_consts.FRIENDSCMD.SETTRUST, contact.username, false)"/>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side v-if="visu === costanti.TRUSTED">
|
||||
<q-item-label>
|
||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
||||
<q-menu>
|
||||
<q-list v-if="true" style="min-width: 200px">
|
||||
<q-item clickable v-close-popup @click="setCmd(shared_consts.FRIENDSCMD.SETFRIEND, contact.username)">
|
||||
<q-item-section>{{ $t('friends.accept_friend') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list style="min-width: 200px">
|
||||
<q-item clickable v-close-popup @click="setCmd(shared_consts.FRIENDSCMD.SETTRUST, contact.username, false)">
|
||||
<q-item-section>{{ $t('friends.reject_friend') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side v-if="visu === costanti.REEJECTED">
|
||||
<q-item-label>
|
||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
||||
<q-menu>
|
||||
<q-list style="min-width: 200px">
|
||||
<q-item clickable icon="fas fa-user-minus" v-close-popup
|
||||
@click="setCmd(shared_consts.FRIENDSCMD.SETTRUST, contact.username, true)">
|
||||
<q-item-section>{{ $t('friends.accept_trust') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CMyUser.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CMyUser.scss';
|
||||
</style>
|
||||
1
src/components/CMyUser/index.ts
Executable file
1
src/components/CMyUser/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export { default as CMyUser } from './CMyUser.vue'
|
||||
@@ -32,7 +32,7 @@ $textcol_scuro: darkblue;
|
||||
background-repeat: no-repeat !important;
|
||||
background-position: top;
|
||||
background-size: contain !important;
|
||||
background-image: url(../../../public/images/landing_first_section.png) !important
|
||||
background-image: url(/public/images/landing_first_section.png) !important
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,6 @@ $textcol_scuro: darkblue;
|
||||
}
|
||||
|
||||
.carousel_img_3 {
|
||||
//background-image: url(../../public/images/cibo_sano.jpg);
|
||||
background-size: cover !important;
|
||||
background-position: 50% center !important;
|
||||
background-repeat: no-repeat !important;
|
||||
|
||||
@@ -34,5 +34,6 @@ export * from './CMySingleEvent'
|
||||
// export * from './PagePolicy'
|
||||
export * from './CFacebookFrame'
|
||||
export * from './CVerifyEmail'
|
||||
export * from './CMyUser'
|
||||
export * from './CVerifyTelegram'
|
||||
// export * from './CPreloadImages'
|
||||
|
||||
Reference in New Issue
Block a user