From 4e1c0589c21091aac306e8047b87d675accb067d Mon Sep 17 00:00:00 2001 From: Vishnu Ks Date: Tue, 13 Nov 2018 22:20:56 +0530 Subject: [PATCH] emails: Refactor if condition from style tag in missed_message_email. --- templates/zerver/emails/missed_message.html | 12 +++++++++--- tools/check-templates | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/templates/zerver/emails/missed_message.html b/templates/zerver/emails/missed_message.html index 30f79ac621..5501b66559 100644 --- a/templates/zerver/emails/missed_message.html +++ b/templates/zerver/emails/missed_message.html @@ -20,9 +20,15 @@ {% if show_message_content %}
{% for recipient_block in messages %} -
-
{{ recipient_block.header.html|safe }}
-
+ {% if not recipient_block.header.stream_message %} +
+
{{ recipient_block.header.html|safe }}
+
+ {% else %} +
+
{{ recipient_block.header.html|safe }}
+
+ {% endif %} {% for sender_block in recipient_block.senders %} {% if sender_block.sender %}
{{ sender_block.sender }}
{% endif %} {% for message_block in sender_block.content %} diff --git a/tools/check-templates b/tools/check-templates index 8cad20a8fa..a91ce57841 100755 --- a/tools/check-templates +++ b/tools/check-templates @@ -16,6 +16,8 @@ from typing import cast, Callable, Dict, Iterable, List EXCLUDED_FILES = [ ## Test data Files for testing modules in tests "tools/tests/test_template_data", + # Our parser doesn't handle the way its conditionals are layered + 'templates/zerver/emails/missed_message.html', ] def check_our_files(modified_only, all_dups, targets):