- Create Newsletter Page: MailingList (without the class style, using Gulp tasks)#94
- Add test Email button
This commit is contained in:
@@ -1 +1 @@
|
||||
../../../freeplanet_serverside/server/tools/shared_nodejs.js
|
||||
/home/paolo/myproject/freeplanet_serverside/src/server/tools/shared_nodejs.js
|
||||
@@ -27,7 +27,7 @@ export const shared_consts = {
|
||||
},
|
||||
|
||||
fieldsUserToChange() {
|
||||
return ['_id', 'username', 'email', 'cell', 'name', 'surname', 'perm', 'date_reg', 'verified_email', 'img', 'ipaddr', 'lasttimeonline', 'profile']
|
||||
return ['_id', 'username', 'email', 'cell', 'name', 'surname', 'perm', 'date_reg', 'verified_email', 'img', 'ipaddr', 'lasttimeonline', 'profile', 'news_on']
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -40,6 +40,10 @@ export default class CDateTime extends Vue {
|
||||
// console.log('Opening', 'myvalue', this.myvalue, 'value', this.value)
|
||||
this.saveit = false
|
||||
this.valueprec = this.myvalue
|
||||
if (this.myvalue === undefined) {
|
||||
this.valueDate = new Date()
|
||||
this.myvalue = tools.getstrYYMMDDDateTime(this.valueDate)
|
||||
}
|
||||
this.$emit('show')
|
||||
}
|
||||
|
||||
@@ -55,8 +59,9 @@ export default class CDateTime extends Vue {
|
||||
|
||||
@Watch('valueDate')
|
||||
public changevalueDate() {
|
||||
if (this.valueDate)
|
||||
this.myvalue = tools.getstrYYMMDDDateTime(this.valueDate)
|
||||
// console.log('changevalueDate myvalue', this.myvalue)
|
||||
console.log('changevalueDate myvalue', this.myvalue)
|
||||
}
|
||||
@Watch('value')
|
||||
public changevalue() {
|
||||
@@ -95,7 +100,7 @@ export default class CDateTime extends Vue {
|
||||
else
|
||||
this.myvalue = tools.getstrYYMMDDDateTime(this.valueDate)
|
||||
|
||||
// console.log('myvalue', this.myvalue)
|
||||
console.log('created myvalue', this.myvalue)
|
||||
}
|
||||
|
||||
public changeval(newval) {
|
||||
|
||||
@@ -11,4 +11,12 @@ export default class MixinMetaTags extends Vue {
|
||||
public setmeta(mymeta: IMetaTags) {
|
||||
this.mymeta = mymeta
|
||||
}
|
||||
|
||||
public getsrcbyimg(myimg) {
|
||||
// return this.src
|
||||
const filefull = tools.getimgFullpathbysize(myimg)
|
||||
|
||||
return tools.getimgbysize(filefull.path, filefull.file)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -38,6 +38,28 @@ export interface ITeachUname {
|
||||
username?: string
|
||||
}
|
||||
|
||||
export interface INewsToSent {
|
||||
_id: string
|
||||
idapp?: string
|
||||
label?: string
|
||||
numemail_tot?: number
|
||||
numemail_sent?: number
|
||||
datetoSent?: Date
|
||||
datestartJob?: Date
|
||||
datefinishJob?: Date
|
||||
lastemailsent_Job?: Date
|
||||
starting_job?: boolean
|
||||
finish_job?: boolean
|
||||
error_job?: string
|
||||
}
|
||||
|
||||
export interface IMailinglist {
|
||||
name?: string
|
||||
surname?: string
|
||||
email: string
|
||||
lastid_newstosent?: string
|
||||
}
|
||||
|
||||
export interface IDiscipline {
|
||||
typol_code?: string
|
||||
order?: number
|
||||
@@ -96,6 +118,8 @@ export interface IGlobalState {
|
||||
lastaction: IAction
|
||||
settings: ISettings[],
|
||||
disciplines: IDiscipline[],
|
||||
newstosent: INewsToSent[],
|
||||
mailinglist: IMailinglist[],
|
||||
autoplaydisc: number
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@ const msgglobal = {
|
||||
tableslist: 'Tabelle',
|
||||
},
|
||||
otherpages: {
|
||||
error404: 'error404',
|
||||
error404def: 'error404def',
|
||||
admin : {
|
||||
menu: 'Amministrazione',
|
||||
eventlist: 'Le tue Prenotazioni',
|
||||
@@ -217,7 +219,13 @@ const msgglobal = {
|
||||
code: 'Id',
|
||||
whereicon: 'Icona',
|
||||
},
|
||||
col: {
|
||||
label: 'Etichetta',
|
||||
value: 'Valore',
|
||||
type: 'Tipo'
|
||||
},
|
||||
cal: {
|
||||
num: 'Numero',
|
||||
booked: 'Prenotato',
|
||||
booked_error: 'Prenotazione non avvenuta. Riprovare più tardi',
|
||||
sendmsg_error: 'Messaggio non inviato. Riprovare più tardi',
|
||||
@@ -525,7 +533,13 @@ const msgglobal = {
|
||||
code: 'Id',
|
||||
whereicon: 'Icono',
|
||||
},
|
||||
col: {
|
||||
label: 'Etichetta',
|
||||
value: 'Valore',
|
||||
type: 'Tipo'
|
||||
},
|
||||
cal: {
|
||||
num: 'Número',
|
||||
booked: 'Reservado',
|
||||
booked_error: 'Reserva fallida. Intenta nuevamente más tarde',
|
||||
sendmsg_error: 'Mensaje no enviado Intenta nuevamente más tarde',
|
||||
@@ -829,7 +843,13 @@ const msgglobal = {
|
||||
code: 'Id',
|
||||
whereicon: 'icône',
|
||||
},
|
||||
col: {
|
||||
label: 'Etichetta',
|
||||
value: 'Valore',
|
||||
type: 'Tipo'
|
||||
},
|
||||
cal: {
|
||||
num: 'Nombre',
|
||||
booked: 'Réservé',
|
||||
booked_error: 'La réservation a échoué. Réessayez plus tard',
|
||||
sendmsg_error: 'Message non envoyé. Réessayez plus tard',
|
||||
@@ -1132,7 +1152,13 @@ const msgglobal = {
|
||||
code: 'Id',
|
||||
whereicon: 'Icon',
|
||||
},
|
||||
col: {
|
||||
label: 'Etichetta',
|
||||
value: 'Valore',
|
||||
type: 'Tipo'
|
||||
},
|
||||
cal: {
|
||||
num: 'Number',
|
||||
booked: 'Booked',
|
||||
booked_error: 'Reservation failed. Try again later',
|
||||
sendmsg_error: 'Message not sent. Try again later',
|
||||
@@ -1437,7 +1463,13 @@ const msgglobal = {
|
||||
code: 'Id',
|
||||
whereicon: 'Icon',
|
||||
},
|
||||
col: {
|
||||
label: 'Etichetta',
|
||||
value: 'Valore',
|
||||
type: 'Tipo'
|
||||
},
|
||||
cal: {
|
||||
num: 'Number',
|
||||
booked: 'Booked',
|
||||
booked_error: 'Reservation failed. Try again later',
|
||||
sendmsg_error: 'Message not sent. Try again later',
|
||||
|
||||
@@ -70,7 +70,9 @@ const state: IGlobalState = {
|
||||
},
|
||||
settings: [],
|
||||
disciplines: [],
|
||||
autoplaydisc: 8000
|
||||
autoplaydisc: 8000,
|
||||
newstosent: [],
|
||||
mailinglist: []
|
||||
}
|
||||
|
||||
async function getConfig(id) {
|
||||
@@ -167,6 +169,10 @@ namespace Getters {
|
||||
return CalendarStore.state.contribtype
|
||||
else if (table === 'disciplines')
|
||||
return GlobalStore.state.disciplines
|
||||
else if (table === tools.TABNEWSLETTER)
|
||||
return GlobalStore.state.newstosent
|
||||
else if (table === tools.TABMAILINGLIST)
|
||||
return GlobalStore.state.mailinglist
|
||||
else if (table === 'bookings')
|
||||
return CalendarStore.state.bookedevent
|
||||
else if (table === 'users')
|
||||
@@ -369,7 +375,6 @@ namespace Actions {
|
||||
}
|
||||
|
||||
function createPushSubscription(context) {
|
||||
console.log('createPushSubscription')
|
||||
|
||||
// If Already subscribed, don't send to the Server DB
|
||||
// if (state.wasAlreadySubOnDb) {
|
||||
@@ -388,7 +393,7 @@ namespace Actions {
|
||||
return
|
||||
}
|
||||
|
||||
// console.log('createPushSubscription')
|
||||
console.log('createPushSubscription')
|
||||
|
||||
let reg
|
||||
const mykey = process.env.PUBLICKEY_PUSH
|
||||
@@ -696,6 +701,11 @@ namespace Actions {
|
||||
GlobalStore.state.settings = (res.data.settings) ? [...res.data.settings] : []
|
||||
GlobalStore.state.disciplines = (res.data.disciplines) ? [...res.data.disciplines] : []
|
||||
|
||||
if (showall) {
|
||||
GlobalStore.state.newstosent = (res.data.newstosent) ? [...res.data.newstosent] : []
|
||||
GlobalStore.state.mailinglist = (res.data.mailinglist) ? [...res.data.mailinglist] : []
|
||||
}
|
||||
|
||||
CalendarStore.state.editable = UserStore.state.isAdmin || UserStore.state.isManager
|
||||
|
||||
})
|
||||
@@ -707,6 +717,18 @@ namespace Actions {
|
||||
|
||||
}
|
||||
|
||||
async function sendEmailTest(context) {
|
||||
const usertosend = {
|
||||
locale: tools.getLocale()
|
||||
}
|
||||
console.log(usertosend)
|
||||
|
||||
return await Api.SendReq('/signup_news/testemail', 'POST', usertosend)
|
||||
.then((res) => {
|
||||
return res
|
||||
})
|
||||
}
|
||||
|
||||
export const actions = {
|
||||
setConta: b.dispatch(setConta),
|
||||
createPushSubscription: b.dispatch(createPushSubscription),
|
||||
@@ -721,6 +743,7 @@ namespace Actions {
|
||||
loadTable: b.dispatch(loadTable),
|
||||
saveTable: b.dispatch(saveTable),
|
||||
DeleteRec: b.dispatch(DeleteRec),
|
||||
sendEmailTest: b.dispatch(sendEmailTest),
|
||||
DuplicateRec: b.dispatch(DuplicateRec)
|
||||
}
|
||||
|
||||
|
||||
@@ -53,6 +53,21 @@ const colcontribtype = [
|
||||
AddCol(DeleteRec)
|
||||
]
|
||||
|
||||
const colnewstosent = [
|
||||
AddCol({ name: 'label', label_trans: 'event.title' }),
|
||||
AddCol({ name: 'datetoSent', label_trans: 'news.datetoSent', fieldtype: tools.FieldType.date }),
|
||||
AddCol({ name: 'activate', label_trans: 'news.activate', fieldtype: tools.FieldType.boolean }),
|
||||
AddCol({ name: 'numemail_tot', label_trans: 'news.numemail_tot', fieldtype: tools.FieldType.number }),
|
||||
AddCol({ name: 'numemail_sent', label_trans: 'news.numemail_sent', fieldtype: tools.FieldType.number }),
|
||||
AddCol({ name: 'datestartJob', label_trans: 'news.datestartJob', fieldtype: tools.FieldType.date }),
|
||||
AddCol({ name: 'datefinishJob', label_trans: 'news.datefinishJob', fieldtype: tools.FieldType.date }),
|
||||
AddCol({ name: 'lastemailsent_Job', label_trans: 'news.lastemailsent_Job', fieldtype: tools.FieldType.date }),
|
||||
AddCol({ name: 'starting_job', label_trans: 'news.starting_job', fieldtype: tools.FieldType.boolean }),
|
||||
AddCol({ name: 'finish_job', label_trans: 'news.finish_job', fieldtype: tools.FieldType.boolean }),
|
||||
AddCol({ name: 'error_job', label_trans: 'news.error_job', fieldtype: tools.FieldType.string }),
|
||||
AddCol(DeleteRec)
|
||||
]
|
||||
|
||||
const coldisciplines = [
|
||||
AddCol({ name: 'typol_code', label_trans: 'disc.typol_code' }),
|
||||
AddCol({ name: 'order', label_trans: 'disc.order', fieldtype: tools.FieldType.number }),
|
||||
@@ -65,7 +80,12 @@ const coldisciplines = [
|
||||
AddCol({ name: 'img_small', label_trans: 'event.img_small' }),
|
||||
AddCol({ name: 'showinhome', label_trans: 'event.showinhome', fieldtype: tools.FieldType.boolean }),
|
||||
AddCol({ name: 'showinnewsletter', label_trans: 'event.showinnewsletter', fieldtype: tools.FieldType.boolean }),
|
||||
AddCol({ name: 'teachers', label_trans: 'event.teacher', fieldtype: tools.FieldType.multiselect, jointable: 'operators' }),
|
||||
AddCol({
|
||||
name: 'teachers',
|
||||
label_trans: 'event.teacher',
|
||||
fieldtype: tools.FieldType.multiselect,
|
||||
jointable: 'operators'
|
||||
}),
|
||||
AddCol(DeleteRec)
|
||||
]
|
||||
|
||||
@@ -84,6 +104,14 @@ const colTablePermission = [
|
||||
AddCol(DeleteRec)
|
||||
]
|
||||
|
||||
const colmailinglist = [
|
||||
AddCol({ name: 'name', label_trans: 'reg.name' }),
|
||||
AddCol({ name: 'surname', label_trans: 'reg.surname' }),
|
||||
AddCol({ name: 'email', label_trans: 'reg.email' }),
|
||||
AddCol({ name: 'lastid_newstosent', label_trans: 'reg.lastid_newstosent', fieldtype: tools.FieldType.string } ),
|
||||
AddCol(DeleteRec)
|
||||
]
|
||||
|
||||
const colTableOperator = [
|
||||
AddCol({ name: 'username', label_trans: 'reg.username' }),
|
||||
AddCol({ name: 'name', label_trans: 'reg.name' }),
|
||||
@@ -116,11 +144,21 @@ const colTableEvents = [
|
||||
AddCol({ name: 'img_small', label_trans: 'event.img_small' }),
|
||||
AddCol({ name: 'img', label_trans: 'event.img' }),
|
||||
AddCol({ name: 'wherecode', label_trans: 'event.where', fieldtype: tools.FieldType.select, jointable: 'wheres' }),
|
||||
AddCol({ name: 'contribtype', label_trans: 'event.contribtype', fieldtype: tools.FieldType.select, jointable: 'contribtype' }),
|
||||
AddCol({
|
||||
name: 'contribtype',
|
||||
label_trans: 'event.contribtype',
|
||||
fieldtype: tools.FieldType.select,
|
||||
jointable: 'contribtype'
|
||||
}),
|
||||
AddCol({ name: 'price', label_trans: 'event.price' }),
|
||||
AddCol({ name: 'infoafterprice', label_trans: 'event.infoafterprice' }),
|
||||
AddCol({ name: 'teacher', label_trans: 'event.teacher', fieldtype: tools.FieldType.select, jointable: 'operators' }),
|
||||
AddCol({ name: 'teacher2', label_trans: 'event.teacher2', fieldtype: tools.FieldType.select, jointable: 'operators' }),
|
||||
AddCol({
|
||||
name: 'teacher2',
|
||||
label_trans: 'event.teacher2',
|
||||
fieldtype: tools.FieldType.select,
|
||||
jointable: 'operators'
|
||||
}),
|
||||
AddCol({ name: 'infoextra', label_trans: 'event.infoextra' }),
|
||||
AddCol({ name: 'linkpage', label_trans: 'event.linkpage' }),
|
||||
AddCol({ name: 'linkpdf', label_trans: 'event.linkpdf' }),
|
||||
@@ -297,6 +335,20 @@ export const fieldsTable = {
|
||||
colkey: 'typol_code',
|
||||
collabel: 'label'
|
||||
},
|
||||
{
|
||||
value: 'newstosent',
|
||||
label: 'Newsletter da Inviare',
|
||||
columns: colnewstosent,
|
||||
colkey: '_id',
|
||||
collabel: 'label'
|
||||
},
|
||||
{
|
||||
value: 'mailinglist',
|
||||
label: 'MailingList',
|
||||
columns: colmailinglist,
|
||||
colkey: '_id',
|
||||
collabel: (rec) => rec.name + ' ' + rec.surname
|
||||
},
|
||||
{
|
||||
value: 'permissions',
|
||||
label: 'Permessi',
|
||||
|
||||
@@ -65,6 +65,8 @@ export const tools = {
|
||||
],
|
||||
|
||||
TABEVENTS: 'myevents',
|
||||
TABNEWSLETTER: 'newstosent',
|
||||
TABMAILINGLIST: 'mailinglist',
|
||||
|
||||
MAX_CHARACTERS: 60,
|
||||
projects: 'projects',
|
||||
@@ -2644,11 +2646,16 @@ export const tools = {
|
||||
|
||||
getwidthscale(mythis, mywidth, maxwidth) {
|
||||
if (this.isMobile()) {
|
||||
if (mywidth > this.getwidth(mythis) - 20)
|
||||
mywidth = this.getwidth(mythis) - 20
|
||||
|
||||
return mywidth
|
||||
} else {
|
||||
let myw = mywidth + ((this.getwidth(mythis) - mywidth) * 0.4)
|
||||
if (myw > maxwidth)
|
||||
myw = maxwidth
|
||||
if (myw > this.getwidth(mythis) - 20)
|
||||
myw = this.getwidth(mythis) - 20
|
||||
|
||||
return myw
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user