Use -%> for newline slurping

Fixes #383
This commit is contained in:
Girish Ramakrishnan
2017-07-24 20:58:15 -07:00
parent 61e130fb71
commit 6eab8bbdce

View File

@@ -1,38 +1,43 @@
<%if (format === 'text') { %>
<% if (format === 'text') { -%>
Dear <%= cloudronName %> Admin,
This is the weekly summary of activities on your Cloudron.
<% if (info.pendingBoxUpdate) { %>
A new Cloudron version <%- info.pendingBoxUpdate.version %> is available. Please update at the earliest.
This is the weekly summary of activities on your Cloudron <%= fqdn %>.
<% if (info.pendingBoxUpdate) { -%>
Changelog for this version:
<% for (var i = 0; i < info.pendingBoxUpdate.changelog.length; i++) { %>
Cloudron v<%- info.pendingBoxUpdate.version %> is available:
<% for (var i = 0; i < info.pendingBoxUpdate.changelog.length; i++) { -%>
* <%- info.pendingBoxUpdate.changelog[i] %>
<% } %>
<% if (!info.hasSubscription) { %>To receive automatic updates for this Cloudron, upgrade to one of our paid plans at https://cloudron.io/pricing.html<% } %>
<% } %>
<% if (info.pendingAppUpdates.length) { %>
One or more apps updates are available:
<% for (var i = 0; i < info.pendingAppUpdates.length; i++) { %>
- <%= info.pendingAppUpdates[i].manifest.title %> (to version <%= info.pendingAppUpdates[i].manifest.version %>):
<% for (var j = 0; j < info.pendingAppUpdates[i].manifest.changelog.split('\n').length; j++) { %>
<%= info.pendingAppUpdates[i].manifest.changelog.split('\n')[j] %>
<% }}} %>
<% if (info.finishedBoxUpdates.length) { %>
<% }} -%>
<% if (info.pendingAppUpdates.length) { -%>
One or more app updates are available:
<% for (var i = 0; i < info.pendingAppUpdates.length; i++) { -%>
- <%= info.pendingAppUpdates[i].manifest.title %> package v<%= info.pendingAppUpdates[i].manifest.version %>
<% for (var j = 0; j < info.pendingAppUpdates[i].manifest.changelog.trim().split('\n').length; j++) { -%>
<%= info.pendingAppUpdates[i].manifest.changelog.trim().split('\n')[j] %>
<% }}} -%>
<% if (info.finishedBoxUpdates.length) { -%>
Cloudron was updated with the following releases:
<% for (var i = 0; i < info.finishedBoxUpdates.length; i++) { %>
<% for (var i = 0; i < info.finishedBoxUpdates.length; i++) { -%>
- Version <%= info.finishedBoxUpdates[i].boxUpdateInfo.version %>
<% for (var j = 0; j < info.finishedBoxUpdates[i].boxUpdateInfo.changelog.length; j++) { %>
<% for (var j = 0; j < info.finishedBoxUpdates[i].boxUpdateInfo.changelog.length; j++) { -%>
* <%= info.finishedBoxUpdates[i].boxUpdateInfo.changelog[j] %>
<% }}} %>
<% if (info.finishedAppUpdates.length) { %>
<% }}} -%>
<% if (info.finishedAppUpdates.length) { -%>
The following apps were updated:
<% for (var i = 0; i < info.finishedAppUpdates.length; i++) { %>
- <%= info.finishedAppUpdates[i].toManifest.title %> (to version <%= info.finishedAppUpdates[i].toManifest.version %>)
<% for (var j = 0; j < info.finishedAppUpdates[i].toManifest.changelog.split('\n').length; j++) { %>
<%= info.finishedAppUpdates[i].toManifest.changelog.split('\n')[j] %>
<% }}} %>
<% for (var i = 0; i < info.finishedAppUpdates.length; i++) { -%>
- <%= info.finishedAppUpdates[i].toManifest.title %> package v<%= info.finishedAppUpdates[i].toManifest.version %>
<% for (var j = 0; j < info.finishedAppUpdates[i].toManifest.changelog.trim().split('\n').length; j++) { -%>
<%= info.finishedAppUpdates[i].toManifest.changelog.trim().split('\n')[j] %>
<% }}} -%>
<% if (!info.hasSubscription) { -%>
*Keep your Cloudron automatically up-to-date and secure by upgrading to a paid plan at* <%= webadminUrl %>/#/settings
<% } -%>
Powered by https://cloudron.io
Sent at: <%= new Date().toUTCString() %>