strette di mano

This commit is contained in:
Surya Paolo
2023-01-06 15:51:58 +01:00
parent d5d005a714
commit 865e1ad738
37 changed files with 644 additions and 76 deletions

View File

@@ -1044,7 +1044,7 @@
</q-table>
<q-page-sticky
v-if="mytable && butt_modif_new"
v-if="mytable && butt_modif_new && !hidetitleIfEmpty"
position="bottom-right"
:offset="[18, 68]"
>

View File

@@ -9,6 +9,7 @@ import { CDateTime } from '@/components/CDateTime'
import { CMyGroup } from '@/components/CMyGroup'
import { CMyCircuit } from '@/components/CMyCircuit'
import { CNotifAtTop } from '@src/components/CNotifAtTop'
import { CTimeAgo } from '@src/components/CTimeAgo'
import { CSendCoins } from '@/components/CSendCoins'
import { CMyUser } from '@/components/CMyUser'
import { CCheckIfIsLogged } from '@/components/CCheckIfIsLogged'
@@ -34,7 +35,8 @@ export default defineComponent({
name: 'CMyActivities',
components: {
CProfile, CTitleBanner, CMyFieldDb, CSkill, CDateTime, CCopyBtn, CUserNonVerif, CMyFieldRec, CMyUser,
CMyGroup, CLabel, CMyCircuit, CSendCoins, CNotifAtTop, CCheckIfIsLogged
CMyGroup, CLabel, CMyCircuit, CSendCoins, CNotifAtTop, CCheckIfIsLogged,
CTimeAgo
},
props: {
},

View File

@@ -53,7 +53,7 @@
</div>
<div class="last_access">
OnLine: {{ tools.timeAgo(myuser.lasttimeonline) }}
OnLine: <CTimeAgo :datetime="myuser.lasttimeonline" />
</div>
<div v-if="myuser.reported">

View File

@@ -79,7 +79,7 @@ export default defineComponent({
// @ts-ignore
const rectofind = circuitStore.listcircuits.find((circ: ICircuit) => circ.name === circuit.value.circuitname!)
if (rectofind) {
console.log('rectofind', rectofind)
// console.log('rectofind', rectofind)
circuit.value = rectofind
}
}

View File

@@ -73,8 +73,14 @@ export default defineComponent({
arr = userStore.my.profile.friends
} else if (props.modelValue === costanti.REQ_FRIENDS) {
arr = userStore.my.profile.req_friends
} else if (props.modelValue === costanti.HANDSHAKE) {
arr = userStore.my.profile.handshake
} else if (props.modelValue === costanti.REQ_HANDSHAKE) {
arr = userStore.my.profile.req_handshake
} else if (props.modelValue === costanti.ASK_SENT_FRIENDS) {
arr = userStore.my.profile.asked_friends
} else if (props.modelValue === costanti.ASK_SENT_HANDSHAKE) {
arr = userStore.my.profile.asked_handshake
} else if (props.modelValue === costanti.ASK_TRUST) {
arr = listTrusted.value.filter((user: IUserFields) => user.verified_by_aportador === undefined)
} else if (props.modelValue === costanti.TRUSTED) {
@@ -101,6 +107,15 @@ export default defineComponent({
label: t('mypages.request_friends') + ' (' + numReqFriends.value + ')',
value: costanti.REQ_FRIENDS
})
if (numHandShake.value > 0 || props.modelValue === costanti.HANDSHAKE)
mybutt.push({ label: t('mypages.handshake') + ' (' + numHandShake.value + ')', value: costanti.HANDSHAKE })
if (numReqHandShake.value > 0 || props.modelValue === costanti.REQ_HANDSHAKE)
mybutt.push({
label: t('mypages.requesthandshake') + ' (' + numReqHandShake.value + ')',
value: costanti.REQ_HANDSHAKE
})
if (numAskSentFriends.value > 0 || props.modelValue === costanti.ASK_SENT_FRIENDS)
mybutt.push({
label: t('mypages.request_sent') + ' (' + numAskSentFriends.value + ')',
@@ -121,11 +136,21 @@ export default defineComponent({
return (arr) ? arr.length : 0
})
const numHandShake = computed(() => {
const arr = userStore.my.profile.handshake
return (arr) ? arr.length : 0
})
const numReqFriends = computed(() => {
const arr = userStore.my.profile.req_friends
return (arr) ? arr.length : 0
})
const numReqHandShake = computed(() => {
const arr = userStore.my.profile.req_handshake
return (arr) ? arr.length : 0
})
const numAskSentFriends = computed(() => {
const arr = userStore.my.profile.asked_friends
return (arr) ? arr.length : 0

View File

@@ -83,6 +83,25 @@
</q-btn>
</q-item-label>
</q-item-section>
<q-item-section side v-else-if="visu === costanti.REQ_HANDSHAKE">
<q-item-label>
<q-btn rounded icon="fas fa-ellipsis-h">
<q-menu>
<q-list v-if="true" style="min-width: 150px">
<q-item clickable v-close-popup @click="setCmd($q, shared_consts.FRIENDSCMD.SETHANDSHAKE, userStore.my.username, '', contact.username)">
<q-item-section>{{ $t('friends.accept_handshake') }}</q-item-section>
</q-item>
</q-list>
<q-list style="min-width: 150px">
<q-item clickable icon="fas fa-user-minus" v-close-popup
@click="setCmd($q, shared_consts.FRIENDSCMD.REQ_HANDSHAKE, userStore.my.username, false, contact.username, false)">
<q-item-section>{{ $t('friends.reject_ask_handshake') }}</q-item-section>
</q-item>
</q-list>
</q-menu>
</q-btn>
</q-item-label>
</q-item-section>
<q-item-section side v-else-if="visu === costanti.REQ_ADD_USER_TO_GROUP">
<q-item-label>
<q-btn rounded icon="fas fa-ellipsis-h">
@@ -253,11 +272,15 @@
<q-item-label>
<q-btn rounded icon="fas fa-ellipsis-h">
<q-menu>
<q-list v-if="!userStore.IsMyFriendByUsername(contact.username)" style="min-width: 200px">
<q-item clickable icon="fas fa-user-plus" v-close-popup
<q-list style="min-width: 200px">
<q-item v-if="!userStore.IsMyFriendByUsername(contact.username)" clickable icon="fas fa-user-plus" v-close-popup
@click="setCmd($q, shared_consts.FRIENDSCMD.REQFRIEND, userStore.my.username, true, contact.username)">
<q-item-section>{{ $t('friends.ask_friend') }}</q-item-section>
</q-item>
<q-item v-if="!userStore.IsHandShakeByUsername(contact.username)" clickable icon="far fa-handshake" v-close-popup
@click="setCmd($q, shared_consts.FRIENDSCMD.REQ_HANDSHAKE, userStore.my.username, true, contact.username)">
<q-item-section>{{ $t('handshake.ask_handshake') }}</q-item-section>
</q-item>
</q-list>
<q-list style="min-width: 200px">
<q-item clickable icon="fas fa-user-minus" v-close-popup
@@ -299,6 +322,30 @@
</q-item-section>
<q-item-section>{{ $t('friends.remove_from_myfriends') }}</q-item-section>
</q-item>
<q-item v-if="(!userStore.IsHandShakeByUsername(contact.username) && !userStore.IsAskedHandShakeByUsername(contact.username))"
clickable v-close-popup @click="setCmd($q, shared_consts.FRIENDSCMD.REQ_HANDSHAKE, userStore.my.username, true, contact.username)">
<q-item-section avatar>
<q-icon color="positive" name="far fa-handshake"/>
</q-item-section>
<q-item-section>{{ $t('handshake.ask_handshake') }}</q-item-section>
</q-item>
<q-item v-else-if="(!userStore.IsHandShakeByUsername(contact.username) && userStore.IsAskedHandShakeByUsername(contact.username))"
clickable v-close-popup @click="setCmd($q, shared_consts.FRIENDSCMD.REQ_HANDSHAKE, userStore.my.username, false, contact.username)">
<q-item-section avatar>
<q-icon color="negative" name="far fa-handshake-alt-slash"/>
</q-item-section>
<q-item-section>{{ $t('handshake.cancel_ask_handshake') }}</q-item-section>
</q-item>
<q-item v-else-if="userStore.IsHandShakeByUsername(contact.username)" style="min-width: 200px"
clickable v-close-popup
@click="setCmd($q, shared_consts.FRIENDSCMD.REMOVE_FROM_MYHANDSHAKE, userStore.my.username, '', contact.username)">
<q-item-section avatar>
<q-icon color="negative" name="far fa-handshake-alt-slash"/>
</q-item-section>
<q-item-section>{{ $t('handshake.remove_from_myhandshake') }}</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="tools.reportUser($q, userStore.my.username, contact.username)">
<q-item-section avatar>
<q-icon color="negative" name="fas fa-flag"/>

View File

@@ -6,6 +6,7 @@ import {
import { INotData } from '../../model/index'
import MixinBase from '@src/mixins/mixin-base'
import { CTitleBanner } from '@/components/CTitleBanner'
import { CTimeAgo } from '@/components/CTimeAgo'
import { CCardState } from '../CCardState'
import { CMyFieldRec } from '../CMyFieldRec'
import { CElemStat } from '../CElemStat'
@@ -28,7 +29,7 @@ export default defineComponent({
name: 'CStatusReg',
props: {},
components: { CTitleBanner, CElemStat,
CCardState, CCardStat, CLineChart, CMyFieldRec },
CCardState, CCardStat, CLineChart, CMyFieldRec, CTimeAgo },
setup(props, { attrs, slots, emit }) {
const { t } = useI18n()
const $q = useQuasar()

View File

@@ -147,9 +147,17 @@
tools.getUserNameOnlyIfToShow(user)
}}</q-item-label>
</q-item-section>
<q-item-section side>{{
tools.timeAgo(user.lasttimeonline)
}}</q-item-section>
<q-item-section side>
<div
:class="
`text-h6 q-mr-sm text-bold ` + $q.dark.isActive
? `text-white`
: `text-black`
"
>
<CTimeAgo :datetime="user.lasttimeonline" />
</div>
</q-item-section>
</q-item>
</transition-group>
</q-list>
@@ -157,9 +165,13 @@
</q-tab-panel>
<q-tab-panel name="diffusori">
<div class="q-pa-md" style="max-width: 300px">
<div class="text-center text-bold text-h6">Aiuta RISO a crescere</div>
<div class="text-center"> Condividi il tuo link d'invito, alimentando nuovi ingressi alla RETE Solidale di RISO.
</div>
<div class="text-center text-bold text-h6">
Aiuta RISO a crescere
</div>
<div class="text-center">
Condividi il tuo link d'invito, alimentando nuovi ingressi
alla RETE Solidale di RISO.
</div>
<q-list bordered>
<transition-group
name="fade"
@@ -200,9 +212,12 @@
}}</q-item-label>
</q-item-section>
<q-item-section side
><span :class="`text-h6 q-mr-sm text-bold ` + $q.dark.isActive ? `text-white` : `text-black`">{{
user.count
}}</span></q-item-section
><div
:class="
`text-h6 q-mx-sm q-px-sm text-bold ` + ($q.dark.isActive ? `text-white`: `text-black`)
"
>{{ user.count }}
</div></q-item-section
>
</q-item>
</transition-group>
@@ -211,9 +226,12 @@
</q-tab-panel>
<q-tab-panel name="sharedlink">
<div class="q-pa-md" style="max-width: 300px">
<div class="text-center text-bold text-h6">Registrati con questi invitanti:</div>
<div class="text-center">Cliccare sulla persona per procedere alla registrazione
</div>
<div class="text-center text-bold text-h6">
Registrati con questi invitanti:
</div>
<div class="text-center">
Cliccare sulla persona per procedere alla registrazione
</div>
<q-list bordered>
<transition-group
name="fade"
@@ -254,8 +272,8 @@
}}</q-item-label>
</q-item-section>
<q-item-section side
><span class="text-h6 q-mr-sm"></span></q-item-section
>
><span class="text-h6 q-mr-sm"></span
></q-item-section>
</q-item>
</transition-group>
</q-list>

View File

View File

@@ -0,0 +1,41 @@
import { defineComponent, ref, computed, PropType, toRef, onMounted } from 'vue'
import { useUserStore } from '@store/UserStore'
import { useRouter } from 'vue-router'
import { useGlobalStore } from '@store/globalStore'
import { useI18n } from '@/boot/i18n'
import { tools } from '@store/Modules/tools'
import { toolsext } from '@store/Modules/toolsext'
import { es, it, enUS } from 'date-fns/locale' // import custom locale
export default defineComponent({
name: 'CTimeAgo',
components: {},
props: {
datetime: {
type: String,
required: true
},
},
setup(props, { emit }) {
const mylocale = ref(<any>null)
function mounted() {
mylocale.value = enUS
if (toolsext.getLocale() === 'it')
mylocale.value = it
else if (toolsext.getLocale() === 'es')
mylocale.value = es
}
mounted()
return {
tools,
toolsext,
mylocale,
}
}
})

View File

@@ -0,0 +1,19 @@
<template>
<timeago
:datetime="datetime"
auto-update
:converter-options="{
includeSeconds: true,
addSuffix: true,
useStrict: false,
}"
:locale="mylocale"
/>
</template>
<script lang="ts" src="./CTimeAgo.ts">
</script>
<style lang="scss" scoped>
@import './CTimeAgo.scss';
</style>

View File

@@ -0,0 +1 @@
export {default as CTimeAgo} from './CTimeAgo.vue'