Client's public folder renamed to static
Regular campaign sender seems to have most of the code in place. (Not tested.)
This commit is contained in:
parent
89eabea0de
commit
63765f7222
354 changed files with 836 additions and 324 deletions
|
|
@ -4,15 +4,16 @@ const passport = require('../lib/passport');
|
|||
const _ = require('../lib/translate')._;
|
||||
const clientHelpers = require('../lib/client-helpers');
|
||||
const { getTrustedUrl } = require('../lib/urls');
|
||||
const { AppType } = require('../shared/app');
|
||||
|
||||
const routerFactory = require('../lib/router-async');
|
||||
|
||||
function getRouter(trusted) {
|
||||
function getRouter(appType) {
|
||||
const router = routerFactory.create();
|
||||
|
||||
if (trusted) {
|
||||
if (appType === AppType.TRUSTED) {
|
||||
router.getAsync('/*', passport.csrfProtection, async (req, res) => {
|
||||
const mailtrainConfig = await clientHelpers.getAnonymousConfig(req.context, trusted);
|
||||
const mailtrainConfig = await clientHelpers.getAnonymousConfig(req.context, appType);
|
||||
if (req.user) {
|
||||
Object.assign(mailtrainConfig, await clientHelpers.getAuthenticatedConfig(req.context));
|
||||
}
|
||||
|
|
@ -32,6 +33,4 @@ function getRouter(trusted) {
|
|||
}
|
||||
|
||||
|
||||
module.exports = {
|
||||
getRouter
|
||||
};
|
||||
module.exports.getRouter = getRouter;
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ const interoperableErrors = require('../shared/interoperable-errors');
|
|||
|
||||
const { getTrustedUrl, getSandboxUrl } = require('../lib/urls');
|
||||
const { base } = require('../shared/templates');
|
||||
const { AppType } = require('../shared/app');
|
||||
|
||||
|
||||
users.registerRestrictedAccessTokenMethod('mosaico', async ({entityTypeId, entityId}) => {
|
||||
|
|
@ -123,10 +124,10 @@ function sanitizeSize(val, min, max, defaultVal, allowNull) {
|
|||
|
||||
|
||||
|
||||
function getRouter(trusted) {
|
||||
function getRouter(appType) {
|
||||
const router = routerFactory.create();
|
||||
|
||||
if (!trusted) {
|
||||
if (appType === AppType.SANDBOXED) {
|
||||
router.getAsync('/templates/:mosaicoTemplateId/index.html', passport.loggedIn, async (req, res) => {
|
||||
const tmpl = await mosaicoTemplates.getById(req.context, req.params.mosaicoTemplateId);
|
||||
|
||||
|
|
@ -174,7 +175,7 @@ function getRouter(trusted) {
|
|||
});
|
||||
|
||||
router.getAsync('/editor', passport.csrfProtection, async (req, res) => {
|
||||
const mailtrainConfig = await clientHelpers.getAnonymousConfig(req.context, trusted);
|
||||
const mailtrainConfig = await clientHelpers.getAnonymousConfig(req.context, appType);
|
||||
|
||||
let languageStrings = null;
|
||||
if (config.language && config.language !== 'en') {
|
||||
|
|
@ -196,7 +197,7 @@ function getRouter(trusted) {
|
|||
getSandboxUrl('mailtrain/common.js'),
|
||||
getSandboxUrl('mailtrain/mosaico.js')
|
||||
],
|
||||
mosaicoPublicPath: getSandboxUrl('public/mosaico')
|
||||
mosaicoPublicPath: getSandboxUrl('static/mosaico')
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -240,6 +241,4 @@ function getRouter(trusted) {
|
|||
return router;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getRouter
|
||||
};
|
||||
module.exports.getRouter = getRouter;
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ async function injectCustomFormData(customFormId, viewKey, data) {
|
|||
}
|
||||
|
||||
if (!customFormId) {
|
||||
data.formInputStyle = '@import url(/public/subscription/form-input-style.css);';
|
||||
data.formInputStyle = '@import url(/static/subscription/form-input-style.css);';
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -86,7 +86,7 @@ async function injectCustomFormData(customFormId, viewKey, data) {
|
|||
|
||||
data.template.template = form[viewKey] || data.template.template;
|
||||
data.template.layout = form.layout || data.template.layout;
|
||||
data.formInputStyle = form.formInputStyle || '@import url(/public/subscription/form-input-style.css);';
|
||||
data.formInputStyle = form.formInputStyle || '@import url(/static/subscription/form-input-style.css);';
|
||||
|
||||
const configItems = await settings.get(contextHelpers.getAdminContext(), ['uaCode']);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue