Last active
November 28, 2018 09:37
-
-
Save MEGApixel23/e6f8793d5316387178528c795c43f34b to your computer and use it in GitHub Desktop.
Revisions
-
MEGApixel23 revised this gist
Nov 28, 2018 . No changes.There are no files selected for viewing
-
MEGApixel23 revised this gist
Nov 28, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ const mustache = require('mustache'); /** * @param html * @param data has the following structure: * { * pages: [ * { @@ -23,7 +23,7 @@ const mustache = require('mustache'); * } * ] * } * @param partials has pre-compiled CSS, JS and HTML parts (strings). Has the following structure: * { barCode: String, css: String, vendor: String } * * @return String -
MEGApixel23 revised this gist
Nov 28, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -28,6 +28,6 @@ const mustache = require('mustache'); * * @return String */ module.exports = (html, data, partials) => { return mustache.render(html, data, partials); }; -
MEGApixel23 revised this gist
Nov 28, 2018 . No changes.There are no files selected for viewing
-
MEGApixel23 renamed this gist
Nov 28, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
MEGApixel23 created this gist
Nov 28, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ const mustache = require('mustache'); /** * @param html * @param data has ths following structure: * { * pages: [ * { * packages: { * dspName: String, * number: Number, * countAll: Number, * logo: String, * externalOrderId: String, * dspOrderId: String, * customerName: String, * address: String, * phone: String, * deliveryDate: String, * deliveryTime: String, * deliveryInstructions: string, * } * } * ] * } * @param partials has pre-compiled CSS, JS and HTML parts. Has the following structure * { barCode: String, css: String, vendor: String } * * @return String */ module.exports.render = (html, data, partials) => { return mustache.render(html, data, partials); }; This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,69 @@ <html> <head> <style>{{> css }}</style> <script>{{> vendor }}</script> </head> <body> {{# pages }} <div class="page"> {{# packages }} <div class="package"> <div class="header-container"> <div class="header pull-left corporate-name">{{ dspName }}</div> <div class="header pull-right packages">{{ number }}/{{ countAll }}</div> </div> <div class="center"> {{# logo }} <img class="logo" src="{{{ logo }}}" /> {{/ logo }} </div> <div class="info center"> <table class="details"> <tr> <td class="heading">Order #:</td> <td>{{ externalOrderId }}</td> </tr> {{# dspOrderId }} <tr> <td class="heading">{{ dspName }} Order ID:</td> <td>{{ dspOrderId }}</td> </tr> {{/ dspOrderId }} <tr> <td class="heading">Name:</td> <td>{{ customerName }}</td> </tr> <tr> <td class="heading">Address:</td> <td> {{# address }} <div>{{ item }}</div> {{/ address }} </td> </tr> <tr> <td class="heading">Phone #:</td> <td>{{ phone }}</td> </tr> <tr> <td class="heading">Delivery Date:</td> <td>{{ deliveryDate }}</td> </tr> <tr> <td class="heading">Delivery Time:</td> <td>{{ deliveryTime }}</td> </tr> <tr> <td> <div class="instructions-icon"></div> </td> <td>{{ deliveryInstructions }}</td> </tr> </table> </div> </div> {{/ packages }} </div> {{/ pages }} </body> </html>