@@ -55,7 +55,7 @@
v-if="listasharewithus() && listasharewithus().length > 0" class="q-pa-xs"
title="Graduatoria Attuale"
bgcolor="bg-white" clcolor="text-blue"
- mystyle="" myclass="myshad" canopen="true">
+ mystyle="" myclass="myshad" :canopen="true">
diff --git a/src/components/CVideoPromo/CVideoPromo.vue b/src/components/CVideoPromo/CVideoPromo.vue
index be42c725..b48a82eb 100755
--- a/src/components/CVideoPromo/CVideoPromo.vue
+++ b/src/components/CVideoPromo/CVideoPromo.vue
@@ -8,7 +8,7 @@
class="q-pa-xs" :title="$t('steps.video_intro_1', {sitename: $t('ws.sitename')})"
bgcolor="bg-primary"
clcolor="text-white"
- myclass="myshad" canopen="true" :visible="true">
+ myclass="myshad" :canopen="true" :visible="true">
diff --git a/src/css/app.scss b/src/css/app.scss
index 1bc81b40..155b7ead 100755
--- a/src/css/app.scss
+++ b/src/css/app.scss
@@ -528,6 +528,11 @@ $heightBtn: 100%;
display: block;
}
+.centermydiv2 {
+ margin-left: auto;
+ margin-right: auto;
+}
+
.text-verified {
font-size: 1.25rem;
text-shadow: .05rem .05rem .15rem #fff;
@@ -638,6 +643,12 @@ $heightBtn: 100%;
padding: 8px;
}
+.clBorderSperator {
+ background-color: blue;
+ font-size: 1rem;
+ padding: 4px;
+}
+
.clBorderZoom {
border: #666cf6 solid 5px;
}
diff --git a/src/layouts/toolbar/notifPopover/notifPopover.ts b/src/layouts/toolbar/notifPopover/notifPopover.ts
index 25a2ccdc..cac35649 100755
--- a/src/layouts/toolbar/notifPopover/notifPopover.ts
+++ b/src/layouts/toolbar/notifPopover/notifPopover.ts
@@ -1,4 +1,4 @@
-import { computed, defineComponent, ref } from 'vue'
+import { computed, defineComponent, onMounted, ref, watch } from 'vue'
import {
IChat,
@@ -13,19 +13,37 @@ import MixinUsers from '../../../mixins/mixin-users'
import { useNotifStore } from '@store/NotifStore'
import { useUserStore } from '@store/UserStore'
+import { CTitleBanner } from '@/components/CTitleBanner'
+import { CMyFieldRec } from '@/components/CMyFieldRec'
+import { CMyFieldDb } from '@/components/CMyFieldDb'
+import { shared_consts } from '@/common/shared_vuejs'
+import { useI18n } from '@/boot/i18n'
+import { useQuasar } from 'quasar'
+import { costanti } from '@costanti'
+
const namespace = 'notifModule'
export default defineComponent({
name: 'notifPopover',
+ components: { CTitleBanner, CMyFieldRec, CMyFieldDb },
setup(props) {
const $router = useRouter()
const userStore = useUserStore()
const notifStore = useNotifStore()
+ const { t } = useI18n()
+ const $q = useQuasar()
+
const loading = ref(false)
+ const myuser = ref({})
+
const lasts_notifs = computed(() => notifStore.getlasts_notifs)
+ const usernotifs = computed(() => userStore.my.profile.notifs)
+
+ const userId = ref('')
+ const open = ref(false)
const notifsel = ref(
{
dest: '',
@@ -39,6 +57,19 @@ export default defineComponent({
// }
+ watch(() => usernotifs.value, async (to: any, from: any) => {
+
+ if (usernotifs.value) {
+ console.log('usernotifs.value', usernotifs.value, to)
+ const ret = await userStore.setUserNotifs(usernotifs.value)
+ if (ret) {
+ tools.showPositiveNotif($q, t('db.recupdated'))
+ } else {
+ tools.showNegativeNotif($q, t('db.recfailed'))
+ }
+ }
+ })
+
function clickChat(msg: IMessage) {
// $router.replace(`/notifs/${ msg.dest.username}`)
}
@@ -69,6 +100,7 @@ export default defineComponent({
function refreshdata(username: string) {
loading.value = true
+ userId.value = userStore.my._id
notifsel.value.dest = ''
@@ -90,9 +122,12 @@ export default defineComponent({
}
function mounted() {
+ myuser.value = userStore.my
refreshdata(userStore.my.username)
}
+ onMounted(mounted)
+
return {
lasts_notifs,
clickChat,
@@ -102,6 +137,12 @@ export default defineComponent({
getImgByNotif,
getNotifText,
tools,
+ usernotifs,
+ shared_consts,
+ userId,
+ myuser,
+ costanti,
+ open,
}
},
})
diff --git a/src/layouts/toolbar/notifPopover/notifPopover.vue b/src/layouts/toolbar/notifPopover/notifPopover.vue
index c5da21a4..8fa0e16c 100755
--- a/src/layouts/toolbar/notifPopover/notifPopover.vue
+++ b/src/layouts/toolbar/notifPopover/notifPopover.vue
@@ -1,32 +1,57 @@
-
+
{{ getNumNotifUnread() }}
+
+
+ {{ getNumNotifUnread() }}
+
-
-
- {{ $t('notifs.notifs') }}
-
-
-
-
- Imposta notifiche:
+
-
+
+ {{ $t('notifs.notifs') }}
+
+
+
+
+
-
-
+
+
Avvisami se nuovo annuncio:
-
+
+
+
+
+
+
+
+
+
+
+
- {{ $t('notifs.nonotif') }}
+ {{ $t('notifs.nonotif') }}
+
@@ -52,14 +77,10 @@
{{ tools.getstrDateTimeShort(notif.datenotif) }}
-
-
-
-
- {{ getNumNotifUnread() }}
-
+
+
diff --git a/src/model/UserStore.ts b/src/model/UserStore.ts
index 6a87c069..41da6124 100755
--- a/src/model/UserStore.ts
+++ b/src/model/UserStore.ts
@@ -78,6 +78,7 @@ export interface IUserProfile {
req_friends: IFriends[]
mygroups: IMyGroup[]
manage_mygroups: IMyGroup[]
+ notifs: number
// in memory
asked_friends: any[]
diff --git a/src/rootgen/admin/userPanel/userPanel.vue b/src/rootgen/admin/userPanel/userPanel.vue
index fb80f6f2..79e29d5d 100755
--- a/src/rootgen/admin/userPanel/userPanel.vue
+++ b/src/rootgen/admin/userPanel/userPanel.vue
@@ -2,6 +2,7 @@
+
diff --git a/src/statics/lang/it.js b/src/statics/lang/it.js
index 6942b44c..bd714e75 100755
--- a/src/statics/lang/it.js
+++ b/src/statics/lang/it.js
@@ -750,7 +750,10 @@ const msg_it = {
notif: 'Notifica',
notifs: 'Notifiche',
nonotif: 'Nessuna Notifica',
- warn_province: 'Avvisami se nuovo annuncio in provincia',
+ warn_province: 'in Provincia',
+ warn_city: 'in Città ',
+ warn_my_groups: 'miei Gruppi',
+ warn_my_ris_circuit: 'miei Circuiti',
},
event: {
_id: 'id',
diff --git a/src/store/Modules/fieldsTable.ts b/src/store/Modules/fieldsTable.ts
index c5afed6e..36cf9ab9 100755
--- a/src/store/Modules/fieldsTable.ts
+++ b/src/store/Modules/fieldsTable.ts
@@ -2303,6 +2303,13 @@ export const colTableUsersISP = [
jointable: 'permissions',
titlepopupedit: 'Permessi'
}),
+ AddCol({
+ name: 'notifs',
+ label_trans: 'reg.notifs',
+ fieldtype: costanti.FieldType.binary,
+ jointable: 'usernotifs',
+ titlepopupedit: 'Notifiche'
+ }),
AddCol({ name: 'ipaddr', label_trans: 'reg.ipaddr' }),
AddCol({ name: 'deleted', label_trans: 'reg.deleted', fieldtype: costanti.FieldType.boolean }),
AddCol(DeleteRec),
@@ -2700,6 +2707,15 @@ export const fieldsTable = {
colicon: 'icon',
noshow: true,
},
+ {
+ value: 'usernotifs',
+ label: 'Notifiche',
+ columns: colTableGeneric,
+ colkey: 'value',
+ collabel: 'label',
+ colicon: 'icon',
+ noshow: true,
+ },
{
value: 'sites',
label: 'Siti',
diff --git a/src/store/UserStore.ts b/src/store/UserStore.ts
index 6e090bde..c879b1ab 100755
--- a/src/store/UserStore.ts
+++ b/src/store/UserStore.ts
@@ -54,6 +54,7 @@ export const DefaultUser: IUserFields = {
manage_mygroups: [],
asked_friends: [],
asked_groups: [],
+ notifs: 15,
},
cart: {
userId: '',
@@ -99,6 +100,7 @@ export const DefaultProfile: IUserProfile = {
manage_mygroups: [],
asked_friends: [],
asked_groups: [],
+ notifs: 15,
}
export const useUserStore = defineStore('UserStore', {
@@ -991,6 +993,21 @@ export const useUserStore = defineStore('UserStore', {
},
+ async setUserNotifs(notifs: number) {
+ const data = {
+ notifs
+ }
+
+ return Api.SendReq('/users/notifs', 'POST', data)
+ .then((ris) => {
+ return ris.data
+ }).catch((error) => {
+ return {}
+ })
+
+
+ },
+
async loadUserPanel(username: string) {
const data = {
username
diff --git a/src/store/globalStore.ts b/src/store/globalStore.ts
index 1410abe9..89982833 100644
--- a/src/store/globalStore.ts
+++ b/src/store/globalStore.ts
@@ -1591,6 +1591,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
else if (table === toolsext.TABTYPEACCOM) myarr = shared_consts.TypeAccom
else if (table === toolsext.TABLOCACCOM) myarr = shared_consts.LocationAccom
else if (table === toolsext.TABPREF) myarr = shared_consts.Preferences
+ else if (table === 'usernotifs') myarr = shared_consts.UsersNotif_Adv_List
else myarr = this.getListByTable(table)
if (costanti.TABLES_ARRAY.includes(table)) {
diff --git a/src/views/user/editprofile/editprofile.vue b/src/views/user/editprofile/editprofile.vue
index 8f167c09..b9efa1c2 100755
--- a/src/views/user/editprofile/editprofile.vue
+++ b/src/views/user/editprofile/editprofile.vue
@@ -106,7 +106,7 @@
table="users"
mykey="profile"
mysubkey="qualifica"
- maxlength="40"
+ maxlength="100"
:showall="true"
:type="costanti.FieldType.string">
@@ -116,7 +116,7 @@
table="users"
mykey="profile"
mysubkey="biografia"
- maxlength="300"
+ maxlength="1000"
hint="Scrivi chi sei e quale percorso formativo hai fatto"
:showall="true"
:type="costanti.FieldType.string">