emails: Refactor if condition from style tag in missed_message_email.

This commit is contained in:
Vishnu Ks 2018-11-13 22:20:56 +05:30 committed by Tim Abbott
parent 56ee70e2a9
commit 4e1c0589c2
2 changed files with 11 additions and 3 deletions

View File

@ -20,9 +20,15 @@
{% if show_message_content %}
<div id='messages' style="width: 600px;font-size: 12px;font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;overflow-y: auto;">
{% for recipient_block in messages %}
<div class='recipient_block' style="{% if not recipient_block.header.stream_message %}background-color: hsl(192, 20%, 95%);{% endif %}border: 1px solid black;margin-bottom: 4px;">
<div class='recipient_header' style="{% if recipient_block.header.stream_message %}background-color: hsl(213, 100%, 81%);{% else %}color: hsl(0, 0%, 100%);background-color: hsl(0, 0%, 27%);{% endif %}border-bottom: 1px solid black;font-weight: bold;padding: 2px;">{{ recipient_block.header.html|safe }}</div>
<div class='message_content' style="{% if not recipient_block.header.stream_message %}background-color: hsl(192, 20%, 95%);{% endif %}margin-left: 1px;margin-right: 2px;">
{% if not recipient_block.header.stream_message %}
<div class='recipient_block' style="background-color: hsl(192, 20%, 95%);border: 1px solid black;margin-bottom: 4px;">
<div class='recipient_header' style="background-color: hsl(213, 100%, 81%);border-bottom: 1px solid black;font-weight: bold;padding: 2px;">{{ recipient_block.header.html|safe }}</div>
<div class='message_content' style="background-color: hsl(192, 20%, 95%);margin-left: 1px;margin-right: 2px;">
{% else %}
<div class='recipient_block' style="border: 1px solid black;margin-bottom: 4px;">
<div class='recipient_header' style="color: hsl(0, 0%, 100%);background-color: hsl(0, 0%, 27%);border-bottom: 1px solid black;font-weight: bold;padding: 2px;">{{ recipient_block.header.html|safe }}</div>
<div class='message_content' style="margin-left: 1px;margin-right: 2px;">
{% endif %}
{% for sender_block in recipient_block.senders %}
{% if sender_block.sender %} <div class="message_sender" style="font-weight: bold;padding-top: 1px;">{{ sender_block.sender }}</div>{% endif %}
{% for message_block in sender_block.content %}

View File

@ -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):