public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Lukas Wagner <l.wagner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 1/2] notifications: templates: adapt to whitespace handling changes with new handlebars version
Date: Tue,  5 Aug 2025 15:35:54 +0200	[thread overview]
Message-ID: <20250805133555.257076-2-l.wagner@proxmox.com> (raw)
In-Reply-To: <20250805133555.257076-1-l.wagner@proxmox.com>

Handlebars 4.1 changed how whitespace is trimmed when using the `~`
operator in helpers/variables in order to be closer to the canonical
JavaScript handlebars implementation. These changed impacted how some of
our notification templates were rendered. This commit aims to restore
the initial appearance.

[1] https://github.com/sunng87/handlebars-rust

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
 templates/default/package-updates-body.txt.hbs |  2 +-
 templates/default/sync-err-body.txt.hbs        |  1 +
 templates/default/sync-ok-body.txt.hbs         |  1 +
 templates/default/tape-backup-err-body.txt.hbs | 17 ++++++++++-------
 templates/default/tape-backup-ok-body.txt.hbs  | 16 +++++++++-------
 templates/default/verify-err-body.txt.hbs      |  2 +-
 6 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/templates/default/package-updates-body.txt.hbs b/templates/default/package-updates-body.txt.hbs
index cf69ae694..9800ab5ca 100644
--- a/templates/default/package-updates-body.txt.hbs
+++ b/templates/default/package-updates-body.txt.hbs
@@ -1,6 +1,6 @@
 Proxmox Backup Server has the following updates available:
 {{#each available-updates}}
-    {{this.package-name}}: {{this.installed-version}} -> {{this.available-version~}}
+    {{this.package-name}}: {{this.installed-version}} -> {{this.available-version}}
 {{/each}}
 
 To upgrade visit the web interface:
diff --git a/templates/default/sync-err-body.txt.hbs b/templates/default/sync-err-body.txt.hbs
index d47a5d6c8..85b829976 100644
--- a/templates/default/sync-err-body.txt.hbs
+++ b/templates/default/sync-err-body.txt.hbs
@@ -6,6 +6,7 @@ Remote Store:       {{remote-datastore}}
 {{else~}}
 Local Source Store: {{remote-datastore}}
 {{/if}}
+
 Synchronization failed: {{error}}
 
 
diff --git a/templates/default/sync-ok-body.txt.hbs b/templates/default/sync-ok-body.txt.hbs
index 6ef5993de..aba8c9961 100644
--- a/templates/default/sync-ok-body.txt.hbs
+++ b/templates/default/sync-ok-body.txt.hbs
@@ -6,6 +6,7 @@ Remote Store:       {{remote-datastore}}
 {{else~}}
 Local Source Store: {{remote-datastore}}
 {{/if}}
+
 Synchronization successful.
 
 
diff --git a/templates/default/tape-backup-err-body.txt.hbs b/templates/default/tape-backup-err-body.txt.hbs
index 387b2438a..7e6203db7 100644
--- a/templates/default/tape-backup-err-body.txt.hbs
+++ b/templates/default/tape-backup-err-body.txt.hbs
@@ -5,18 +5,21 @@ Datastore:  {{datastore}}
 Tape Pool:  {{tape-pool}}
 Tape Drive: {{tape-drive}}
 
-{{#if snapshot-list~}}
+{{#if snapshot-list}}
 Snapshots included:
+{{#each snapshot-list}}
+  {{this}}
+{{/each}}
 
-{{#each snapshot-list~}}
-{{this}}
-{{/each~}}
 {{/if}}
+Duration: {{duration job-duration}}
+
 {{#if used-tapes-list}}
 Used Tapes:
-{{#each used-tapes-list~}}
-{{this}}
-{{/each~}}
+{{#each used-tapes-list}}
+  {{this}}
+{{/each}}
+
 {{/if}}
 Tape Backup failed: {{error}}
 
diff --git a/templates/default/tape-backup-ok-body.txt.hbs b/templates/default/tape-backup-ok-body.txt.hbs
index 33364142a..6c03e49d4 100644
--- a/templates/default/tape-backup-ok-body.txt.hbs
+++ b/templates/default/tape-backup-ok-body.txt.hbs
@@ -5,19 +5,21 @@ Datastore:  {{datastore}}
 Tape Pool:  {{tape-pool}}
 Tape Drive: {{tape-drive}}
 
-{{#if snapshot-list~}}
+{{#if snapshot-list}}
 Snapshots included:
+{{#each snapshot-list}}
+  {{this}}
+{{/each}}
 
-{{#each snapshot-list~}}
-{{this}}
-{{/each~}}
 {{/if}}
 Duration: {{duration job-duration}}
+
 {{#if used-tapes-list}}
 Used Tapes:
-{{#each used-tapes-list~}}
-{{this}}
-{{/each~}}
+{{#each used-tapes-list}}
+  {{this}}
+{{/each}}
+
 {{/if}}
 Tape Backup successful.
 
diff --git a/templates/default/verify-err-body.txt.hbs b/templates/default/verify-err-body.txt.hbs
index 96922eee1..1eb63206a 100644
--- a/templates/default/verify-err-body.txt.hbs
+++ b/templates/default/verify-err-body.txt.hbs
@@ -5,7 +5,7 @@ Datastore: {{datastore}}
 Verification failed on these snapshots/groups:
 
 {{#each failed-snapshot-list}}
-    {{this~}}
+    {{this}}
 {{/each}}
 
 
-- 
2.47.2



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


  reply	other threads:[~2025-08-05 13:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-05 13:35 [pbs-devel] [PATCH proxmox-backup 0/2] notification template fixes for newer " Lukas Wagner
2025-08-05 13:35 ` Lukas Wagner [this message]
2025-08-05 13:35 ` [pbs-devel] [PATCH proxmox-backup 2/2] notifications: tape load: move error message to separate line Lukas Wagner
2025-08-05 15:40 ` [pbs-devel] applied: [PATCH proxmox-backup 0/2] notification template fixes for newer handlebars version Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250805133555.257076-2-l.wagner@proxmox.com \
    --to=l.wagner@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal