unclean SPARC
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
class TemplatesController extends EICController {
|
||||
constructor() {
|
||||
super()
|
||||
}
|
||||
|
||||
async search() {
|
||||
app.User.getBusinessPermissions(['/templates'])
|
||||
.then(async payload => {
|
||||
if(payload['/templates'].permissions.length > 0) {
|
||||
let models = {
|
||||
templates: new TemplatesModel(payload['/templates'].permissions)
|
||||
}
|
||||
this.loadWindow('comms/templates/manager/TemplatesManagerView', {
|
||||
title: 'Templates',
|
||||
static: true,
|
||||
expanded: true
|
||||
},
|
||||
{
|
||||
models: models
|
||||
}
|
||||
)
|
||||
} else {
|
||||
ui.growl.append('Sorry, you do not have access to this resource', 'danger')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
async tplAction(options) {
|
||||
app.User.getBusinessPermissions(['/templates'])
|
||||
.then(async payload => {
|
||||
if(payload['/templates'].permissions.length > 0) {
|
||||
const templateId = options.params.id;
|
||||
let models = {
|
||||
templates: new TemplatesModel(payload['/templates'].permissions)
|
||||
}
|
||||
// Edit template
|
||||
this.loadWindow(
|
||||
'comms/templates/editor/TemplatesEditorView',
|
||||
{
|
||||
title: 'Edit Template ' + templateId.substring(0, 6),
|
||||
static: true,
|
||||
expanded: true
|
||||
},
|
||||
{
|
||||
id: templateId,
|
||||
models: models
|
||||
})
|
||||
} else {
|
||||
ui.growl.append('Sorry, you do not have access to this resource', 'danger')
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
app.registerClass('TemplatesController', TemplatesController);
|
||||
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"routes": [
|
||||
{
|
||||
"url": "/templates",
|
||||
"role": [ "EIC_Dev", "EIC_Admin" ],
|
||||
"controller" : "comms/templates/TemplatesController",
|
||||
"method": "search"
|
||||
},
|
||||
{
|
||||
"url": "/:id",
|
||||
"role": [ "EIC_Dev", "EIC_Admin" ],
|
||||
"controller" : "comms/templates/TemplatesController",
|
||||
"method": "tplAction"
|
||||
}
|
||||
],
|
||||
"models": [ "comms/templates/TemplatesModel" ],
|
||||
"views": [
|
||||
"comms/templates/manager/TemplatesManagerView",
|
||||
"comms/templates/editor/TemplatesEditorView",
|
||||
"comms/templates/dialogs/TemplatesMailTestDialog",
|
||||
"comms/templates/dialogs/TemplatesUplImgDialog",
|
||||
"comms/templates/dialogs/TemplatesDecisionDialog",
|
||||
"templates/Ffs/dialogs/FileBrowserDialog"
|
||||
],
|
||||
"controllerDependencies": [
|
||||
"/helpers/basicDialogs",
|
||||
"/helpers/translator",
|
||||
"/helpers/validators",
|
||||
"/helpers/activeAttributes",
|
||||
"/libs/Ffs/fakeFileSystem",
|
||||
"/thirdparty/eicui/plugins/HtmlEditor/HtmlEditor",
|
||||
"/thirdparty/eicui/plugins/FileUpload/FileUpload"
|
||||
],
|
||||
"assets": {
|
||||
"styles": [
|
||||
{"name":"FileUpload.css", "path":"/app/thirdparty/eicui/plugins/FileUpload/"}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user