+
diff --git a/src/model/GlobalStore.ts b/src/model/GlobalStore.ts
index 1a32a6d..8c53ccd 100644
--- a/src/model/GlobalStore.ts
+++ b/src/model/GlobalStore.ts
@@ -49,6 +49,23 @@ export interface ITeachUname {
username?: string
}
+export interface IMyPage {
+ _id?: string
+ author_username?: string
+ title?: string
+ icon?: string
+ path?: string
+ keywords?: string
+ description?: string
+ content?: string
+ active?: boolean
+ inmenu?: boolean
+ submenu?: boolean
+ l_par?: number,
+ l_child?: number,
+ infooter?: boolean
+}
+
export interface INewsToSent {
_id: string
idapp?: string
@@ -132,6 +149,7 @@ export interface IGlobalState {
settings: ISettings[],
disciplines: IDiscipline[],
newstosent: INewsToSent[],
+ mypage: IMyPage[],
templemail: ITemplEmail[],
opzemail: ISettings[],
mailinglist: IMailinglist[],
@@ -324,6 +342,7 @@ export interface ITableRec {
collabel: string
colicon?: string
onlyAdmin?: boolean
+ noshow: boolean
}
export interface IDataPass {
diff --git a/src/statics/i18n.js b/src/statics/i18n.js
index 1a695e3..2b949aa 100644
--- a/src/statics/i18n.js
+++ b/src/statics/i18n.js
@@ -19,6 +19,8 @@ const msgglobal = {
userlist: 'Lista Utenti',
tableslist: 'Lista Tabelle',
newsletter: 'Newsletter',
+ pages: 'Pagine',
+ media: 'Media',
},
manage: {
menu: 'Gestione',
@@ -379,6 +381,8 @@ const msgglobal = {
userlist: 'Lista de usuarios',
tableslist: 'Listado de tablas',
newsletter: 'Newsletter',
+ pages: 'Páginas',
+ media: 'Medios',
},
manage: {
menu: 'Gestionar',
@@ -730,6 +734,8 @@ const msgglobal = {
userlist: 'Liste d\'utilisateurs',
tableslist: 'Liste des tables',
newsletter: 'Newsletter',
+ pages: 'Pages',
+ media: 'Médias',
},
manage: {
menu: 'Gérer',
@@ -1080,6 +1086,8 @@ const msgglobal = {
userlist: 'Users List',
tableslist: 'List of tables',
newsletter: 'Newsletter',
+ pages: 'Pages',
+ media: 'Medias',
},
manage: {
menu: 'Manage',
@@ -1429,6 +1437,8 @@ const msgglobal = {
userlist: 'Users List',
tableslist: 'List of tables',
newsletter: 'Newsletter',
+ pages: 'Pages',
+ media: 'Medias',
},
manage: {
menu: 'Manage',
diff --git a/src/statics/js/track.js b/src/statics/js/track.js
index 7f5bd2c..f2ebec2 100644
--- a/src/statics/js/track.js
+++ b/src/statics/js/track.js
@@ -2,12 +2,12 @@ function geturl() {
const miaurl = document.location.href
if (miaurl.includes('test.')) {
- return 'https://test.freeplanet.app/'
+ return 'https://test.associazioneshen.it/'
} else {
if (miaurl.includes('localhost')) {
return 'http://localhost:8080/'
} else {
- return 'https://freeplanet.app/'
+ return 'https://associazioneshen.it/'
}
}
}
@@ -18,12 +18,12 @@ function getidtrack() {
if (miaurl.includes('test.') || miaurl.includes('localhost')) {
return '4c40a07bc88a9c50c9b70dc9c5cd8e2e'
} else {
- return '9853abef079fc8330ab188a9cbf07a0c'
+ return 'ccfd6c90e17b6809f9717675764c3f5d' // Associazione Shen
}
}
-var owa_baseUrl = geturl() + 'owa/';
+let owa_baseUrl = geturl() + 'owa/';
if (owa_cmds)
var owa_cmds = [];
else
@@ -33,11 +33,11 @@ owa_cmds.push(['trackPageView']);
// owa_cmds.push(['trackClicks']);
(function () {
- var _owa = document.createElement('script');
+ const _owa = document.createElement('script');
_owa.type = 'text/javascript';
_owa.async = true;
owa_baseUrl = ('https:' == document.location.protocol ? window.owa_baseSecUrl || owa_baseUrl.replace(/http:/, 'https:') : owa_baseUrl);
_owa.src = owa_baseUrl + 'modules/base/js/owa.tracker-combined-min.js';
- var _owa_s = document.getElementsByTagName('script')[0];
+ const _owa_s = document.getElementsByTagName('script')[0];
_owa_s.parentNode.insertBefore(_owa, _owa_s);
}());
diff --git a/src/store/Modules/GlobalStore.ts b/src/store/Modules/GlobalStore.ts
index e84ccfb..761782b 100644
--- a/src/store/Modules/GlobalStore.ts
+++ b/src/store/Modules/GlobalStore.ts
@@ -24,6 +24,7 @@ import { serv_constants } from '@src/store/Modules/serv_constants'
import { IUserState } from '@src/model'
import { Calendar } from 'element-ui'
import { fieldsTable } from '@src/store/Modules/fieldsTable'
+import router from '@router'
// import { static_data } from '@src/db/static_data'
let stateConnDefault = 'online'
@@ -75,7 +76,8 @@ const state: IGlobalState = {
disciplines: [],
autoplaydisc: 8000,
newstosent: [],
- mailinglist: []
+ mailinglist: [],
+ mypage: []
}
async function getConfig(id) {
@@ -131,6 +133,12 @@ namespace Getters {
}, 'showtype')
+ const getPage = b.read((mystate: IGlobalState) => (path) => {
+ // const config = state.arrConfig.find(item => item._id === cat + costanti.CONFIG_ID_SHOW_TYPE_TODOS)
+ return mystate.mypage.find((page) => (`/` + page.path) === path)
+
+ }, 'getPage')
+
const getmenu = b.read((state) => {
// console.log('getmenu', cfgrouter.getmenu())
@@ -180,6 +188,8 @@ namespace Getters {
return GlobalStore.state.opzemail
else if (table === tools.TABMAILINGLIST)
return GlobalStore.state.mailinglist
+ else if (table === tools.TABMYPAGE)
+ return GlobalStore.state.mypage
else if (table === 'bookings')
return CalendarStore.state.bookedevent
else if (table === 'users')
@@ -277,6 +287,10 @@ namespace Getters {
return gettemplemailbyId()
},
+ get getPage() {
+ return getPage()
+ },
+
get t() {
return t()
},
@@ -761,6 +775,7 @@ namespace Actions {
if (showall) {
GlobalStore.state.newstosent = (res.data.newstosent) ? [...res.data.newstosent] : []
GlobalStore.state.mailinglist = (res.data.mailinglist) ? [...res.data.mailinglist] : []
+ GlobalStore.state.mypage = (res.data.mypage) ? [...res.data.mypage] : []
}
CalendarStore.state.editable = UserStore.state.isAdmin || UserStore.state.isManager
@@ -787,6 +802,47 @@ namespace Actions {
})
}
+ async function addDynamicPages(context) {
+
+ const arrpagesroute: IListRoutes[] = []
+ for (const page of state.mypage) {
+ arrpagesroute.push({
+ path: '/' + page.path,
+ name: undefined,
+ text: page.title,
+ materialIcon: page.icon,
+ component: () => import('@/root/mypage/mypage.vue'),
+ inmenu: page.inmenu,
+ infooter: page.infooter,
+ level_child: page.l_child,
+ level_parent: page.l_par,
+ })
+ }
+
+ const last = {
+ path: '*',
+ materialIcon: 'fas fa-calendar-plus',
+ name: 'otherpages.error404def',
+ component: () => import('@/root/My404page/My404page.vue'),
+ inmenu: false,
+ infooter: false
+ }
+
+ static_data.routes = [...static_data.routes, ...arrpagesroute, last]
+
+ router.addRoutes([...arrpagesroute, last])
+ }
+
+ async function sendFile(context, formdata) {
+ try {
+ const { data } = await Api.postFormData('/upload', formdata)
+ console.log(data)
+
+ } catch (e) {
+ console.log('Error sendFile: ', e)
+ }
+ }
+
export const actions = {
setConta: b.dispatch(setConta),
createPushSubscription: b.dispatch(createPushSubscription),
@@ -802,7 +858,8 @@ namespace Actions {
saveTable: b.dispatch(saveTable),
DeleteRec: b.dispatch(DeleteRec),
sendEmailTest: b.dispatch(sendEmailTest),
- DuplicateRec: b.dispatch(DuplicateRec)
+ DuplicateRec: b.dispatch(DuplicateRec),
+ addDynamicPages: b.dispatch(addDynamicPages)
}
}
diff --git a/src/store/Modules/UserStore.ts b/src/store/Modules/UserStore.ts
index 20514db..526b8b1 100644
--- a/src/store/Modules/UserStore.ts
+++ b/src/store/Modules/UserStore.ts
@@ -688,32 +688,42 @@ namespace Actions {
async function setGlobal(isLogged: boolean) {
console.log('setGlobal')
- // state.isLogged = true
- if (isLogged) {
- // console.log('state.isLogged', state.isLogged)
+ try {
+ // state.isLogged = true
+ if (isLogged) {
+ // console.log('state.isLogged', state.isLogged)
- GlobalStore.mutations.setleftDrawerOpen(localStorage.getItem(tools.localStorage.leftDrawerOpen) === 'true')
- GlobalStore.mutations.setCategorySel(localStorage.getItem(tools.localStorage.categorySel))
+ GlobalStore.mutations.setleftDrawerOpen(localStorage.getItem(tools.localStorage.leftDrawerOpen) === 'true')
+ GlobalStore.mutations.setCategorySel(localStorage.getItem(tools.localStorage.categorySel))
- GlobalStore.actions.checkUpdates()
+ GlobalStore.actions.checkUpdates()
+ }
+
+ const p3 = await GlobalStore.actions.loadAfterLogin()
+
+ state.isLogged = isLogged
+
+ if (static_data.functionality.ENABLE_TODOS_LOADING)
+ await Todos.actions.dbLoad({ checkPending: true })
+
+ if (static_data.functionality.ENABLE_PROJECTS_LOADING)
+ await Projects.actions.dbLoad({ checkPending: true, onlyiffirsttime: true })
+
+ console.log('add routes')
+
+ GlobalStore.actions.addDynamicPages()
+
+ GlobalStore.state.finishLoading = true
+ if (tools.isDebug())
+ console.log('finishLoading', GlobalStore.state.finishLoading)
+
+ // document.dispatchEvent(new Event('custom-post-render-event'))
+
+ } catch (e) {
+ console.error('Error', e)
+ GlobalStore.state.finishLoading = true
}
- const p3 = await GlobalStore.actions.loadAfterLogin()
-
- state.isLogged = isLogged
-
- if (static_data.functionality.ENABLE_TODOS_LOADING)
- await Todos.actions.dbLoad({ checkPending: true })
-
- if (static_data.functionality.ENABLE_PROJECTS_LOADING)
- await Projects.actions.dbLoad({ checkPending: true, onlyiffirsttime: true })
-
- GlobalStore.state.finishLoading = true
- if (tools.isDebug())
- console.log('finishLoading', GlobalStore.state.finishLoading)
-
- // document.dispatchEvent(new Event('custom-post-render-event'))
-
return true
// console.log('setGlobal: END')
}
diff --git a/src/store/Modules/fieldsTable.ts b/src/store/Modules/fieldsTable.ts
index 1bb139e..6c4fc45 100644
--- a/src/store/Modules/fieldsTable.ts
+++ b/src/store/Modules/fieldsTable.ts
@@ -62,6 +62,25 @@ export const colmailinglist = [
AddCol(DeleteRec)
]
+export const colmypage = [
+ AddCol({ name: 'title', label_trans: 'pages.title' }),
+ AddCol({ name: 'path', label_trans: 'pages.path' }),
+ AddCol({ name: 'icon', label_trans: 'pages.icon' }),
+ AddCol({ name: 'keywords', label_trans: 'pages.keywords' }),
+ AddCol({ name: 'description', label_trans: 'pages.description' }),
+ AddCol({ name: 'heightimg', label_trans: 'pages.heightimg', fieldtype: tools.FieldType.number }),
+ AddCol({ name: 'imgback', label_trans: 'pages.imgback', fieldtype: tools.FieldType.string }),
+ AddCol({ name: 'content', label_trans: 'pages.content', fieldtype: tools.FieldType.html }),
+ AddCol({ name: 'active', label_trans: 'pages.active', fieldtype: tools.FieldType.boolean }),
+ AddCol({ name: 'inmenu', label_trans: 'pages.inmenu', fieldtype: tools.FieldType.boolean }),
+ AddCol({ name: 'submenu', label_trans: 'pages.submenu', fieldtype: tools.FieldType.boolean }),
+ AddCol({ name: 'l_par', label_trans: 'pages.l_par', fieldtype: tools.FieldType.number }),
+ AddCol({ name: 'l_child', label_trans: 'pages.l_child', fieldtype: tools.FieldType.number }),
+ AddCol({ name: 'infooter', label_trans: 'pages.infooter', fieldtype: tools.FieldType.boolean }),
+ AddCol(DeleteRec),
+ AddCol(DuplicateRec)
+]
+
export const colopzemail = [
AddCol({ name: 'key', label_trans: 'col.key' }),
AddCol({ name: 'label_it', label_trans: 'col.label' }),
@@ -338,6 +357,9 @@ export const fieldsTable = {
return ''
},
+
+
+
// IColGridTable
colTableUsers: [
AddCol({ name: 'username', label_trans: 'reg.username' }),
@@ -393,14 +415,16 @@ export const fieldsTable = {
label: 'Newsletter da Inviare',
columns: colnewstosent,
colkey: '_id',
- collabel: 'label'
+ collabel: 'label',
+ onlyAdmin: true
},
{
value: 'templemail',
label: 'Template Email',
columns: coltemplemail,
colkey: '_id',
- collabel: 'subject'
+ collabel: 'subject',
+ onlyAdmin: true
},
{
value: 'opzemail',
@@ -423,13 +447,15 @@ export const fieldsTable = {
columns: colTablePermission,
colkey: 'value',
collabel: 'label',
- colicon: 'icon'
+ colicon: 'icon',
+ noshow: true,
},
{
value: 'fieldstype',
label: 'Tipi di Campi',
colkey: 'value',
- collabel: 'label'
+ collabel: 'label',
+ noshow: true,
},
{
value: 'settings',
@@ -443,6 +469,6 @@ export const fieldsTable = {
export const func = {
gettablesList() {
- return fieldsTable.tablesList.filter((rec) => (rec.onlyAdmin === UserStore.state.isAdmin) || (!rec.onlyAdmin))
+ return fieldsTable.tablesList.filter((rec) => (rec.onlyAdmin === UserStore.state.isAdmin) || (!rec.onlyAdmin) && (!rec.noshow))
}
}
diff --git a/src/store/Modules/tools.ts b/src/store/Modules/tools.ts
index a70e87c..165cdf6 100644
--- a/src/store/Modules/tools.ts
+++ b/src/store/Modules/tools.ts
@@ -67,6 +67,7 @@ export const tools = {
TABEVENTS: 'myevents',
TABNEWSLETTER: 'newstosent',
TABMAILINGLIST: 'mailinglist',
+ TABMYPAGE: 'mypage',
TABTEMPLEMAIL: 'templemail',
TABOPZEMAIL: 'opzemail',
@@ -2669,15 +2670,15 @@ export const tools = {
return mywidth
} else {
- console.log('this.getwidth(mythis) = ', this.getwidth(mythis))
+ // console.log('this.getwidth(mythis) = ', this.getwidth(mythis))
let myw = mywidth + ((this.getwidth(mythis) - mywidth) * 0.6)
- console.log('myw1 = ', myw)
+ // console.log('myw1 = ', myw)
if (myw > maxwidth)
myw = maxwidth
if (myw > this.getwidth(mythis) - 20)
myw = this.getwidth(mythis) - 20
- console.log('myw = ', myw)
+ // console.log('myw = ', myw)
return myw
}
},
@@ -2823,7 +2824,8 @@ export const tools = {
},
isDebug() {
return process.env.DEV
- }
+ },
+
// getLocale() {
// if (navigator.languages && navigator.languages.length > 0) {
diff --git a/src/views/admin/TableOnlyView/tableOnlyView.ts b/src/views/admin/TableOnlyView/tableOnlyView.ts
index 5fbc8a6..74e9c96 100644
--- a/src/views/admin/TableOnlyView/tableOnlyView.ts
+++ b/src/views/admin/TableOnlyView/tableOnlyView.ts
@@ -3,7 +3,6 @@ import { Component } from 'vue-property-decorator'
import { GlobalStore, UserStore } from '@store'
-
@Component({})
export default class TableOnlyView extends Vue {
public loading: boolean = false
@@ -28,8 +27,7 @@ export default class TableOnlyView extends Vue {
public filter: string = ''
public selected: any[] = []
-
- request(props) {
+ public request(props) {
this.loading = true
setTimeout(() => {
this.serverPagination = props.pagination
@@ -53,7 +51,7 @@ export default class TableOnlyView extends Vue {
}, 1500)
}
- mounted() {
+ public mounted() {
this.request({
pagination: this.serverPagination,
filter: this.filter