diff --git a/print/templates/email/zone-included/assets/css/import.js b/print/templates/email/zone-included/assets/css/import.js new file mode 100644 index 000000000..4b4bb7086 --- /dev/null +++ b/print/templates/email/zone-included/assets/css/import.js @@ -0,0 +1,11 @@ +const Stylesheet = require(`vn-print/core/stylesheet`); + +const path = require('path'); +const vnPrintPath = path.resolve('print'); + +module.exports = new Stylesheet([ + `${vnPrintPath}/common/css/spacing.css`, + `${vnPrintPath}/common/css/misc.css`, + `${vnPrintPath}/common/css/layout.css`, + `${vnPrintPath}/common/css/email.css`]) + .mergeStyles(); diff --git a/print/templates/email/zone-included/locale/es.yml b/print/templates/email/zone-included/locale/es.yml new file mode 100644 index 000000000..2e954840d --- /dev/null +++ b/print/templates/email/zone-included/locale/es.yml @@ -0,0 +1,2 @@ +subject: Colisión de zona detectada +title: "La zona {0} ha sido registrada en más de un sitio" diff --git a/print/templates/email/zone-included/sql/zoneIncluded.sql b/print/templates/email/zone-included/sql/zoneIncluded.sql new file mode 100644 index 000000000..eaf331232 --- /dev/null +++ b/print/templates/email/zone-included/sql/zoneIncluded.sql @@ -0,0 +1,5 @@ +SELECT + z.name +FROM vn.zoneIncluded zI + LEFT JOIN vn.zone z ON z.Id = zI.zoneFk +WHERE zI.id = ?; diff --git a/print/templates/email/zone-included/zone-included.html b/print/templates/email/zone-included/zone-included.html new file mode 100644 index 000000000..fbb58334a --- /dev/null +++ b/print/templates/email/zone-included/zone-included.html @@ -0,0 +1,8 @@ + +
+
+

{{ $t('subject') }}

+

{{ $t('title', [this.zoneIncluded.name]) }}

+
+
+
diff --git a/print/templates/email/zone-included/zone-included.js b/print/templates/email/zone-included/zone-included.js new file mode 100755 index 000000000..821d7c42a --- /dev/null +++ b/print/templates/email/zone-included/zone-included.js @@ -0,0 +1,27 @@ +const Component = require(`vn-print/core/component`); +const emailBody = new Component('email-body'); + +module.exports = { + name: 'zone-included', + async serverPrefetch() { + this.zoneIncluded = await this.fetchZoneIncluded(this.id); + }, + methods: { + fetchZoneIncluded(id) { + return this.findOneFromDef('zoneIncluded', [id]); + }, + }, + components: { + 'email-body': emailBody.build(), + }, + props: { + id: { + type: Number, + required: true + }, + url: { + type: String, + required: true + } + } +};