Group Page corrected
This commit is contained in:
2
grp.js
2
grp.js
@@ -82,6 +82,8 @@ db.getCollection('mygoods').aggregate(
|
|||||||
"profile.mygroups": 1,
|
"profile.mygroups": 1,
|
||||||
"profile.qualifica": 1,
|
"profile.qualifica": 1,
|
||||||
reported: 1,
|
reported: 1,
|
||||||
|
date_report: 1,
|
||||||
|
username_who_report: 1,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -67,6 +67,8 @@ db.getCollection('myskills').aggregate(
|
|||||||
"mycities": 1,
|
"mycities": 1,
|
||||||
"profile.img": 1,
|
"profile.img": 1,
|
||||||
reported: 1,
|
reported: 1,
|
||||||
|
date_report: 1,
|
||||||
|
username_who_report: 1,
|
||||||
"profile.mygroups": 1,
|
"profile.mygroups": 1,
|
||||||
"profile.qualifica": 1
|
"profile.qualifica": 1
|
||||||
}
|
}
|
||||||
@@ -121,6 +123,8 @@ db.getCollection('myskills').aggregate(
|
|||||||
"mycities": 1,
|
"mycities": 1,
|
||||||
"profile.img": 1,
|
"profile.img": 1,
|
||||||
reported: 1,
|
reported: 1,
|
||||||
|
date_report: 1,
|
||||||
|
username_who_report: 1,
|
||||||
"profile.mygroups": 1,
|
"profile.mygroups": 1,
|
||||||
"profile.qualifica": 1
|
"profile.qualifica": 1
|
||||||
}
|
}
|
||||||
@@ -175,6 +179,8 @@ db.getCollection('myskills').aggregate(
|
|||||||
"mycities": 1,
|
"mycities": 1,
|
||||||
"profile.img": 1,
|
"profile.img": 1,
|
||||||
reported: 1,
|
reported: 1,
|
||||||
|
date_report: 1,
|
||||||
|
username_who_report: 1,
|
||||||
"profile.mygroups": 1,
|
"profile.mygroups": 1,
|
||||||
"profile.qualifica": 1
|
"profile.qualifica": 1
|
||||||
}
|
}
|
||||||
@@ -229,6 +235,8 @@ db.getCollection('myskills').aggregate(
|
|||||||
"mycities": 1,
|
"mycities": 1,
|
||||||
"profile.img": 1,
|
"profile.img": 1,
|
||||||
reported: 1,
|
reported: 1,
|
||||||
|
date_report: 1,
|
||||||
|
username_who_report: 1,
|
||||||
"profile.mygroups": 1,
|
"profile.mygroups": 1,
|
||||||
"profile.qualifica": 1
|
"profile.qualifica": 1
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,6 +71,8 @@ export const shared_consts = {
|
|||||||
BLOCK_GROUP: 1155,
|
BLOCK_GROUP: 1155,
|
||||||
FIND_GROUP: 1166,
|
FIND_GROUP: 1166,
|
||||||
DELETE_GROUP: 1170,
|
DELETE_GROUP: 1170,
|
||||||
|
ADDADMIN_OFMYGROUP: 1180,
|
||||||
|
REMOVEADMIN_OFMYGROUP: 1185,
|
||||||
},
|
},
|
||||||
|
|
||||||
PUBTOSHARE: {
|
PUBTOSHARE: {
|
||||||
|
|||||||
@@ -1006,6 +1006,8 @@ export default defineComponent({
|
|||||||
'profile.mygroups': 1,
|
'profile.mygroups': 1,
|
||||||
'profile.qualifica': 1,
|
'profile.qualifica': 1,
|
||||||
reported: 1,
|
reported: 1,
|
||||||
|
date_report: 1,
|
||||||
|
username_who_report: 1,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
lookup3: {
|
lookup3: {
|
||||||
@@ -1071,6 +1073,8 @@ export default defineComponent({
|
|||||||
'profile.mygroups': 1,
|
'profile.mygroups': 1,
|
||||||
'profile.qualifica': 1,
|
'profile.qualifica': 1,
|
||||||
reported: 1,
|
reported: 1,
|
||||||
|
date_report: 1,
|
||||||
|
username_who_report: 1,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
lookup3: {
|
lookup3: {
|
||||||
@@ -1185,6 +1189,8 @@ export default defineComponent({
|
|||||||
'profile.mygroups': 1,
|
'profile.mygroups': 1,
|
||||||
'profile.qualifica': 1,
|
'profile.qualifica': 1,
|
||||||
reported: 1,
|
reported: 1,
|
||||||
|
date_report: 1,
|
||||||
|
username_who_report: 1,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
lookup3: {
|
lookup3: {
|
||||||
|
|||||||
@@ -71,8 +71,8 @@ export default defineComponent({
|
|||||||
const myoptions = computed(() => {
|
const myoptions = computed(() => {
|
||||||
const mybutt = []
|
const mybutt = []
|
||||||
mybutt.push({ label: t('mypages.find_group'), value: costanti.FIND_GROUP })
|
mybutt.push({ label: t('mypages.find_group'), value: costanti.FIND_GROUP })
|
||||||
// mybutt.push({ label: t('mypages.manage_my_groups') + ' (' + numManageGroups.value + ')', value: costanti.MANAGE_GROUPS })
|
|
||||||
mybutt.push({ label: t('mypages.follow_groups') + ' (' + numMyGroups.value + ')', value: costanti.MY_GROUPS })
|
mybutt.push({ label: t('mypages.follow_groups') + ' (' + numMyGroups.value + ')', value: costanti.MY_GROUPS })
|
||||||
|
// mybutt.push({ label: t('mypages.manage_my_groups') + ' (' + numManageGroups.value + ')', value: costanti.MANAGE_GROUPS })
|
||||||
|
|
||||||
if (numAskSentGroups.value > 0 || props.modelValue === costanti.ASK_SENT_GROUP)
|
if (numAskSentGroups.value > 0 || props.modelValue === costanti.ASK_SENT_GROUP)
|
||||||
mybutt.push({
|
mybutt.push({
|
||||||
|
|||||||
@@ -7,11 +7,12 @@
|
|||||||
</q-avatar>
|
</q-avatar>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
|
|
||||||
|
|
||||||
<q-item-section @click="naviga(`/my/` + contact.username)">
|
<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="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 v-if="contact.name || contact.surname">{{ contact.username }} <span v-if="contact.name">({{ contact.name }} {{ contact.surname }})</span>
|
||||||
</q-item-label>
|
</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.reported" caption lines="1"><em style="color: red; font-weight: bold">{{ $t('db.reporteduser', {date_report: tools.getstrDateTimeShort(contact.date_report)}) }}</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 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 caption lines="1"></q-item-label>
|
||||||
<q-item-label v-if="labelFooter" lines="1"><em>{{ labelFooter }}</em></q-item-label>
|
<q-item-label v-if="labelFooter" lines="1"><em>{{ labelFooter }}</em></q-item-label>
|
||||||
@@ -97,8 +98,20 @@
|
|||||||
<q-item-label v-if="contact.username !== userStore.my.username">
|
<q-item-label v-if="contact.username !== userStore.my.username">
|
||||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
<q-btn rounded icon="fas fa-ellipsis-h">
|
||||||
<q-menu>
|
<q-menu>
|
||||||
<q-list style="min-width: 150px">
|
<q-list style="min-width: 150px">
|
||||||
<q-item clickable v-close-popup @click="tools.removeFromMyGroups($q, contact.username, groupname)">
|
<q-item clickable v-if="!tools.isUserAdminGroup(groupname, contact.username)" v-close-popup @click="tools.addtoAdminOfMyGroup($q, contact.username, groupname)">
|
||||||
|
<q-item-section avatar>
|
||||||
|
<q-icon color="positive" name="fas fa-user-shield"/>
|
||||||
|
</q-item-section>
|
||||||
|
<q-item-section>{{ $t('groups.addasadmin') }}</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
<q-item clickable v-if="tools.isUserAdminGroup(groupname, contact.username) && tools.iAmTheCreatorOfTheGroup(groupname)" v-close-popup @click="tools.removeAdminOfMyGroup($q, contact.username, groupname)">
|
||||||
|
<q-item-section avatar>
|
||||||
|
<q-icon color="negative" name="fas fa-user-times"/>
|
||||||
|
</q-item-section>
|
||||||
|
<q-item-section>{{ $t('groups.remove_as_admin') }}</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
<q-item clickable v-if="!tools.isUserTheCreatorOfTheGroup(groupname, contact.username)" v-close-popup @click="tools.removeFromMyGroups($q, contact.username, groupname)">
|
||||||
<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>
|
||||||
@@ -165,33 +178,35 @@
|
|||||||
<q-btn v-if="contact.username !== userStore.my.username" rounded
|
<q-btn v-if="contact.username !== userStore.my.username" rounded
|
||||||
:icon="userStore.IsMyFriendByUsername(contact.username) ? `fas fa-ellipsis-h` : `fas fa-user`">
|
:icon="userStore.IsMyFriendByUsername(contact.username) ? `fas fa-ellipsis-h` : `fas fa-user`">
|
||||||
<q-menu>
|
<q-menu>
|
||||||
<q-list v-if="(!userStore.IsMyFriendByUsername(contact.username) && !userStore.IsAskedFriendByUsername(contact.username))"
|
<q-list style="min-width: 200px">
|
||||||
style="min-width: 200px">
|
<q-item v-if="(!userStore.IsMyFriendByUsername(contact.username) && !userStore.IsAskedFriendByUsername(contact.username))"
|
||||||
<q-item clickable v-close-popup @click="setCmd($q, shared_consts.FRIENDSCMD.REQFRIEND, userStore.my.username, true, contact.username)">
|
clickable v-close-popup @click="setCmd($q, shared_consts.FRIENDSCMD.REQFRIEND, userStore.my.username, true, contact.username)">
|
||||||
<q-item-section avatar>
|
<q-item-section avatar>
|
||||||
<q-icon color="positive" name="fas fa-user-plus"/>
|
<q-icon color="positive" name="fas fa-user-plus"/>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section>{{ $t('friends.ask_friend') }}</q-item-section>
|
<q-item-section>{{ $t('friends.ask_friend') }}</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
</q-list>
|
<q-item v-else-if="(!userStore.IsMyFriendByUsername(contact.username) && userStore.IsAskedFriendByUsername(contact.username))"
|
||||||
<q-list v-else-if="(!userStore.IsMyFriendByUsername(contact.username) && userStore.IsAskedFriendByUsername(contact.username))"
|
clickable v-close-popup @click="setCmd($q, shared_consts.FRIENDSCMD.REQFRIEND, userStore.my.username, false, 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-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.cancel_ask_friend') }}</q-item-section>
|
<q-item-section>{{ $t('friends.cancel_ask_friend') }}</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
</q-list>
|
<q-item v-else-if="userStore.IsMyFriendByUsername(contact.username)" style="min-width: 200px"
|
||||||
<q-list v-else-if="userStore.IsMyFriendByUsername(contact.username)" style="min-width: 200px">
|
clickable v-close-popup
|
||||||
<q-item clickable v-close-popup
|
|
||||||
@click="setCmd($q, shared_consts.FRIENDSCMD.REMOVE_FROM_MYFRIENDS, userStore.my.username, '', contact.username)">
|
@click="setCmd($q, shared_consts.FRIENDSCMD.REMOVE_FROM_MYFRIENDS, userStore.my.username, '', contact.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.remove_from_myfriends') }}</q-item-section>
|
<q-item-section>{{ $t('friends.remove_from_myfriends') }}</q-item-section>
|
||||||
</q-item>
|
</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-list>
|
||||||
</q-menu>
|
</q-menu>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ export interface IMyGroup {
|
|||||||
link_telegram?: string
|
link_telegram?: string
|
||||||
username_who_block?: string
|
username_who_block?: string
|
||||||
date_blocked?: Date
|
date_blocked?: Date
|
||||||
|
createdBy?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ICalcStat {
|
export interface ICalcStat {
|
||||||
|
|||||||
@@ -100,9 +100,9 @@
|
|||||||
class="bg-red text-white"
|
class="bg-red text-white"
|
||||||
style="text-align: center;"
|
style="text-align: center;"
|
||||||
>
|
>
|
||||||
<em style="font-weight: bold">{{ $t('db.reporteduser') }}<br>
|
<em style="font-weight: bold">{{ $t('db.reporteduser', {date_report: tools.getstrDateTimeShort(myuser.date_report)}) }}<br>
|
||||||
da: {{ myuser.username_who_report }}<br>
|
da: {{ myuser.username_who_report }}<br>
|
||||||
in Data: {{ tools.getstrshortDateTime(myuser.date_report) }} </em>
|
</em>
|
||||||
</q-banner>
|
</q-banner>
|
||||||
|
|
||||||
<q-btn color="green" :label="`Sblocca ` + myuser.username" @click="tools.unblockUser($q, getMyUsername(), myuser.username)"></q-btn>
|
<q-btn color="green" :label="`Sblocca ` + myuser.username" @click="tools.unblockUser($q, getMyUsername(), myuser.username)"></q-btn>
|
||||||
|
|||||||
@@ -158,6 +158,7 @@ const msg_es = {
|
|||||||
domanda_removegroup: 'Rimuovere dal Gruppo {username} ?',
|
domanda_removegroup: 'Rimuovere dal Gruppo {username} ?',
|
||||||
removedfriend: 'Rimosso dalla lista di Amici',
|
removedfriend: 'Rimosso dalla lista di Amici',
|
||||||
removedgroup: 'Rimosso dal Gruppo',
|
removedgroup: 'Rimosso dal Gruppo',
|
||||||
|
addedtoadmin: 'Aggiunto {username} come amministratore',
|
||||||
domanda_addtofriend: 'Aggiungere agli amici {username}?',
|
domanda_addtofriend: 'Aggiungere agli amici {username}?',
|
||||||
domanda_addtogroup: 'Aggiungi {username} al gruppo {groupname}?',
|
domanda_addtogroup: 'Aggiungi {username} al gruppo {groupname}?',
|
||||||
addedfriend: 'Aggiunto alla lista di Amici',
|
addedfriend: 'Aggiunto alla lista di Amici',
|
||||||
@@ -180,7 +181,7 @@ const msg_es = {
|
|||||||
rejected: 'Rifiutato la Fiducia',
|
rejected: 'Rifiutato la Fiducia',
|
||||||
domanda_blockuser: 'Bloccare {username}?',
|
domanda_blockuser: 'Bloccare {username}?',
|
||||||
domanda_blockgroup: 'Bloccare il gruppo {groupname}?',
|
domanda_blockgroup: 'Bloccare il gruppo {groupname}?',
|
||||||
reporteduser: 'Utente Segnalato',
|
reporteduser: 'Utente Segnalato in data {date_report}',
|
||||||
blockedfriend: 'Utente Bloccato',
|
blockedfriend: 'Utente Bloccato',
|
||||||
domanda: 'Domanda',
|
domanda: 'Domanda',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -198,8 +198,12 @@ const msg_it = {
|
|||||||
domanda_exit_fromgroup: 'Uscire dal Gruppo {groupname} ?',
|
domanda_exit_fromgroup: 'Uscire dal Gruppo {groupname} ?',
|
||||||
domanda_remove_group: 'Sicuro di voler Eliminare il Gruppo {groupname} ?',
|
domanda_remove_group: 'Sicuro di voler Eliminare il Gruppo {groupname} ?',
|
||||||
domanda_removegroup: 'Rimuovere dal Gruppo {username} ?',
|
domanda_removegroup: 'Rimuovere dal Gruppo {username} ?',
|
||||||
|
domanda_addadminofmygroup: 'Aggiungere {username} come Amministratore del Gruppo {groupname} ?',
|
||||||
|
domanda_removeadminofmygroup: 'Rimuovere {username} dall\' incarico di Amministratore del Gruppo {groupname} ?',
|
||||||
removedfriend: 'Rimosso dalla lista di Amici',
|
removedfriend: 'Rimosso dalla lista di Amici',
|
||||||
removedgroup: 'Rimosso dal Gruppo',
|
removedgroup: 'Rimosso dal Gruppo',
|
||||||
|
addedtoadmin: 'Aggiunto {username} come amministratore',
|
||||||
|
removedtoadmin: 'Rimosso {username} come amministratore',
|
||||||
refusedgroup: 'Rifiutato a {username} la richiesta di entrare nel Gruppo',
|
refusedgroup: 'Rifiutato a {username} la richiesta di entrare nel Gruppo',
|
||||||
youarerefusedgroup: 'Ti è stato rifiutata la richiesta di entrare in questo Gruppo (per info chiedi all\'amministratore del gruppo)',
|
youarerefusedgroup: 'Ti è stato rifiutata la richiesta di entrare in questo Gruppo (per info chiedi all\'amministratore del gruppo)',
|
||||||
deletedgroup: 'Gruppo Eliminato',
|
deletedgroup: 'Gruppo Eliminato',
|
||||||
@@ -228,7 +232,7 @@ const msg_it = {
|
|||||||
domanda_unblockuser: 'Sbloccare {username}?',
|
domanda_unblockuser: 'Sbloccare {username}?',
|
||||||
domanda_reportuser: 'Segnalare l\'utente {username}?',
|
domanda_reportuser: 'Segnalare l\'utente {username}?',
|
||||||
domanda_blockgroup: 'Bloccare il gruppo {groupname}?',
|
domanda_blockgroup: 'Bloccare il gruppo {groupname}?',
|
||||||
reporteduser: 'Utente Segnalato',
|
reporteduser: 'Utente Segnalato in data {date_report}',
|
||||||
blockedfriend: 'Utente Bloccato',
|
blockedfriend: 'Utente Bloccato',
|
||||||
unblockedfriend: 'Utente Sbloccato',
|
unblockedfriend: 'Utente Sbloccato',
|
||||||
domanda: 'Domanda',
|
domanda: 'Domanda',
|
||||||
@@ -677,7 +681,7 @@ const msg_it = {
|
|||||||
endwork_estimate: 'Data fine lavori stimata',
|
endwork_estimate: 'Data fine lavori stimata',
|
||||||
privacyread: 'Chi lo puo vedere:',
|
privacyread: 'Chi lo puo vedere:',
|
||||||
privacywrite: 'Chi lo puo modificare:',
|
privacywrite: 'Chi lo puo modificare:',
|
||||||
createdby: 'Creato da:',
|
createdby: 'Creato da',
|
||||||
tipovisu: 'Visualizzazione:',
|
tipovisu: 'Visualizzazione:',
|
||||||
totalphases: 'Totale Fasi',
|
totalphases: 'Totale Fasi',
|
||||||
themecolor: 'Tema Colore',
|
themecolor: 'Tema Colore',
|
||||||
@@ -969,8 +973,8 @@ const msg_it = {
|
|||||||
mypages: {
|
mypages: {
|
||||||
find_people: 'Cerca Persone',
|
find_people: 'Cerca Persone',
|
||||||
find_group: 'Cerca Gruppo',
|
find_group: 'Cerca Gruppo',
|
||||||
manage_my_groups: 'Gruppi che Gestisco',
|
manage_my_groups: 'Amministratore',
|
||||||
follow_groups: 'Miei Gruppi (di cui fai parte)',
|
follow_groups: 'Gruppi di cui fai parte',
|
||||||
create_group: 'Crea Gruppo',
|
create_group: 'Crea Gruppo',
|
||||||
friends: 'Amici',
|
friends: 'Amici',
|
||||||
bacheca: 'Bacheca',
|
bacheca: 'Bacheca',
|
||||||
@@ -1014,10 +1018,14 @@ const msg_it = {
|
|||||||
removed: 'Rimosso',
|
removed: 'Rimosso',
|
||||||
admin: 'amministratore',
|
admin: 'amministratore',
|
||||||
admins: 'Amministratori',
|
admins: 'Amministratori',
|
||||||
|
createdby: 'Creato da {username} in data {date}',
|
||||||
|
subscribes: 'Iscritti',
|
||||||
ask_group: 'Chiedi di entrare nel Gruppo',
|
ask_group: 'Chiedi di entrare nel Gruppo',
|
||||||
exit_group: 'Esci dal Gruppo',
|
exit_group: 'Esci dal Gruppo',
|
||||||
delete_group: 'Elimina il Gruppo',
|
delete_group: 'Elimina il Gruppo',
|
||||||
accept_group: 'Accetta la richiesta',
|
accept_group: 'Accetta la richiesta',
|
||||||
|
addasadmin: 'Aggiungi come Admin del Gruppo',
|
||||||
|
remove_as_admin: 'Rimuovi come Admin del Gruppo',
|
||||||
remove_from_mygroups: 'Rimuovi dal Gruppo',
|
remove_from_mygroups: 'Rimuovi dal Gruppo',
|
||||||
block_group: 'Blocca Gruppo',
|
block_group: 'Blocca Gruppo',
|
||||||
cancel_ask_group: 'Annulla la richiesta',
|
cancel_ask_group: 'Annulla la richiesta',
|
||||||
|
|||||||
@@ -191,6 +191,7 @@ export const costanti = {
|
|||||||
USER_GROUPS: 22,
|
USER_GROUPS: 22,
|
||||||
CREATE_GROUP: 30,
|
CREATE_GROUP: 30,
|
||||||
MANAGE_GROUPS: 31,
|
MANAGE_GROUPS: 31,
|
||||||
|
ADMIN_GROUPS: 40,
|
||||||
|
|
||||||
CMD_DELETE: 1,
|
CMD_DELETE: 1,
|
||||||
CMD_MODIFY: 2,
|
CMD_MODIFY: 2,
|
||||||
|
|||||||
@@ -596,6 +596,7 @@ export const colmyUserGroup = [
|
|||||||
fieldtype: costanti.FieldType.multiselect,
|
fieldtype: costanti.FieldType.multiselect,
|
||||||
jointable: 'friendsandme',
|
jointable: 'friendsandme',
|
||||||
field_outtype: costanti.FieldType.object,
|
field_outtype: costanti.FieldType.object,
|
||||||
|
showWhen: costanti.showWhen.InView_OnlyifExist,
|
||||||
}),
|
}),
|
||||||
AddCol({
|
AddCol({
|
||||||
name: 'date_created', label_trans: 'reg.pub_created', fieldtype: costanti.FieldType.onlydate,
|
name: 'date_created', label_trans: 'reg.pub_created', fieldtype: costanti.FieldType.onlydate,
|
||||||
|
|||||||
@@ -4811,6 +4811,54 @@ export const tools = {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
addtoAdminOfMyGroup($q: any, username: string, groupnameDest: string, domanda: any = '') {
|
||||||
|
const userStore = useUserStore()
|
||||||
|
|
||||||
|
$q.dialog({
|
||||||
|
message: domanda ? domanda : t('db.domanda_addadminofmygroup', { username, 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.ADDADMIN_OFMYGROUP, null).then((res) => {
|
||||||
|
if (res) {
|
||||||
|
const mygrp = userStore.my.profile.manage_mygroups.find((rec: IMyGroup) => rec.groupname === groupnameDest)
|
||||||
|
console.log('mygrp', mygrp)
|
||||||
|
if (mygrp && mygrp.admins) {
|
||||||
|
mygrp.admins = [...mygrp.admins, {username, date: new Date}]
|
||||||
|
console.log('mygrp.admins', mygrp.admins)
|
||||||
|
tools.showPositiveNotif($q, t('db.addedtoadmin', { username }))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
removeAdminOfMyGroup($q: any, username: string, groupnameDest: string, domanda: any = '') {
|
||||||
|
const userStore = useUserStore()
|
||||||
|
|
||||||
|
$q.dialog({
|
||||||
|
message: domanda ? domanda : t('db.domanda_removeadminofmygroup', { username, 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.REMOVEADMIN_OFMYGROUP, null).then((res) => {
|
||||||
|
if (res) {
|
||||||
|
const mygrp = userStore.my.profile.manage_mygroups.find((rec: IMyGroup) => rec.groupname === groupnameDest)
|
||||||
|
console.log('mygrp', mygrp)
|
||||||
|
if (mygrp && mygrp.admins) {
|
||||||
|
mygrp.admins = mygrp.admins.filter((rec: any) => rec.username !== username)
|
||||||
|
console.log('mygrp.admins', mygrp.admins)
|
||||||
|
tools.showPositiveNotif($q, t('db.removedtoadmin', { username }))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
DeleteGroup($q: any, username: string, groupnameDest: string, domanda: any = '') {
|
DeleteGroup($q: any, username: string, groupnameDest: string, domanda: any = '') {
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
|
||||||
@@ -5107,6 +5155,69 @@ export const tools = {
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
iAmTheCreatorOfTheGroup(groupname: string) {
|
||||||
|
const userStore = useUserStore()
|
||||||
|
|
||||||
|
let risultato = false
|
||||||
|
|
||||||
|
if (userStore.my.profile.manage_mygroups) {
|
||||||
|
const ris = userStore.my.profile.manage_mygroups.find((grp: IMyGroup) => {
|
||||||
|
if (grp.groupname === groupname) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// console.log('ris', ris)
|
||||||
|
return (ris && ris.createdBy === userStore.my.username)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return risultato
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
isUserTheCreatorOfTheGroup(groupname: string, username: string) {
|
||||||
|
const userStore = useUserStore()
|
||||||
|
|
||||||
|
let risultato = false
|
||||||
|
|
||||||
|
if (userStore.my.profile.manage_mygroups) {
|
||||||
|
const ris = userStore.my.profile.manage_mygroups.find((grp: IMyGroup) => {
|
||||||
|
if (grp.groupname === groupname) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// console.log('ris', ris)
|
||||||
|
return (ris && ris.createdBy === username)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return risultato
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
isUserAdminGroup(groupname: string, username: string) {
|
||||||
|
const userStore = useUserStore()
|
||||||
|
|
||||||
|
let risultato = false
|
||||||
|
|
||||||
|
if (userStore.my.profile.manage_mygroups) {
|
||||||
|
const ris = userStore.my.profile.manage_mygroups.find((grp: IMyGroup) => {
|
||||||
|
if (grp.groupname === groupname) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// console.log('ris', ris)
|
||||||
|
if (ris && ris.admins) {
|
||||||
|
const isadmin = ris.admins.find((user: IFriends) => user.username === username)
|
||||||
|
risultato = !!isadmin
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return risultato
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
setCmd($q: any, cmd: number, username: string, value: any, dest: string) {
|
setCmd($q: any, cmd: number, username: string, value: any, dest: string) {
|
||||||
console.log('setcmd', cmd)
|
console.log('setcmd', cmd)
|
||||||
if (cmd === shared_consts.GROUPSCMD.REMOVE_FROM_MYGROUP) {
|
if (cmd === shared_consts.GROUPSCMD.REMOVE_FROM_MYGROUP) {
|
||||||
@@ -5117,6 +5228,10 @@ export const tools = {
|
|||||||
tools.blockGroup($q, username, dest)
|
tools.blockGroup($q, username, dest)
|
||||||
} else if (cmd === shared_consts.GROUPSCMD.SETGROUP) {
|
} else if (cmd === shared_consts.GROUPSCMD.SETGROUP) {
|
||||||
tools.addToMyGroups($q, username, dest)
|
tools.addToMyGroups($q, username, dest)
|
||||||
|
} else if (cmd === shared_consts.GROUPSCMD.ADDADMIN_OFMYGROUP) {
|
||||||
|
tools.addtoAdminOfMyGroup($q, username, dest)
|
||||||
|
} else if (cmd === shared_consts.GROUPSCMD.REMOVEADMIN_OFMYGROUP) {
|
||||||
|
tools.removeAdminOfMyGroup($q, username, dest)
|
||||||
} else if (cmd === shared_consts.GROUPSCMD.REQGROUP) {
|
} else if (cmd === shared_consts.GROUPSCMD.REQGROUP) {
|
||||||
tools.setRequestGroup($q, username, dest, value)
|
tools.setRequestGroup($q, username, dest, value)
|
||||||
} else if (cmd === shared_consts.GROUPSCMD.REFUSE_REQ_GROUP) {
|
} else if (cmd === shared_consts.GROUPSCMD.REFUSE_REQ_GROUP) {
|
||||||
|
|||||||
@@ -811,7 +811,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
|||||||
return Api.SendReq('/gettable', 'POST', params)
|
return Api.SendReq('/gettable', 'POST', params)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
this.serverError = false
|
this.serverError = false
|
||||||
// console.table(res)
|
// if (tools.isDebug())
|
||||||
|
// console.table(res)
|
||||||
return res.data
|
return res.data
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
|||||||
@@ -117,6 +117,8 @@ export default defineComponent({
|
|||||||
'profile.born_city_id': 1,
|
'profile.born_city_id': 1,
|
||||||
'profile.qualifica': 1,
|
'profile.qualifica': 1,
|
||||||
reported: 1,
|
reported: 1,
|
||||||
|
date_report: 1,
|
||||||
|
username_who_report: 1,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
lookup2: {
|
lookup2: {
|
||||||
@@ -137,6 +139,8 @@ export default defineComponent({
|
|||||||
'profile.img': 1,
|
'profile.img': 1,
|
||||||
'profile.qualifica': 1,
|
'profile.qualifica': 1,
|
||||||
reported: 1,
|
reported: 1,
|
||||||
|
date_report: 1,
|
||||||
|
username_who_report: 1,
|
||||||
'profile.born_city_id': 1,
|
'profile.born_city_id': 1,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -17,8 +17,10 @@
|
|||||||
padding: 5px;
|
padding: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.members, .admins{
|
.members, .admins, .creator{
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
text-align: center;
|
|
||||||
vertical-align: center;
|
vertical-align: center;
|
||||||
|
padding: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -156,6 +156,8 @@ export default defineComponent({
|
|||||||
'profile.mygroups': 1,
|
'profile.mygroups': 1,
|
||||||
'profile.qualifica': 1,
|
'profile.qualifica': 1,
|
||||||
reported: 1,
|
reported: 1,
|
||||||
|
date_report: 1,
|
||||||
|
username_who_report: 1,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,6 @@
|
|||||||
</q-banner>
|
</q-banner>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="!userStore.IsMyGroupByGroupname(mygrp.groupname) && !userStore.IsAskedGroupByGroupname(mygrp.groupname) && !userStore.IsRefusedGroupByGroupname(mygrp.groupname)"
|
v-if="!userStore.IsMyGroupByGroupname(mygrp.groupname) && !userStore.IsAskedGroupByGroupname(mygrp.groupname) && !userStore.IsRefusedGroupByGroupname(mygrp.groupname)"
|
||||||
@@ -79,6 +78,10 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div v-if="mygrp.descr" class="no-wrap justify-evenly items-center content-start">
|
||||||
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="tools.iAmAdminGroup(groupname)" icon="fas fa-pencil-alt"
|
v-if="tools.iAmAdminGroup(groupname)" icon="fas fa-pencil-alt"
|
||||||
@@ -93,7 +96,7 @@
|
|||||||
<q-tab label="Info" name="info" icon="fas fa-info"></q-tab>
|
<q-tab label="Info" name="info" icon="fas fa-info"></q-tab>
|
||||||
<q-tab v-if="!!mygrp.note" label="Pagina" name="page" icon="fas fa-file-word"></q-tab>
|
<q-tab v-if="!!mygrp.note" label="Pagina" name="page" icon="fas fa-file-word"></q-tab>
|
||||||
<q-tab v-if="userStore.IsMyGroupByGroupname(mygrp.groupname) || tools.iAmAdminGroup(groupname)"
|
<q-tab v-if="userStore.IsMyGroupByGroupname(mygrp.groupname) || tools.iAmAdminGroup(groupname)"
|
||||||
label="Iscritti" name="membri" icon="fas fa-users"></q-tab>
|
:label="t('groups.subscribes')" name="membri" icon="fas fa-users"></q-tab>
|
||||||
<q-tab v-if="tools.iAmAdminGroup(groupname)" label="Richieste" name="rich" icon="fas fa-user-plus"></q-tab>
|
<q-tab v-if="tools.iAmAdminGroup(groupname)" label="Richieste" name="rich" icon="fas fa-user-plus"></q-tab>
|
||||||
<q-tab v-if="tools.iAmAdminGroup(groupname)" label="Rifiutati" name="refused" icon="fas fa-user-minus"></q-tab>
|
<q-tab v-if="tools.iAmAdminGroup(groupname)" label="Rifiutati" name="refused" icon="fas fa-user-minus"></q-tab>
|
||||||
</q-tabs>
|
</q-tabs>
|
||||||
@@ -114,34 +117,48 @@
|
|||||||
</CMyFieldRec>
|
</CMyFieldRec>
|
||||||
</q-card>
|
</q-card>
|
||||||
<q-card>
|
<q-card>
|
||||||
<div class="members">
|
<q-card-section>
|
||||||
<q-icon name="fas fa-users"></q-icon>
|
<div class="text-h6">Attività:</div>
|
||||||
{{ numUsers() }} {{ numUsers() === 1 ? t('groups.member') : t('groups.members') }}
|
</q-card-section>
|
||||||
</div>
|
|
||||||
<div class="admins">
|
<q-separator />
|
||||||
<q-icon name="fas fa-user-cog"></q-icon>
|
|
||||||
{{ numAdmins() }} {{ numAdmins() === 1 ? t('groups.admin') : t('groups.admins') }}
|
<q-card-section>
|
||||||
</div>
|
<div class="creator">
|
||||||
<div v-for="(user, index) of mygrp.admins" :key="index">
|
<q-icon name="fas fa-lightbulb"></q-icon>
|
||||||
<CMyUser
|
{{ $t('groups.createdby', {username: mygrp.createdBy, date: tools.getstrDateLong(mygrp.date_created) }) }}
|
||||||
:mycontact="user"
|
</div>
|
||||||
:visu="costanti.FIND_PEOPLE"
|
<div class="members">
|
||||||
@setCmd="tools.setCmd"
|
<q-icon name="fas fa-users"></q-icon>
|
||||||
>
|
{{ numUsers() }} {{ numUsers() === 1 ? t('groups.member') : t('groups.members') }}
|
||||||
</CMyUser>
|
</div>
|
||||||
</div>
|
<div class="admins">
|
||||||
|
<q-icon name="fas fa-user-cog"></q-icon>
|
||||||
|
{{ numAdmins() }} {{ numAdmins() === 1 ? t('groups.admin') : t('groups.admins') }}
|
||||||
|
</div>
|
||||||
|
<div v-for="(user, index) of mygrp.admins" :key="index">
|
||||||
|
<CMyUser
|
||||||
|
:mycontact="user"
|
||||||
|
:visu="costanti.FIND_PEOPLE"
|
||||||
|
@setCmd="tools.setCmd"
|
||||||
|
>
|
||||||
|
</CMyUser>
|
||||||
|
</div>
|
||||||
|
</q-card-section>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<q-card>
|
<q-card v-if="mygrp.title">
|
||||||
<br>
|
<q-card-section>
|
||||||
<div class="col-12 text-h7">
|
<div class="text-h6">Descrizione:</div>
|
||||||
<span v-if="checkifShow('descr')">{{ mygrp.descr }}</span>
|
</q-card-section>
|
||||||
</div>
|
<q-separator />
|
||||||
</q-card>
|
|
||||||
|
<q-card-section>
|
||||||
|
<div class="col-12 text-h7">
|
||||||
|
<span v-if="checkifShow('descr')">{{ mygrp.descr }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div v-if="mygrp.title" class="myrow justify-evenly items-center q-pa-sm q-ma-sm">
|
|
||||||
<q-card>
|
|
||||||
<div class="col-6 q-ma-xs">
|
<div class="col-6 q-ma-xs">
|
||||||
|
|
||||||
<q-btn
|
<q-btn
|
||||||
@@ -164,9 +181,9 @@
|
|||||||
:href="getLinkWebSite()" target="__blank">
|
:href="getLinkWebSite()" target="__blank">
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
</q-card>
|
|
||||||
|
|
||||||
</div>
|
</q-card-section>
|
||||||
|
</q-card>
|
||||||
|
|
||||||
</q-tab-panel>
|
</q-tab-panel>
|
||||||
|
|
||||||
@@ -180,7 +197,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</q-tab-panel>
|
</q-tab-panel>
|
||||||
|
|
||||||
<q-tab-panel name="membri">
|
<q-tab-panel name="membri" style="max-width: 400px;">
|
||||||
<CGridTableRec
|
<CGridTableRec
|
||||||
ref="tabMembri"
|
ref="tabMembri"
|
||||||
prop_mytable="users"
|
prop_mytable="users"
|
||||||
|
|||||||
Reference in New Issue
Block a user