mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-10 10:03:21 -04:00
Fix HTML showing up on breaking change page
The breaking change page temporarily holds the changes in hidden inputs on the page. The messages content it gets from the `.content` property on the subject. This is raw and not transformed in any way, so fine. For the subject it gets the value from the `.subject` attribute on the template. For email templates, this will be transformed to highlight placeholders with `<span class='placeholder'>…`. This means that when the change is confirmed, it’s this encoded version that gets sent to the API. Which is bad, because we then save `<span class='placeholder'>` in the database. This commit changes the page to look at the `._subject` attribute instead, which is the internal, untransformed version of the subject.
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
|
||||
<form method="post">
|
||||
<input type="hidden" name="name" value="{{ new_template.name }}" />
|
||||
<input type="hidden" name="subject" value="{{ new_template.subject or '' }}" />
|
||||
<input type="hidden" name="subject" value="{{ new_template._subject or '' }}" />
|
||||
<input type="hidden" name="template_content" value="{{ new_template.content }}" />
|
||||
<input type="hidden" name="template_id" value="{{ new_template.id }}" />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user