show last access in profile

This commit is contained in:
Surya Paolo
2022-12-10 02:23:56 +01:00
parent cd31d2d020
commit a521161ae9
8 changed files with 239 additions and 105 deletions

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.5.31" APP_VERSION="0.5.32"
SERVICE_WORKER_FILE="service-worker.js" SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13" APP_ID="13"
DIRECTORY_LOCAL="newfreeplanet" DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.5.31" APP_VERSION="0.5.32"
SERVICE_WORKER_FILE="service-worker.js" SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13" APP_ID="13"
DIRECTORY_LOCAL=newfreeplanet DIRECTORY_LOCAL=newfreeplanet

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.5.31" APP_VERSION="0.5.32"
SERVICE_WORKER_FILE="service-worker.js" SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13" APP_ID="13"
DIRECTORY_LOCAL="newfreeplanet" DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.5.31" APP_VERSION="0.5.32"
SERVICE_WORKER_FILE="service-worker.js" SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13" APP_ID="13"
DIRECTORY_LOCAL=newfreeplanet DIRECTORY_LOCAL=newfreeplanet

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.5.31" APP_VERSION="0.5.32"
SERVICE_WORKER_FILE="service-worker.js" SERVICE_WORKER_FILE="service-worker.js"
APP_ID="16" APP_ID="16"
DIRECTORY_LOCAL=newfreeplanet DIRECTORY_LOCAL=newfreeplanet

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.5.31" APP_VERSION="0.5.32"
SERVICE_WORKER_FILE="service-worker.js" SERVICE_WORKER_FILE="service-worker.js"
APP_ID="14" APP_ID="14"
DIRECTORY_LOCAL="newfreeplanet" DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -1308,6 +1308,18 @@ h3 {
background: linear-gradient(45deg, #17ead9, #6078ea) !important; background: linear-gradient(45deg, #17ead9, #6078ea) !important;
} }
.last_access {
opacity: 0.7;
margin-top: -10px;
z-index: 1000;
margin-bottom: 5px;
padding: 5px;
border-radius: 20px;
background: #109d3b;
background: -webkit-linear-gradient(45deg, #0a7e23, #0c28b8) !important;
background: linear-gradient(45deg, #0a7e23, #0c28b8) !important;
}
.duration-2s { .duration-2s {
transition-duration: 5s !important; transition-duration: 5s !important;
} }

View File

@@ -1,50 +1,75 @@
<template> <template>
<div v-if="!tools.isLogged()"> <div v-if="!tools.isLogged()">
<CCheckIfIsLogged></CCheckIfIsLogged> <CCheckIfIsLogged></CCheckIfIsLogged>
</div> </div>
<div v-if="!caricato" class="fit column no-wrap justify-evenly items-center content-start"> <div
<q-skeleton type="QAvatar" size="140px" height="140px" animation="fade"/> v-if="!caricato"
class="fit column no-wrap justify-evenly items-center content-start"
>
<q-skeleton type="QAvatar" size="140px" height="140px" animation="fade" />
<q-card flat bordered style="width: 250px"> <q-card flat bordered style="width: 250px">
<div class="text-h6"> <div class="text-h6">
<q-skeleton :animation="animation"/> <q-skeleton :animation="animation" />
</div> </div>
<div class="col-12 text-h7 text-grey text-center"> <div class="col-12 text-h7 text-grey text-center">
{{ username }} {{ username }}
</div> </div>
<div class="col-12 text-h7"> <div class="col-12 text-h7">
<q-skeleton :animation="animation"/> <q-skeleton :animation="animation" />
</div> </div>
<div class="col-12 text-h8 q-mt-sm"> <div class="col-12 text-h8 q-mt-sm">
<q-skeleton :animation="animation"/> <q-skeleton :animation="animation" />
</div> </div>
<div class="col-12 text-h8 q-mt-sm"> <div class="col-12 text-h8 q-mt-sm">
<q-skeleton :animation="animation"/> <q-skeleton :animation="animation" />
</div> </div>
</q-card> </q-card>
</div> </div>
<div v-else-if="(tools.isUserOk() || (tools.isLogged()))"> <div v-else-if="tools.isUserOk() || tools.isLogged()">
<div v-if="myuser"> <div v-if="myuser">
<CNotifAtTop /> <CNotifAtTop />
<div class="q-gutter-sm q-pa-sm q-pb-md"> <div class="q-gutter-sm q-pa-sm q-pb-md">
<div v-if="myuser && myuser.date_reg" class="fit column no-wrap justify-evenly items-center content-start"> <div
v-if="myuser && myuser.date_reg"
class="fit column no-wrap justify-evenly items-center content-start"
>
<div class=""> <div class="">
<q-avatar size="140px"> <q-avatar size="140px">
<q-img :src="getImgUser()" :alt="username" img-class="imgprofile" height="140px" @click="showPic = true"/> <q-img
:src="getImgUser()"
:alt="username"
img-class="imgprofile"
height="140px"
@click="showPic = true"
/>
<q-badge
v-if="tools.isUserOnline(myuser)"
align="top"
floating
color="green"
>online</q-badge
>
</q-avatar> </q-avatar>
</div> </div>
<div class="last_access">
Ultimo accesso: {{tools.timeAgo(myuser.lasttimeonline)}}
</div>
<div v-if="myuser.reported"> <div v-if="myuser.reported">
<CTitleBanner title="⚠️ L'utente è stato Segnalato per comportamento non idoneo." bgcolor="bg-red" clcolor="text-white"> <CTitleBanner
title="⚠️ L'utente è stato Segnalato per comportamento non idoneo."
bgcolor="bg-red"
clcolor="text-white"
>
</CTitleBanner> </CTitleBanner>
</div> </div>
<div v-if="site.confpages.showNameSurname"> <div v-if="site.confpages.showNameSurname">
<div class="text-h6"> <div class="text-h6">
<span v-if="checkifShow('name')"> {{ myuser.name }}</span> <span v-if="checkifShow('surname')">{{ <span v-if="checkifShow('name')"> {{ myuser.name }}</span>
myuser.surname <span v-if="checkifShow('surname')">{{ myuser.surname }}</span>
}}</span>
</div> </div>
</div> </div>
<div class="col-12 text-h7 text-blue text-shadow-2"> <div class="col-12 text-h7 text-blue text-shadow-2">
@@ -52,7 +77,7 @@
</div> </div>
<div class="col-12 text-h7"> <div class="col-12 text-h7">
<span v-if="myuser.profile && myuser.profile.born_city_id"> <span v-if="myuser.profile && myuser.profile.born_city_id">
<CMyFieldRec <CMyFieldRec
title="" title=""
table="users" table="users"
@@ -61,101 +86,187 @@
:rec="myuser" :rec="myuser"
field="profile.born_city_id" field="profile.born_city_id"
:canEdit="false" :canEdit="false"
:canModify="false"> :canModify="false"
>
</CMyFieldRec> </CMyFieldRec>
{{ myuser.profile.born_city_str }}</span
{{ myuser.profile.born_city_str }}</span> <span >
v-if="myuser.profile && myuser.profile.nationality && myuser.profile.nationality !== 'Italia'">({{ <span
myuser.profile.nationality v-if="
}})</span> myuser.profile &&
myuser.profile.nationality &&
myuser.profile.nationality !== 'Italia'
"
>({{ myuser.profile.nationality }})</span
>
</div> </div>
<div v-if="myuser._id" class="col-12 text-h8 q-mt-sm"> <div v-if="myuser._id" class="col-12 text-h8 q-mt-sm">
<span v-if="myuser.profile.qualifica"> <span v-if="myuser.profile.qualifica">
<em><span class="qualifica">{{ myuser.profile.qualifica }}</span></em> <em
</span> ><span class="qualifica">{{
myuser.profile.qualifica
}}</span></em
>
</span>
</div> </div>
<div v-if="myuser._id" class="col-12 text-h8 q-mt-sm"> <div v-if="myuser._id" class="col-12 text-h8 q-mt-sm">
{{ myuser.profile.biografia }} {{ myuser.profile.biografia }}
</div> </div>
<div v-if="!isMyRecord(myuser.username)"> <div v-if="!isMyRecord(myuser.username)">
<div class="row centeritems q-ma-sm q-pa-sm" v-if="userStore.IsReqFriendByUsername(myuser.username)"> <div
class="row centeritems q-ma-sm q-pa-sm"
v-if="userStore.IsReqFriendByUsername(myuser.username)"
>
<q-btn <q-btn
icon="fas fa-user-plus" icon="fas fa-user-plus"
color="positive" :label="$t('friends.accept_friend')" color="positive"
@click="tools.addToMyFriends($q, userStore.my.username, myuser.username)" :label="$t('friends.accept_friend')"
@click="
tools.addToMyFriends(
$q,
userStore.my.username,
myuser.username
)
"
/> />
<q-btn <q-btn
icon="fas fa-user-minus" icon="fas fa-user-minus"
color="negative" :label="$t('friends.reject_ask_friend')" color="negative"
@click="tools.refuseReqFriends($q, userStore.my.username, myuser.username)" :label="$t('friends.reject_ask_friend')"
@click="
tools.refuseReqFriends(
$q,
userStore.my.username,
myuser.username
)
"
/> />
</div> </div>
<div v-else> <div v-else>
<q-btn <q-btn
v-if="!userStore.IsMyFriendByUsername(myuser.username) && !userStore.IsAskedFriendByUsername(myuser.username)" v-if="
!userStore.IsMyFriendByUsername(myuser.username) &&
!userStore.IsAskedFriendByUsername(myuser.username)
"
icon="fas fa-user-plus" icon="fas fa-user-plus"
color="primary" :label="$t('friends.ask_friend')" color="primary"
@click="tools.setRequestFriendship($q, userStore.my.username, myuser.username, true)" :label="$t('friends.ask_friend')"
@click="
tools.setRequestFriendship(
$q,
userStore.my.username,
myuser.username,
true
)
"
/> />
</div> </div>
<q-btn v-if="userStore.IsMyFriendByUsername(myuser.username)" rounded icon="fas fa-ellipsis-h"> <q-btn
v-if="userStore.IsMyFriendByUsername(myuser.username)"
rounded
icon="fas fa-ellipsis-h"
>
<q-menu> <q-menu>
<q-list v-if="true" style="min-width: 150px"> <q-list v-if="true" style="min-width: 150px">
<q-item clickable <q-item
icon="fas fa-user-minus" clickable
v-close-popup @click="tools.removeFromMyFriends($q, userStore.my.username, myuser.username)"> icon="fas fa-user-minus"
<q-item-section>{{ $t('friends.remove_from_myfriends') }}</q-item-section> v-close-popup
@click="
tools.removeFromMyFriends(
$q,
userStore.my.username,
myuser.username
)
"
>
<q-item-section>{{
$t('friends.remove_from_myfriends')
}}</q-item-section>
</q-item> </q-item>
<q-item clickable <q-item
icon="fas fa-ban" clickable
v-close-popup @click="tools.blockUser($q, userStore.my.username, myuser.username)"> icon="fas fa-ban"
<q-item-section>{{ $t('friends.block_user') }}</q-item-section> v-close-popup
@click="
tools.blockUser(
$q,
userStore.my.username,
myuser.username
)
"
>
<q-item-section>{{
$t('friends.block_user')
}}</q-item-section>
</q-item> </q-item>
<q-item clickable v-close-popup @click="tools.reportUser($q, userStore.my.username, myuser.username)"> <q-item
clickable
v-close-popup
@click="
tools.reportUser(
$q,
userStore.my.username,
myuser.username
)
"
>
<q-item-section avatar> <q-item-section avatar>
<q-icon color="negative" name="fas fa-user-minus"/> <q-icon color="negative" name="fas fa-user-minus" />
</q-item-section> </q-item-section>
<q-item-section>{{ $t('friends.report_user') }}</q-item-section> <q-item-section>{{
$t('friends.report_user')
}}</q-item-section>
</q-item> </q-item>
</q-list> </q-list>
</q-menu> </q-menu>
</q-btn> </q-btn>
<q-btn <q-btn
v-if="userStore.IsAskedFriendByUsername(myuser.username) && !userStore.IsMyFriendByUsername(myuser.username)" v-if="
userStore.IsAskedFriendByUsername(myuser.username) &&
!userStore.IsMyFriendByUsername(myuser.username)
"
icon="fas fa-user-minus" icon="fas fa-user-minus"
:label="$t('friends.cancel_ask_friend_short')" :label="$t('friends.cancel_ask_friend_short')"
@click="tools.cancelReqFriends($q, userStore.my.username, myuser.username)" @click="
tools.cancelReqFriends(
$q,
userStore.my.username,
myuser.username
)
"
/> />
</div> </div>
<q-btn <q-btn
v-if="myuser.username === myusername()" icon="fas fa-pencil-alt" v-if="myuser.username === myusername()"
:color="$q.dark.isActive ? `black`: `white`" icon="fas fa-pencil-alt"
:text-color="$q.dark.isActive ? `white`: `black`" :color="$q.dark.isActive ? `black` : `white`"
:text-color="$q.dark.isActive ? `white` : `black`"
size="md" size="md"
:label="$t('otherpages.modifprof')" :label="$t('otherpages.modifprof')"
to="/editprofile"> to="/editprofile"
>
</q-btn> </q-btn>
<div class="myrow justify-evenly items-center q-pa-sm q-ma-sm"> <div class="myrow justify-evenly items-center q-pa-sm q-ma-sm">
<div class="col-md-6 col-sm-6 q-ma-xs col-xs-12"> <div class="col-md-6 col-sm-6 q-ma-xs col-xs-12">
<q-btn <q-btn
v-if="getLinkUserTelegram()" icon="fab fa-telegram" v-if="getLinkUserTelegram()"
color="blue" type="a" icon="fab fa-telegram"
color="blue"
type="a"
size="md" size="md"
rounded rounded
:label="$t('msgs.telegrammsg')" :label="$t('msgs.telegrammsg')"
:href="getLinkUserTelegram()" target="__blank"> :href="getLinkUserTelegram()"
target="__blank"
>
</q-btn> </q-btn>
</div> </div>
<div class="col-md-6 col-sm-6 q-ma-xs col-xs-12"> <div class="col-md-6 col-sm-6 q-ma-xs col-xs-12">
<q-btn <q-btn
@@ -164,13 +275,16 @@
color="orange" color="orange"
:label="$t('profile.myactivities')" :label="$t('profile.myactivities')"
:to="`/skills/` + myuser.username" :to="`/skills/` + myuser.username"
> >
</q-btn> </q-btn>
</div> </div>
<div class="col-md-6 col-sm-6 q-ma-xs col-xs-12"> <div class="col-md-6 col-sm-6 q-ma-xs col-xs-12">
<q-btn <q-btn
v-if="userStore.IsMyCircuitByUser(myuser).length > 0 && myuser.username !== myusername() && userStore.my.profile.calc.numGoodsAndServices > 0" v-if="
userStore.IsMyCircuitByUser(myuser).length > 0 &&
myuser.username !== myusername() &&
userStore.my.profile.calc.numGoodsAndServices > 0
"
icon="fas fa-coins" icon="fas fa-coins"
color="green" color="green"
size="md" size="md"
@@ -179,16 +293,19 @@
@click="showsendCoinTo = true" @click="showsendCoinTo = true"
> >
</q-btn> </q-btn>
</div> </div>
<div v-if="myuser._id" class="col-md-6 col-sm-6 q-ma-xs col-xs-12"> <div v-if="myuser._id" class="col-md-6 col-sm-6 q-ma-xs col-xs-12">
<q-btn <q-btn
v-if="getLinkWebSite()" icon="fas fa-globe" v-if="getLinkWebSite()"
color="blue" type="a" icon="fas fa-globe"
color="blue"
type="a"
size="md" size="md"
rounded rounded
:label="$t('reg.website')" :label="$t('reg.website')"
:href="getLinkWebSite()" target="__blank"> :href="getLinkWebSite()"
target="__blank"
>
</q-btn> </q-btn>
</div> </div>
</div> </div>
@@ -201,28 +318,50 @@
size="md" size="md"
rounded rounded
:label="$t('reg.link_reg_and_msg')" :label="$t('reg.link_reg_and_msg')"
@click="tools.sendMsgTelegramCmd($q, $t, shared_consts.MsgTeleg.SHARE_MSGREG, true)"> @click="
tools.sendMsgTelegramCmd(
$q,
$t,
shared_consts.MsgTeleg.SHARE_MSGREG,
true
)
"
>
</q-btn> </q-btn>
</div> </div>
</div> </div>
</div> </div>
<div
v-if="
<div v-if="myuser && myuser._id && (userStore.IsMyFriendByUsername(myuser.username) || isMyRecord(myuser.username))"> myuser &&
myuser._id &&
(userStore.IsMyFriendByUsername(myuser.username) ||
isMyRecord(myuser.username))
"
>
<CTitleBanner <CTitleBanner
class="" :title="$t('dashboard.info')" bgcolor="bg-primary" clcolor="text-white" class=""
myclass="myshad" :canopen="true"> :title="$t('dashboard.info')"
bgcolor="bg-primary"
<div v-if="myuser.profile" class="fit column no-wrap justify-evenly content-start"> clcolor="text-white"
myclass="myshad"
:canopen="true"
>
<div
v-if="myuser.profile"
class="fit column no-wrap justify-evenly content-start"
>
<div class="col-md-6 col-sm-6 q-ma-xs col-xs-12"> <div class="col-md-6 col-sm-6 q-ma-xs col-xs-12">
<CDateTime <CDateTime
v-if="checkifShow('profile.dateofbirth') && !!myuser.profile.dateofbirth" v-if="
checkifShow('profile.dateofbirth') &&
!!myuser.profile.dateofbirth
"
v-model:value="myuser.profile.dateofbirth" v-model:value="myuser.profile.dateofbirth"
:label="$t('reg.dateofbirth')" :label="$t('reg.dateofbirth')"
:canEdit="false"> :canEdit="false"
>
</CDateTime> </CDateTime>
<CLabel <CLabel
v-if="!!myuser.profile.cell" v-if="!!myuser.profile.cell"
@@ -244,20 +383,12 @@
:canModify="false"> :canModify="false">
</CMyFieldRec> </CMyFieldRec>
--> -->
</div> </div>
</div> </div>
</CTitleBanner> </CTitleBanner>
</div> </div>
<div class="col-md-6 col-sm-6 q-ma-xs col-xs-12"> <div class="col-md-6 col-sm-6 q-ma-xs col-xs-12">
<CLabel <CLabel v-if="!!myuser.useraport" :label="t('profile.aportador_him')">
v-if="!!myuser.useraport"
:label="t('profile.aportador_him')"
>
<CMyUser <CMyUser
:mycontact="myuser.useraport" :mycontact="myuser.useraport"
:visu="costanti.FIND_PEOPLE" :visu="costanti.FIND_PEOPLE"
@@ -266,16 +397,9 @@
</CMyUser> </CMyUser>
</CLabel> </CLabel>
</div> </div>
</div> </div>
<q-dialog <q-dialog v-model="showPic" full-height full-width>
v-model="showPic" <img :src="getImgUser()" :alt="username" class="full-width" />
full-height full-width
>
<img :src="getImgUser()" :alt="username" class="full-width">
</q-dialog> </q-dialog>
<div v-if="showsendCoinTo"> <div v-if="showsendCoinTo">
@@ -284,19 +408,17 @@
:to_user="myuser" :to_user="myuser"
@close="showsendCoinTo = false" @close="showsendCoinTo = false"
> >
</CSendCoins> </CSendCoins>
</div> </div>
</div> </div>
<div v-else-if="caricato"> <div v-else-if="caricato">
<h2>Utente {{ username }} non trovato</h2> <h2>Utente {{ username }} non trovato</h2>
({{filtroutente}}) ({{ filtroutente }})
</div> </div>
</div> </div>
<div v-else> <div v-else>
<CUserNonVerif></CUserNonVerif> <CUserNonVerif></CUserNonVerif>
</div> </div>
</template> </template>
<script lang="ts" src="./myprofile.ts"> <script lang="ts" src="./myprofile.ts">