- Accepted and Refused Group Entering
- Report a User
This commit is contained in:
17
grp.js
17
grp.js
@@ -80,7 +80,8 @@ db.getCollection('mygoods').aggregate(
|
||||
"mycities": 1,
|
||||
"profile.img": 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.qualifica": 1
|
||||
"profile.qualifica": 1,
|
||||
reported: 1,
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -132,8 +133,9 @@ db.getCollection('mygoods').aggregate(
|
||||
"comune": 1,
|
||||
"mycities": 1,
|
||||
"profile.img": 1,
|
||||
reported: 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.qualifica": 1
|
||||
"profile.qualifica": 1,
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -185,8 +187,10 @@ db.getCollection('mygoods').aggregate(
|
||||
"comune": 1,
|
||||
"mycities": 1,
|
||||
"profile.img": 1,
|
||||
reported: 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.qualifica": 1
|
||||
"profile.qualifica": 1,
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -239,7 +243,8 @@ db.getCollection('mygoods').aggregate(
|
||||
"mycities": 1,
|
||||
"profile.img": 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.qualifica": 1
|
||||
"profile.qualifica": 1,
|
||||
reported: 1,
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -262,7 +267,7 @@ db.getCollection('mygoods').aggregate(
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
{
|
||||
"pub_to_share": 1,
|
||||
}
|
||||
]
|
||||
@@ -309,4 +314,4 @@ db.getCollection('mygoods').aggregate(
|
||||
}
|
||||
}
|
||||
]
|
||||
)
|
||||
)
|
||||
|
||||
@@ -66,6 +66,7 @@ db.getCollection('myskills').aggregate(
|
||||
"comune": 1,
|
||||
"mycities": 1,
|
||||
"profile.img": 1,
|
||||
reported: 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.qualifica": 1
|
||||
}
|
||||
@@ -119,6 +120,7 @@ db.getCollection('myskills').aggregate(
|
||||
"comune": 1,
|
||||
"mycities": 1,
|
||||
"profile.img": 1,
|
||||
reported: 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.qualifica": 1
|
||||
}
|
||||
@@ -172,6 +174,7 @@ db.getCollection('myskills').aggregate(
|
||||
"comune": 1,
|
||||
"mycities": 1,
|
||||
"profile.img": 1,
|
||||
reported: 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.qualifica": 1
|
||||
}
|
||||
@@ -225,6 +228,7 @@ db.getCollection('myskills').aggregate(
|
||||
"comune": 1,
|
||||
"mycities": 1,
|
||||
"profile.img": 1,
|
||||
reported: 1,
|
||||
"profile.mygroups": 1,
|
||||
"profile.qualifica": 1
|
||||
}
|
||||
|
||||
@@ -55,6 +55,7 @@ export const shared_consts = {
|
||||
REFUSE_REQ_FRIEND: 145,
|
||||
CANCEL_REQ_FRIEND: 146,
|
||||
BLOCK_USER: 155,
|
||||
REPORT_USER: 158,
|
||||
FIND_PEOPLE: 166,
|
||||
},
|
||||
|
||||
@@ -862,14 +863,15 @@ export const shared_consts = {
|
||||
StatusNotifs: {
|
||||
STATUS_FRIENDS_ACCEPTED: 1,
|
||||
STATUS_FRIENDS_REFUSED: 2,
|
||||
STATUS_GROUPS_ACCEPTED: 3,
|
||||
STATUS_GROUPS_REFUSED: 4,
|
||||
},
|
||||
|
||||
GroupsNotifs: {
|
||||
STATUS_GROUPS_NEW: 1,
|
||||
STATUS_GROUPS_ACCEPTED: 2,
|
||||
STATUS_GROUPS_ACCEPTED: 3,
|
||||
STATUS_GROUPS_REFUSED: 4,
|
||||
STATUS_GROUPS_BLOCKED: 5,
|
||||
STATUS_GROUPS_DELETED: 6,
|
||||
STATUS_GROUPS_REMOVED: 7,
|
||||
},
|
||||
|
||||
TypeNotifs: {
|
||||
@@ -884,13 +886,18 @@ export const shared_consts = {
|
||||
TYPEDIR_FRIENDS: 3,
|
||||
ID_FRIENDS_NEW_REC: 1,
|
||||
ID_FRIENDS_ACCEPTED: 2,
|
||||
ID_FRIENDS_REFUSED: 3,
|
||||
ID_FRIENDS_ACCEPTED_MY_REQUEST: 4,
|
||||
ID_FRIENDS_REFUSED: 4,
|
||||
ID_FRIENDS_ACCEPTED_MY_REQUEST: 8,
|
||||
ID_FRIENDS_REPORTED: 16,
|
||||
|
||||
TYPEDIR_GROUPS: 4,
|
||||
ID_GROUP_NEW_REC: 1,
|
||||
ID_GROUP_ACCEPTED: 2,
|
||||
ID_GROUP_REFUSED: 3,
|
||||
ID_GROUP_REFUSED: 4,
|
||||
ID_GROUP_REQUEST_TO_ENTER: 8,
|
||||
ID_GROUP_BLOCK_USER: 16,
|
||||
ID_GROUP_DELETE_USER: 32,
|
||||
ID_GROUP_REMOVED: 64,
|
||||
|
||||
TYPEDIR_CIRCUITS: 5,
|
||||
|
||||
@@ -1013,7 +1020,7 @@ export const shared_consts = {
|
||||
directory: 3,
|
||||
},
|
||||
{
|
||||
value: 1, // STATUS_GROUPS_NEW
|
||||
value: 1, // GroupsNotifs.STATUS_GROUPS_NEW
|
||||
labeltrans: 'notifsid.groups_new',
|
||||
directory: 4,
|
||||
},
|
||||
|
||||
@@ -1005,6 +1005,7 @@ export default defineComponent({
|
||||
'profile.img': 1,
|
||||
'profile.mygroups': 1,
|
||||
'profile.qualifica': 1,
|
||||
reported: 1,
|
||||
}
|
||||
},
|
||||
lookup3: {
|
||||
@@ -1069,6 +1070,7 @@ export default defineComponent({
|
||||
'profile.img': 1,
|
||||
'profile.mygroups': 1,
|
||||
'profile.qualifica': 1,
|
||||
reported: 1,
|
||||
}
|
||||
},
|
||||
lookup3: {
|
||||
@@ -1182,6 +1184,7 @@ export default defineComponent({
|
||||
'profile.img': 1,
|
||||
'profile.mygroups': 1,
|
||||
'profile.qualifica': 1,
|
||||
reported: 1,
|
||||
}
|
||||
},
|
||||
lookup3: {
|
||||
|
||||
@@ -1,198 +1,215 @@
|
||||
<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>
|
||||
<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 v-if="labelextra"><strong>{{ labelextra }}</strong></q-item-label>
|
||||
<q-item-label>{{ contact.username }} <span v-if="contact.name">({{ contact.name }} {{ contact.surname }})</span>
|
||||
</q-item-label>
|
||||
<q-item-label v-if="contact.profile" caption lines="1"><em>{{ contact.profile.qualifica }}</em></q-item-label>
|
||||
<q-item-label caption lines="1"></q-item-label>
|
||||
<q-item-label v-if="labelFooter" lines="1"><em>{{ labelFooter }}</em></q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section @click="naviga(`/my/` + contact.username)">
|
||||
<q-item-label v-if="labelextra"><strong>{{ labelextra }}</strong></q-item-label>
|
||||
<q-item-label v-if="contact.name || contact.surname">{{ contact.username }} <span v-if="contact.name">({{ contact.name }} {{ contact.surname }})</span>
|
||||
</q-item-label>
|
||||
<q-item-label v-if="contact.reported" caption lines="1"><em style="color: red; font-weight: bold">{{ $t('db.reporteduser') }}</em></q-item-label>
|
||||
<q-item-label v-if="contact.profile" caption lines="1"><em>{{ contact.profile.qualifica }}</em></q-item-label>
|
||||
<q-item-label caption lines="1"></q-item-label>
|
||||
<q-item-label v-if="labelFooter" lines="1"><em>{{ labelFooter }}</em></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($q, shared_consts.FRIENDSCMD.REMOVE_FROM_MYFRIENDS, userStore.my.username, '', 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($q, shared_consts.FRIENDSCMD.BLOCK_USER, userStore.my.username, '', 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-else-if="visu === costanti.REQ_FRIENDS">
|
||||
<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.SETFRIEND, userStore.my.username, '', contact.username)">
|
||||
<q-item-section>{{ $t('friends.accept_friend') }}</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.REQFRIEND, userStore.my.username, false, contact.username, false)">
|
||||
<q-item-section>{{ $t('friends.reject_ask_friend') }}</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">
|
||||
<q-menu>
|
||||
<q-list v-if="true" style="min-width: 150px">
|
||||
<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($q, shared_consts.FRIENDSCMD.REMOVE_FROM_MYFRIENDS, userStore.my.username, '', 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($q, shared_consts.FRIENDSCMD.BLOCK_USER, userStore.my.username, '', 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-else-if="visu === costanti.REQ_FRIENDS">
|
||||
<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.SETFRIEND, userStore.my.username, '', contact.username)">
|
||||
<q-item-section>{{ $t('friends.accept_friend') }}</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.REQFRIEND, userStore.my.username, false, contact.username, false)">
|
||||
<q-item-section>{{ $t('friends.reject_ask_friend') }}</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">
|
||||
<q-menu>
|
||||
<q-list v-if="true" style="min-width: 150px">
|
||||
|
||||
<q-item clickable v-close-popup @click="tools.addToMyGroups($q, contact.username, groupname)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="positive" name="fas fa-user-plus" />
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
{{ $t('groups.accept_group') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list style="min-width: 200px">
|
||||
<q-item clickable v-close-popup
|
||||
@click="tools.cancelReqGroups($q, contact.username, groupname)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-user-minus" />
|
||||
</q-item-section>
|
||||
<q-item clickable v-close-popup @click="tools.addToMyGroups($q, contact.username, groupname)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="positive" name="fas fa-user-plus"/>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
{{ $t('groups.accept_group') }}
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list style="min-width: 200px">
|
||||
<q-item clickable v-close-popup
|
||||
@click="tools.cancelReqGroups($q, contact.username, groupname)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-user-minus"/>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section>{{ $t('groups.refuse_ask_group_short') }}</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_REMOVE_USER_TO_GROUP">
|
||||
<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="tools.removeFromMyGroups($q, contact.username, groupname)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-user-minus" />
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('groups.remove_from_mygroups') }}</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.ASK_SENT_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($q, shared_consts.FRIENDSCMD.CANCEL_REQ_FRIEND, userStore.my.username, '', contact.username, '')">
|
||||
<q-item-section>{{ $t('friends.cancel_ask_friend') }}</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.ASK_TRUST">
|
||||
<q-item-label>
|
||||
<q-btn color="positive" :label="$t('friends.accept_trust')" @click="setCmd($q, shared_consts.FRIENDSCMD.SETTRUST, userStore.my.username, true, contact.username)"/>
|
||||
</q-item-label>
|
||||
<q-item-label>
|
||||
<q-btn color="negative" :label="$t('friends.refuse_trust')" @click="setCmd($q, shared_consts.FRIENDSCMD.SETTRUST, userStore.my.username, false, contact.username)"/>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side v-else-if="visu === costanti.TRUSTED">
|
||||
<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 @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-list>
|
||||
<q-list style="min-width: 200px">
|
||||
<q-item clickable icon="fas fa-user-minus" v-close-popup @click="setCmd($q, shared_consts.FRIENDSCMD.SETTRUST, userStore.my.username, false, contact.username)">
|
||||
<q-item-section>{{ $t('friends.reject_trust') }}</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.FIND_PEOPLE">
|
||||
<q-item-label>
|
||||
<q-item-section>{{ $t('groups.refuse_ask_group_short') }}</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_REMOVE_USER_TO_GROUP">
|
||||
<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="tools.removeFromMyGroups($q, contact.username, groupname)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-user-minus"/>
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('groups.remove_from_mygroups') }}</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"/>
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('friends.report_user') }}</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.ASK_SENT_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($q, shared_consts.FRIENDSCMD.CANCEL_REQ_FRIEND, userStore.my.username, '', contact.username, '')">
|
||||
<q-item-section>{{ $t('friends.cancel_ask_friend') }}</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.ASK_TRUST">
|
||||
<q-item-label>
|
||||
<q-btn color="positive" :label="$t('friends.accept_trust')"
|
||||
@click="setCmd($q, shared_consts.FRIENDSCMD.SETTRUST, userStore.my.username, true, contact.username)"/>
|
||||
</q-item-label>
|
||||
<q-item-label>
|
||||
<q-btn color="negative" :label="$t('friends.refuse_trust')"
|
||||
@click="setCmd($q, shared_consts.FRIENDSCMD.SETTRUST, userStore.my.username, false, contact.username)"/>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side v-else-if="visu === costanti.TRUSTED">
|
||||
<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
|
||||
@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-list>
|
||||
<q-list style="min-width: 200px">
|
||||
<q-item clickable icon="fas fa-user-minus" v-close-popup
|
||||
@click="setCmd($q, shared_consts.FRIENDSCMD.SETTRUST, userStore.my.username, false, contact.username)">
|
||||
<q-item-section>{{ $t('friends.reject_trust') }}</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.FIND_PEOPLE">
|
||||
<q-item-label>
|
||||
|
||||
<q-btn v-if="contact.username !== userStore.my.username" rounded :icon="userStore.IsMyFriendByUsername(contact.username) ? `fas fa-ellipsis-h` : `fas fa-user`">
|
||||
<q-menu>
|
||||
<q-list v-if="(!userStore.IsMyFriendByUsername(contact.username) && !userStore.IsAskedFriendByUsername(contact.username))" style="min-width: 200px">
|
||||
<q-item clickable v-close-popup @click="setCmd($q, shared_consts.FRIENDSCMD.REQFRIEND, userStore.my.username, true, contact.username)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="positive" name="fas fa-user-plus" />
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('friends.ask_friend') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list v-else-if="(!userStore.IsMyFriendByUsername(contact.username) && userStore.IsAskedFriendByUsername(contact.username))" style="min-width: 200px">
|
||||
<q-btn v-if="contact.username !== userStore.my.username" rounded
|
||||
:icon="userStore.IsMyFriendByUsername(contact.username) ? `fas fa-ellipsis-h` : `fas fa-user`">
|
||||
<q-menu>
|
||||
<q-list v-if="(!userStore.IsMyFriendByUsername(contact.username) && !userStore.IsAskedFriendByUsername(contact.username))"
|
||||
style="min-width: 200px">
|
||||
<q-item clickable v-close-popup @click="setCmd($q, shared_consts.FRIENDSCMD.REQFRIEND, userStore.my.username, true, contact.username)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="positive" name="fas fa-user-plus"/>
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('friends.ask_friend') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list v-else-if="(!userStore.IsMyFriendByUsername(contact.username) && userStore.IsAskedFriendByUsername(contact.username))"
|
||||
style="min-width: 200px">
|
||||
|
||||
<q-item clickable v-close-popup @click="setCmd($q, shared_consts.FRIENDSCMD.REQFRIEND, userStore.my.username, false, contact.username)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-user-minus" />
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('friends.cancel_ask_friend') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list v-else-if="userStore.IsMyFriendByUsername(contact.username)" style="min-width: 200px">
|
||||
<q-item clickable v-close-popup @click="setCmd($q, shared_consts.FRIENDSCMD.REMOVE_FROM_MYFRIENDS, userStore.my.username, '', contact.username)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-user-minus" />
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('friends.remove_from_myfriends') }}</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.REJECTED">
|
||||
<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($q, shared_consts.FRIENDSCMD.SETTRUST, userStore.my.username, true, contact.username)">
|
||||
<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>
|
||||
<q-item clickable v-close-popup @click="setCmd($q, shared_consts.FRIENDSCMD.REQFRIEND, userStore.my.username, false, contact.username)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-user-minus"/>
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('friends.cancel_ask_friend') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list v-else-if="userStore.IsMyFriendByUsername(contact.username)" style="min-width: 200px">
|
||||
<q-item clickable v-close-popup
|
||||
@click="setCmd($q, shared_consts.FRIENDSCMD.REMOVE_FROM_MYFRIENDS, userStore.my.username, '', contact.username)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-user-minus"/>
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('friends.remove_from_myfriends') }}</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.REJECTED">
|
||||
<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($q, shared_consts.FRIENDSCMD.SETTRUST, userStore.my.username, true, contact.username)">
|
||||
<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';
|
||||
@import './CMyUser.scss';
|
||||
</style>
|
||||
|
||||
@@ -124,6 +124,7 @@ export default defineComponent({
|
||||
'profile.img': 1,
|
||||
'profile.mygroups': 1,
|
||||
'profile.qualifica': 1,
|
||||
reported: 1,
|
||||
}
|
||||
},
|
||||
lookup2: {
|
||||
@@ -160,6 +161,7 @@ export default defineComponent({
|
||||
'profile.img': 1,
|
||||
'profile.mygroups': 1,
|
||||
'profile.qualifica': 1,
|
||||
reported: 1,
|
||||
}
|
||||
},
|
||||
lookup3: {
|
||||
@@ -196,6 +198,7 @@ export default defineComponent({
|
||||
'profile.img': 1,
|
||||
'profile.mygroups': 1,
|
||||
'profile.qualifica': 1,
|
||||
reported: 1,
|
||||
}
|
||||
},
|
||||
lookup4: {
|
||||
@@ -257,6 +260,7 @@ export default defineComponent({
|
||||
'profile.img': 1,
|
||||
'profile.mygroups': 1,
|
||||
'profile.qualifica': 1,
|
||||
reported: 1,
|
||||
}
|
||||
},
|
||||
lookup2: {
|
||||
@@ -295,6 +299,7 @@ export default defineComponent({
|
||||
'profile.img': 1,
|
||||
'profile.mygroups': 1,
|
||||
'profile.qualifica': 1,
|
||||
reported: 1,
|
||||
}
|
||||
},
|
||||
lookup3: {
|
||||
|
||||
@@ -121,6 +121,7 @@ export default defineComponent({
|
||||
|
||||
|
||||
async function refreshdata(username: string) {
|
||||
console.log('refreshdata')
|
||||
loading.value = true
|
||||
userId.value = userStore.my._id
|
||||
|
||||
@@ -176,6 +177,7 @@ export default defineComponent({
|
||||
notifStore,
|
||||
show_all,
|
||||
t,
|
||||
$q,
|
||||
username,
|
||||
userStore,
|
||||
}
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
</q-btn>
|
||||
|
||||
|
||||
<q-drawer v-model="open" side="right" elevated class="text-black" :width="350">
|
||||
|
||||
<q-drawer v-model="open" side="right" elevated class="text-black" :width="$q.screen.lt.sm ? 370 : 450">
|
||||
|
||||
<q-bar class="bg-primary text-white">
|
||||
{{ $t('notifs.notifs') }}
|
||||
@@ -86,7 +87,7 @@
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section v-ripple>
|
||||
<q-item-label lines="3" :class="(!notif.read) ? 'unread' : 'read'" @click="clickNotif(notif)">
|
||||
<q-item-label lines="5" :class="(!notif.read) ? 'unread' : 'read'" @click="clickNotif(notif)">
|
||||
<div v-html="getNotifText($t, notif, false)"></div>
|
||||
</q-item-label>
|
||||
<q-item-label caption lines="2" v-if="notif.typedir === shared_consts.TypeNotifs.TYPEDIR_FRIENDS && notif.status === 0" v-ripple>
|
||||
@@ -110,6 +111,27 @@
|
||||
</div>
|
||||
</q-item-label>
|
||||
|
||||
<q-item-label caption lines="2" v-if="notif.typedir === shared_consts.TypeNotifs.TYPEDIR_GROUPS && notif.status === 0 && notif.typeid === shared_consts.TypeNotifs.ID_GROUP_REQUEST_TO_ENTER" v-ripple>
|
||||
<div class="row no-wrap justify-evenly" v-if="tools.iAmAdminGroup(notif.extrafield)">
|
||||
<q-btn
|
||||
dense
|
||||
rounded
|
||||
size="sm"
|
||||
icon="fas fa-user-plus"
|
||||
color="positive" :label="$t('friends.accept')"
|
||||
@click="tools.addToMyGroups($q, notif.sender, notif.extrafield)"
|
||||
/>
|
||||
<q-btn
|
||||
dense
|
||||
rounded
|
||||
size="sm"
|
||||
icon="fas fa-user-minus"
|
||||
color="negative" :label="$t('friends.refuse')"
|
||||
@click="tools.refuseReqGroup($q, notif.sender, notif.extrafield)"
|
||||
/>
|
||||
</div>
|
||||
</q-item-label>
|
||||
|
||||
<q-item-label caption lines="1" :class="(!notif.read) ? 'unread-date' : 'read-date'" @click="clickNotif(notif)">
|
||||
{{ tools.timeAgo(notif.datenotif) }}
|
||||
<!--{{ // getUsernameChatByNotif(notif) }}-->
|
||||
|
||||
@@ -163,9 +163,21 @@ export default function () {
|
||||
|
||||
if (notif.typedir === shared_consts.TypeNotifs.TYPEDIR_FRIENDS) {
|
||||
if (notif.status === shared_consts.StatusNotifs.STATUS_FRIENDS_ACCEPTED) {
|
||||
descr += '\n' + $t('friends.accepted')
|
||||
descr += '<br><em>' + $t('friends.accepted') + '</em>'
|
||||
} else if (notif.status === shared_consts.StatusNotifs.STATUS_FRIENDS_REFUSED) {
|
||||
descr += '\n' + $t('friends.refused')
|
||||
descr += '<br><em>' + $t('friends.refused') + '</em>'
|
||||
}
|
||||
} else if (notif.typedir === shared_consts.TypeNotifs.TYPEDIR_GROUPS) {
|
||||
if (notif.status === shared_consts.GroupsNotifs.STATUS_GROUPS_ACCEPTED) {
|
||||
descr += '<br><em>' + $t('groups.accepted') + '</em>'
|
||||
} else if (notif.status === shared_consts.GroupsNotifs.STATUS_GROUPS_REFUSED) {
|
||||
descr += '<br><em>' + $t('groups.refused') + '</em>'
|
||||
} else if (notif.status === shared_consts.GroupsNotifs.STATUS_GROUPS_BLOCKED) {
|
||||
descr += '<br><em>' + $t('groups.blocked') + '</em>'
|
||||
} else if (notif.status === shared_consts.GroupsNotifs.STATUS_GROUPS_DELETED) {
|
||||
descr += '<br><em>' + $t('groups.deleted') + '</em>'
|
||||
} else if (notif.status === shared_consts.GroupsNotifs.STATUS_GROUPS_REMOVED) {
|
||||
descr += '<br><em>' + $t('groups.removed') + '</em>'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,7 +221,6 @@ export default function () {
|
||||
|
||||
function getImgByNotif(notif: INotif) {
|
||||
const userStore = useUserStore()
|
||||
const notifStore = useNotifStore()
|
||||
|
||||
return `${userStore.getImgByUsername(notif.sender)}`
|
||||
}
|
||||
|
||||
@@ -63,6 +63,7 @@ export const NotifDefault: INotif = {
|
||||
read: false,
|
||||
deleted: false,
|
||||
status: StatusMessage.None,
|
||||
extrafield: '',
|
||||
}
|
||||
|
||||
export interface IMessage {
|
||||
@@ -96,6 +97,7 @@ export interface INotif {
|
||||
tablerec?: string
|
||||
idrec?: string
|
||||
deleted?: boolean
|
||||
extrafield?: string
|
||||
}
|
||||
|
||||
export interface IChat {
|
||||
|
||||
@@ -116,6 +116,9 @@ export interface IUserFields {
|
||||
perm?: number
|
||||
verified_email?: boolean
|
||||
verified_by_aportador?: boolean
|
||||
reported?: boolean
|
||||
username_who_report?: string
|
||||
date_report?: Date
|
||||
notask_verif?: boolean
|
||||
trust_modified?: Date
|
||||
aportador_solidario?: string
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {
|
||||
defineComponent, ref, computed,
|
||||
defineComponent, ref, computed, onMounted
|
||||
} from 'vue'
|
||||
|
||||
import { tools } from '@src/store/Modules/tools'
|
||||
@@ -21,7 +21,6 @@ import MixinUsers from '@/mixins/mixin-users'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { CPresentazione } from '@/components'
|
||||
import MixinMetaTags from '@/mixins/mixin-metatags'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'mainview',
|
||||
components: { CSkill, CChartMap, CMapsEsempio, CDashboard, CUserNonVerif, CMainView, CCopyBtn, LandingFooter, CCheckIfIsLogged, CStatusReg, CPresentazione },
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div v-if="!!myuser">
|
||||
<div v-if="!!myuser && search">
|
||||
username cercato: <em>"{{ search }}"</em><br>
|
||||
<br>
|
||||
|
||||
@@ -92,6 +92,19 @@
|
||||
</q-banner>
|
||||
</div>
|
||||
|
||||
<div v-if="myuser.reported" class="mybanner">
|
||||
<q-banner
|
||||
rounded
|
||||
class="bg-red text-white"
|
||||
style="text-align: center;"
|
||||
>
|
||||
<em style="font-weight: bold">{{ $t('db.reporteduser') }}<br>
|
||||
da: {{ myuser.username_who_report }}<br>
|
||||
in Data: {{ tools.getstrshortDateTime(myuser.date_report) }} </em>
|
||||
</q-banner>
|
||||
</div>
|
||||
|
||||
|
||||
<CKeyAndValue mykey="Username:" :myvalue="myuser.username"></CKeyAndValue>
|
||||
|
||||
<div v-if="!!myuser.profile">
|
||||
@@ -117,6 +130,7 @@
|
||||
<CKeyAndValue mykey="Data di Nascita:" :mydate="myuser.profile.dateofbirth"></CKeyAndValue>
|
||||
<CKeyAndValue mykey="Biografia:" :myvalue="myuser.profile.biografia"></CKeyAndValue>
|
||||
<CKeyAndValue mykey="qualifica:" :myvalue="myuser.profile.qualifica"></CKeyAndValue>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import { useProgressBar } from '@store/Modules/ProgressBar'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useNotifStore } from '@store/NotifStore'
|
||||
|
||||
const progressBar = useProgressBar()
|
||||
|
||||
@@ -17,141 +18,6 @@ const getRouteData = async (to: any) => {
|
||||
const $router = useRouter()
|
||||
|
||||
// router().beforeEach(async (to: IMyRoute, from: IMyRoute, next) => {
|
||||
$router.beforeEach(async (to, from, next) => {
|
||||
const userStore = useUserStore()
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
try {
|
||||
if (globalStore) {
|
||||
if (!globalStore.finishLoading) {
|
||||
let eseguicheck = true
|
||||
|
||||
// Controlla se c'è nella lista allora non eseguire il controllo:
|
||||
for (const route of static_data.routes) {
|
||||
if (route.path === to.path) {
|
||||
eseguicheck = false
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (eseguicheck) {
|
||||
// Qui arrivano gli URL che non sono della lista ROUTE.
|
||||
// quindi ad esempio http://localhost:8085/signup/paoloar77
|
||||
|
||||
if (!globalStore.TIMER && to.path !== '/') {
|
||||
// console.log('TIMER')
|
||||
globalStore.TIMER = setInterval(() => {
|
||||
// console.log('SETINTERVAL')
|
||||
if (globalStore.finishLoading) {
|
||||
if (globalStore.TIMER) {
|
||||
// console.log('TIMER_STATE', TIMER_STATE, 'URL_RITORNA', URL_RITORNA)
|
||||
if (globalStore.TIMER_STATE === 2) {
|
||||
clearInterval(globalStore.TIMER)
|
||||
globalStore.TIMER = null
|
||||
// console.log('TERMINA INTERVALLO')
|
||||
// next('/prova')
|
||||
// return
|
||||
}
|
||||
// se mi ero salvato un url per doverci ritornare, allora puntalo a questo:
|
||||
if (globalStore.URL_RITORNA !== '') {
|
||||
// next(URL_RITORNA)
|
||||
globalStore.TIMER_STATE = 2
|
||||
} else if (globalStore.TIMER_STATE === 0) {
|
||||
globalStore.URL_RESTORE = to.path
|
||||
// next('/')
|
||||
globalStore.TIMER_STATE = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 200)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (globalStore.finishLoading) {
|
||||
if (globalStore.TIMER) {
|
||||
// console.log('TIMER_STATE', TIMER_STATE, 'to.path', to.path)
|
||||
if (globalStore.URL_RITORNA === '' && globalStore.URL_RESTORE !== '') {
|
||||
globalStore.URL_RITORNA = globalStore.URL_RESTORE
|
||||
// onsole.log('URL_RITORNA', URL_RITORNA)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// await tools.aspettansec(4000)
|
||||
}
|
||||
|
||||
if (from.name && from.matched[0].name === to.name && from.meta.isModal) {
|
||||
next()
|
||||
console.log('Route interceptor log: <1>')
|
||||
return
|
||||
}
|
||||
// else if (from.name === to.name && isEqual(from.params, to.params)) {
|
||||
if (from.name === to.name) {
|
||||
console.log('Route interceptor log: <2>')
|
||||
console.log('from e to: ', from, to)
|
||||
next()
|
||||
} else {
|
||||
if (!to.meta.transparent && !to.meta.isModal) {
|
||||
// console.log('Route interceptor log: <4>')
|
||||
progressBar.start()
|
||||
} else if (to.meta.transparent && !from.name) {
|
||||
console.log('Route interceptor log: <5>')
|
||||
progressBar.start()
|
||||
} else if (to.meta.transparent && !to.matched.some((m) => m.name === from.name)) {
|
||||
console.log('Route interceptor log: <6>')
|
||||
progressBar.start()
|
||||
}
|
||||
|
||||
// Check requires auth
|
||||
if (to.matched.some((m) => m.meta.requiresAuth)) {
|
||||
// await LoginStore.actions.refreshUserInfos()
|
||||
if (tools.isLoggedToSystem()) {
|
||||
if (to.meta.asyncData) {
|
||||
await getRouteData(to)
|
||||
}
|
||||
} else {
|
||||
// LoginStore.mutations.showLoginRoute(to.fullPath)
|
||||
if (from.name) {
|
||||
progressBar.hide()
|
||||
} else {
|
||||
// next('/')
|
||||
}
|
||||
|
||||
$router.push({ name: 'pages.SignIn' })
|
||||
return
|
||||
}
|
||||
} else if (to.matched.some((m) => m.meta.noAuth) && userStore.isLogged) {
|
||||
next('/')
|
||||
} else if (to.meta.asyncData) {
|
||||
await getRouteData(to)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// if (to.meta.middleware) {
|
||||
// const middleware = Array.isArray(to.meta.middleware)
|
||||
// ? to.meta.middleware
|
||||
// : [to.meta.middleware]
|
||||
//
|
||||
// const context = {
|
||||
// from,
|
||||
// next,
|
||||
// Router,
|
||||
// to
|
||||
// }
|
||||
//
|
||||
// const nextMiddleware = nextFactory(context, middleware, 1)
|
||||
//
|
||||
// return middleware[0]({ ...context, next: nextMiddleware })
|
||||
// }
|
||||
//
|
||||
return next()
|
||||
} catch
|
||||
(err) {
|
||||
console.log('Route error:', err)
|
||||
progressBar.fail()
|
||||
}
|
||||
})
|
||||
|
||||
// const getRouteData = async (to: IMyRoute | IMyRouteRecord) => {
|
||||
|
||||
|
||||
@@ -209,6 +209,7 @@ const msg_enUs = {
|
||||
domanda_rejectedtrust: 'Rifiutare la Fiducia a {username}?',
|
||||
rejected: 'Rifiutato la Fiducia',
|
||||
domanda_blockuser: 'Bloccare {username}?',
|
||||
domanda_reportuser: 'Segnalare l\'utente {username}?',
|
||||
domanda_blockgroup: 'Bloccare il gruppo {groupname}?',
|
||||
blockedfriend: 'Utente Bloccato',
|
||||
domanda: 'Domanda',
|
||||
@@ -389,6 +390,10 @@ const msg_enUs = {
|
||||
trust_modified: 'Fiducia Modificata',
|
||||
blocked: 'Bloccato',
|
||||
username_who_block: 'Bloccato da',
|
||||
date_blocked: 'Data Blocco',
|
||||
reported: 'Segnalato',
|
||||
username_who_reported: 'Segnalato da',
|
||||
date_reported: 'Data Segnalaz.',
|
||||
username_regala_invitato: 'Username del Destinatario del regalo',
|
||||
aportador_solidario_nome_completo: 'A.S. Name',
|
||||
aportador_solidario_nome_completo_orig: 'Invitante Originario',
|
||||
@@ -896,6 +901,7 @@ const msg_enUs = {
|
||||
cancel_ask_friend: 'Annulla la richiesta di Amicizia',
|
||||
cancel_ask_friend_short: 'Annulla richiesta',
|
||||
reject_ask_friend: 'Rifiuta la richiesta di Amicizia',
|
||||
report_user: 'Segnala Utente',
|
||||
},
|
||||
groups: {
|
||||
member: 'membro',
|
||||
|
||||
@@ -180,6 +180,7 @@ const msg_es = {
|
||||
rejected: 'Rifiutato la Fiducia',
|
||||
domanda_blockuser: 'Bloccare {username}?',
|
||||
domanda_blockgroup: 'Bloccare il gruppo {groupname}?',
|
||||
reporteduser: 'Utente Segnalato',
|
||||
blockedfriend: 'Utente Bloccato',
|
||||
domanda: 'Domanda',
|
||||
},
|
||||
|
||||
@@ -200,6 +200,7 @@ const msg_it = {
|
||||
domanda_removegroup: 'Rimuovere dal Gruppo {username} ?',
|
||||
removedfriend: 'Rimosso dalla lista di Amici',
|
||||
removedgroup: 'Rimosso dal Gruppo',
|
||||
refusedgroup: 'Rifiutato richiesta di entrare nel Gruppo',
|
||||
deletedgroup: 'Gruppo Eliminato',
|
||||
domanda_addtofriend: 'Aggiungere agli amici {username}?',
|
||||
domanda_addtogroup: 'Aggiungi {username} al gruppo {groupname}?',
|
||||
@@ -222,7 +223,9 @@ const msg_it = {
|
||||
domanda_rejectedtrust: 'Rifiutare la Fiducia a {username}?',
|
||||
rejected: 'Rifiutato la Fiducia',
|
||||
domanda_blockuser: 'Bloccare {username}?',
|
||||
domanda_reportuser: 'Segnalare l\'utente {username}?',
|
||||
domanda_blockgroup: 'Bloccare il gruppo {groupname}?',
|
||||
reporteduser: 'Utente Segnalato',
|
||||
blockedfriend: 'Utente Bloccato',
|
||||
domanda: 'Domanda',
|
||||
},
|
||||
@@ -992,10 +995,16 @@ const msg_it = {
|
||||
cancel_ask_friend: 'Annulla la richiesta di Amicizia',
|
||||
cancel_ask_friend_short: 'Annulla richiesta',
|
||||
reject_ask_friend: 'Rifiuta l\'Amicizia',
|
||||
report_user: 'Segnala Utente',
|
||||
},
|
||||
groups: {
|
||||
member: 'membro',
|
||||
members: 'membri',
|
||||
accepted: 'Ingresso Accettato',
|
||||
refused: 'Ingresso Rifiutato',
|
||||
deleted: 'Cancellato',
|
||||
blocked: 'Bloccato',
|
||||
removed: 'Rimosso',
|
||||
admin: 'amministratore',
|
||||
admins: 'Amministratori',
|
||||
ask_group: 'Chiedi di entrare nel Gruppo',
|
||||
|
||||
@@ -525,6 +525,7 @@ export const colmyUserPeople = [
|
||||
name: 'profile.img', field: 'profile', subfield: 'img', label_trans: 'reg.img', sortable: false,
|
||||
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit,
|
||||
}),
|
||||
AddCol({ name: 'reported', label_trans: 'reg.reported', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({
|
||||
name: 'profile.born_city_id', label_trans: 'reg.born_city', fieldtype: costanti.FieldType.select_by_server,
|
||||
jointable: 'cities',
|
||||
@@ -2153,6 +2154,10 @@ export const colTableUsersISP = [
|
||||
AddCol({ name: 'trust_modified', label_trans: 'reg.trust_modified', fieldtype: costanti.FieldType.date }),
|
||||
AddCol({ name: 'blocked', label_trans: 'reg.blocked', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'username_who_block', label_trans: 'reg.username_who_block' }),
|
||||
AddCol({ name: 'date_blocked', label_trans: 'reg.date_blocked', fieldtype: costanti.FieldType.date }),
|
||||
AddCol({ name: 'reported', label_trans: 'reg.reported', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'username_who_reported', label_trans: 'reg.username_who_reported' }),
|
||||
AddCol({ name: 'date_reported', label_trans: 'reg.date_reported', fieldtype: costanti.FieldType.date }),
|
||||
AddCol({
|
||||
name: 'profile.resplist',
|
||||
field: 'profile',
|
||||
|
||||
@@ -4671,6 +4671,22 @@ export const tools = {
|
||||
})
|
||||
},
|
||||
|
||||
reportUser($q: any, username: string, usernameDest: string) { // Segnala Profilo
|
||||
const userStore = useUserStore()
|
||||
$q.dialog({
|
||||
message: t('db.domanda_reportuser', { username: usernameDest }),
|
||||
ok: { label: t('dialog.yes'), push: true },
|
||||
cancel: { label: t('dialog.cancel') },
|
||||
title: t('db.domanda')
|
||||
}).onOk(() => {
|
||||
userStore.setFriendsCmd($q, t, username, usernameDest, shared_consts.FRIENDSCMD.REPORT_USER, null).then((res: any) => {
|
||||
if (res) {
|
||||
tools.showPositiveNotif($q, t('db.reporteduser'))
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
refuseReqFriends($q: any, username: string, usernameDest: string) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
@@ -4696,6 +4712,7 @@ export const tools = {
|
||||
addToMyGroups($q: any, username: string, groupnameDest: string) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
const notifStore = useNotifStore()
|
||||
$q.dialog({
|
||||
message: t('db.domanda_addtogroup', { username, groupname: groupnameDest }),
|
||||
ok: { label: t('dialog.yes'), push: true },
|
||||
@@ -4703,9 +4720,10 @@ export const tools = {
|
||||
title: t('db.domanda')
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setGroupsCmd($q, t, username, groupnameDest, shared_consts.GROUPSCMD.SETGROUP, null)
|
||||
userStore.setGroupsCmd($q, t, username, groupnameDest, shared_consts.GROUPSCMD.SETGROUP, true)
|
||||
.then((res: any) => {
|
||||
if (res) {
|
||||
notifStore.updateNotification = true
|
||||
if (userStore.my.profile.mygroups)
|
||||
userStore.my.profile.mygroups = [...userStore.my.profile.mygroups, res]
|
||||
else
|
||||
@@ -4716,6 +4734,27 @@ export const tools = {
|
||||
})
|
||||
},
|
||||
|
||||
refuseReqGroup($q: any, username: string, groupnameDest: string) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
const notifStore = useNotifStore()
|
||||
$q.dialog({
|
||||
message: t('db.domanda_revoke_group', { groupname: groupnameDest }),
|
||||
ok: { label: t('dialog.yes'), push: true },
|
||||
cancel: { label: t('dialog.cancel') },
|
||||
title: t('db.domanda')
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setGroupsCmd($q, t, username, groupnameDest, shared_consts.GROUPSCMD.REFUSE_REQ_GROUP, null).then((res) => {
|
||||
if (res) {
|
||||
notifStore.updateNotification = true
|
||||
userStore.my.profile.asked_groups = userStore.my.profile.asked_groups.filter((rec: IMyGroup) => rec.groupname !== groupnameDest)
|
||||
tools.showPositiveNotif($q, t('db.refusedgroup'))
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
blockGroup($q: any, username: string, usernameDest: string) {
|
||||
const userStore = useUserStore()
|
||||
|
||||
@@ -5063,6 +5102,8 @@ export const tools = {
|
||||
tools.addToMyGroups($q, username, dest)
|
||||
} else if (cmd === shared_consts.GROUPSCMD.REQGROUP) {
|
||||
tools.setRequestGroup($q, username, dest, value)
|
||||
} else if (cmd === shared_consts.GROUPSCMD.REFUSE_REQ_GROUP) {
|
||||
tools.refuseReqGroup($q, username, dest)
|
||||
} else if (cmd === shared_consts.GROUPSCMD.CANCEL_REQ_GROUP) {
|
||||
tools.cancelReqGroups($q, username, dest)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.REMOVE_FROM_MYFRIENDS) {
|
||||
|
||||
@@ -116,6 +116,7 @@ export default defineComponent({
|
||||
'profile.img': 1,
|
||||
'profile.born_city_id': 1,
|
||||
'profile.qualifica': 1,
|
||||
reported: 1,
|
||||
}
|
||||
},
|
||||
lookup2: {
|
||||
@@ -135,6 +136,7 @@ export default defineComponent({
|
||||
mycities: 1,
|
||||
'profile.img': 1,
|
||||
'profile.qualifica': 1,
|
||||
reported: 1,
|
||||
'profile.born_city_id': 1,
|
||||
}
|
||||
},
|
||||
|
||||
@@ -155,6 +155,7 @@ export default defineComponent({
|
||||
'profile.img': 1,
|
||||
'profile.mygroups': 1,
|
||||
'profile.qualifica': 1,
|
||||
reported: 1,
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
@@ -31,6 +31,11 @@
|
||||
</q-avatar>
|
||||
</div>
|
||||
|
||||
<div v-if="myuser.reported">
|
||||
<CTitleBanner title="L'utente è stato Segnalato per comportamento non idoneo." bgcolor="bg-red" clcolor="text-white">
|
||||
</CTitleBanner>
|
||||
</div>
|
||||
|
||||
<div v-if="static_data.functionality.SHOW_NAMESURNAME">
|
||||
<div class="text-h6">
|
||||
<span v-if="checkifShow('name')"> {{ myuser.name }}</span> <span v-if="checkifShow('surname')">{{
|
||||
@@ -105,6 +110,13 @@
|
||||
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 clickable v-close-popup @click="tools.reportUser($q, userStore.my.username, myuser.username)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-user-minus"/>
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('friends.report_user') }}</q-item-section>
|
||||
</q-item>
|
||||
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
|
||||
Reference in New Issue
Block a user