Merge pull request 'refs #5662 Add email modified-collection-volumetry' (!1743) from 5662-CollectionVolumetryNotify into dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #1743 Reviewed-by: Juan Ferrer <juan@verdnatura.es>
This commit is contained in:
commit
1a2b58af9c
|
@ -0,0 +1,12 @@
|
|||
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`,
|
||||
`${__dirname}/style.css`])
|
||||
.mergeStyles();
|
|
@ -0,0 +1,8 @@
|
|||
.jsonSection {
|
||||
text-align: left;
|
||||
background-color: #e4e4e4;
|
||||
padding: 25px;
|
||||
margin-left: 60px;
|
||||
margin-right: 60px;
|
||||
border-radius: 25px;
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
subject: Modified collection volumetry
|
||||
title: Modified collection volumetry
|
||||
description: Action performed
|
|
@ -0,0 +1,3 @@
|
|||
subject: Volumetría de colección modificada
|
||||
title: Volumetría de colección modificada
|
||||
description: Acción realizada
|
|
@ -0,0 +1,15 @@
|
|||
<email-body v-bind="$props">
|
||||
<div class="grid-row">
|
||||
<div class="grid-block vn-pa-ml">
|
||||
<div class="centered">
|
||||
<h1>{{ $t('title') }}</h1>
|
||||
<h3>{{ $t('description') }}: <u>{{ data.action }}</u> <i> {{ `(${this.username})` }} </i></h3>
|
||||
<div class="jsonSection">
|
||||
<span v-for="(value, key) in data" v-if="key !== 'action' && key !== 'userFk'">
|
||||
<b> {{ `${key}:` }} </b> {{ value }} <br>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</email-body>
|
|
@ -0,0 +1,25 @@
|
|||
const Component = require(`vn-print/core/component`);
|
||||
const emailBody = new Component('email-body');
|
||||
const models = require('vn-loopback/server/server').models;
|
||||
|
||||
module.exports = {
|
||||
name: 'modified-collection-volumetry',
|
||||
components: {
|
||||
'email-body': emailBody.build(),
|
||||
},
|
||||
async serverPrefetch() {
|
||||
this.username = (this.data.userFk) ? await this.getUsername(this.data.userFk) : 'system';
|
||||
},
|
||||
methods: {
|
||||
async getUsername(id) {
|
||||
const account = await models.VnUser.findById(id);
|
||||
return account.name;
|
||||
}
|
||||
},
|
||||
props: {
|
||||
data: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue