From 0fcbc65ecc9f90885d3d1f3cec4965295c109c0b Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Mon, 28 Jan 2019 12:28:22 +0100 Subject: [PATCH] plantilla claim-pickup #1044 --- modules/claim/front/descriptor/index.js | 4 +- print/common/css/layout.css | 9 +- print/common/css/misc.css | 15 +++ print/lib/emailEngine.js | 2 +- print/lib/router.js | 8 +- .../report/email-footer/assets/css/style.css | 25 ++-- print/report/email-footer/index.html | 6 +- print/report/email-footer/index.js | 4 +- print/report/email-footer/locale.js | 9 +- print/report/email-header/index.js | 2 +- .../report/report-footer/assets/css/index.js | 4 +- .../report/report-footer/assets/css/style.css | 5 +- print/report/report-footer/index.html | 6 +- print/report/report-footer/locale.js | 4 +- .../assets/css/index.js | 1 + .../assets/css/style.css | 7 ++ .../report/rpt-claim-pickup-order/index.html | 110 +++++++++--------- print/report/rpt-claim-pickup-order/locale.js | 2 +- 18 files changed, 131 insertions(+), 92 deletions(-) create mode 100644 print/common/css/misc.css diff --git a/modules/claim/front/descriptor/index.js b/modules/claim/front/descriptor/index.js index ac53e1203..4ef8a5b77 100644 --- a/modules/claim/front/descriptor/index.js +++ b/modules/claim/front/descriptor/index.js @@ -48,10 +48,10 @@ class Controller { returnDialog(response) { if (response === 'CANCEL') { - let url = `/report/rpt-claim-pickup-order?claimFk=${this.claim.id}`; + let url = `/api/report/rpt-claim-pickup-order?claimFk=${this.claim.id}`; window.open(url); } else if (response === 'ACCEPT') { - this.$http.post(`/email/claim-pickup-order`, {claimFk: this.claim.id}).then( + this.$http.post(`/api/email/claim-pickup-order`, {claimFk: this.claim.id}).then( () => this.vnApp.showMessage(this.$translate.instant('Notification sent!')) ); } diff --git a/print/common/css/layout.css b/print/common/css/layout.css index 3f540622e..294593142 100644 --- a/print/common/css/layout.css +++ b/print/common/css/layout.css @@ -120,8 +120,7 @@ font-weight: bold } - -.grid .row.inline > div { +.grid .row.inline > section { float: left; } @@ -129,11 +128,13 @@ border: 1px solid #DDD; margin-bottom: 10px; position: relative; - padding:10px + padding:20px } .panel .header { - font-weight: bold + background-color: #FFF; + font-weight: bold; + margin-top: -20px } .box { diff --git a/print/common/css/misc.css b/print/common/css/misc.css new file mode 100644 index 000000000..d1e7edf27 --- /dev/null +++ b/print/common/css/misc.css @@ -0,0 +1,15 @@ +.uppercase { + text-transform: uppercase +} + +.centered { + text-align: center +} + +.number { + text-align: right +} + +.gray { + color: #555 +} \ No newline at end of file diff --git a/print/lib/emailEngine.js b/print/lib/emailEngine.js index 86342bb36..2ccff4f87 100644 --- a/print/lib/emailEngine.js +++ b/print/lib/emailEngine.js @@ -88,7 +88,7 @@ module.exports = { const componentPath = `${this.path}/${orgComponent.name}`; let fileSrc = componentPath + file; - if (file.slice(0, 4) === 'http' || file.slice(0, 4) === 'https') + if (file.slice(0, 4) === 'http' || file.slice(0, 5) === 'https') fileSrc = file; const fileName = file.split('/').pop(); diff --git a/print/lib/router.js b/print/lib/router.js index 30fd0d347..69b02b702 100644 --- a/print/lib/router.js +++ b/print/lib/router.js @@ -14,7 +14,7 @@ module.exports = app => { function registerReport(name) { if (!name) throw new Error('Report name required'); - app.get(`/report/${name}`, (request, response, next) => { + app.get(`/api/report/${name}`, (request, response, next) => { reportEngine.toPdf(name, request).then(stream => { response.setHeader('Content-Disposition', `attachment; filename="${name}.pdf"`); response.setHeader('Content-type', 'application/pdf'); @@ -33,7 +33,7 @@ module.exports = app => { function registerEmail(name) { if (!name) throw new Error('Email name required'); - app.get(`/email/${name}`, (request, response, next) => { + app.get(`/api/email/${name}`, (request, response, next) => { emailEngine.render(name, request).then(rendered => { response.send(rendered.html); }).catch(e => { @@ -41,7 +41,7 @@ module.exports = app => { }); }); - app.post(`/email/${name}`, (request, response, next) => { + app.post(`/api/email/${name}`, (request, response, next) => { emailEngine.toEmail(name, request).then(() => { response.status(200).json({status: 200}); }).catch(e => { @@ -60,6 +60,6 @@ module.exports = app => { registerReport(route.name); const staticPath = this.path + `/${route.name}/assets`; - app.use(`/assets`, express.static(staticPath)); + app.use(`/api/assets`, express.static(staticPath)); }); }; diff --git a/print/report/email-footer/assets/css/style.css b/print/report/email-footer/assets/css/style.css index cf0242f36..9d47b193e 100644 --- a/print/report/email-footer/assets/css/style.css +++ b/print/report/email-footer/assets/css/style.css @@ -1,34 +1,39 @@ +@media (max-width: 400px) { + .buttons a { + display: block; + width: 100% + } +} + .buttons { - background-color: #FFF; - text-align: center; width: 100% } .buttons a { + display: inline-block; + box-sizing: border-box; text-decoration: none; - font-size: 18px; - color: #fff + font-size: 16px; + color: #fff; + width: 50% } .buttons .btn { background-color: #333; - min-width: 300px; - height: 72px; - display: inline-block; text-align: center } .buttons .btn .text { display: inline-block; - padding-top: 22px + padding: 22px 0 } .buttons .btn .icon { background-color: #95d831; + box-sizing: border-box; text-align: center; - padding-top: 22px; + padding: 16.5px 0; float: right; - height: 50px; width: 70px } diff --git a/print/report/email-footer/index.html b/print/report/email-footer/index.html index fb992f15e..dd7853591 100644 --- a/print/report/email-footer/index.html +++ b/print/report/email-footer/index.html @@ -1,16 +1,16 @@