emails: Extract CSS to email.css in digest.html.

This commit is contained in:
Vishnu Ks 2016-09-14 04:54:48 +00:00 committed by Tim Abbott
parent e7c5bc0cee
commit 6de6b0ed31
5 changed files with 85 additions and 15 deletions

View File

@ -8,15 +8,15 @@
{% if unread_pms %}
<h2>Missed private messages</h2>
<p>You have some missed private messages. Here are some of them:</p>
<div id='private-messages' style="width: 600px;font-size: 12px;font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;overflow-y: scroll;">
<div id='private-messages'>
{% for recipient_block in unread_pms %}
<div class='recipient_block' style="background-color: hsl(192, 20%, 95%);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="background-color: hsl(192, 20%, 95%);margin-left: 1px;margin-right: 2px;">
<div class='recipient_block'>
<div class='recipient_header'>{{ recipient_block.header.html|safe }}</div>
<div class='message_content'>
{% 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 %}
{% if sender_block.sender %} <div class="message_sender">{{ sender_block.sender }}</div>{% endif %}
{% for message_block in sender_block.content %}
<div class='message_content_block' style="padding-left: 6px;font-weight: normal;">
<div class='message_content_block'>
{{ message_block.html|safe }}
</div>
{% endfor %}
@ -39,15 +39,15 @@
</p>
{% for convo in hot_conversations %}
<div id='messages' style="width: 600px;font-size: 12px;font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;overflow-y: scroll;">
<div id='messages'>
{% for recipient_block in convo.first_few_messages %}
<div class='recipient_block' style="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="margin-left: 1px;margin-right: 2px;">
<div class='hot_convo_recipient_block'>
<div class='hot_convo_recipient_header'>{{ recipient_block.header.html|safe }}</div>
<div class='hot_convo_message_content'>
{% 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 %}
{% if sender_block.sender %} <div class="hot_convo_message_sender">{{ sender_block.sender }}</div>{% endif %}
{% for message_block in sender_block.content %}
<div class='message_content_block' style="padding-left: 6px;font-weight: normal;">
<div class='hot_convo_message_content_block'>
{{ message_block.html|safe }}
</div>
{% endfor %}

View File

@ -171,6 +171,77 @@ a.button:hover {
z-index: 100;
}
#private-messages {
width: 600px;
font-size: 12px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
overflow-y: scroll;
}
.recipient_block {
background-color: hsl(192, 20%, 95%);
border: 1px solid black;
margin-bottom: 4px;
}
.recipient_header {
color: hsl(0, 0%, 100%);
background-color: hsl(0, 0%, 27%);
border-bottom: 1px solid black;
font-weight: bold;
padding: 2px;
}
.message_content {
background-color: hsl(192, 20%, 95%);
margin-left: 1px;
margin-right: 2px;
}
.message_sender {
font-weight: bold;
padding-top: 1px;
}
.message_content_block {
padding-left: 6px;
font-weight: normal;
}
#messages {
width: 600px;
font-size: 12px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
overflow-y: scroll;
}
.hot_convo_recipient_block {
border: 1px solid black;
margin-bottom: 4px;
}
.hot_convo_recipient_header {
background-color: hsl(213, 100%, 81%);
border-bottom: 1px solid black;
font-weight: bold;
padding: 2px;
}
.hot_convo_message_content {
margin-left: 1px;
margin-right: 2px;
}
.hot_convo_message_sender {
font-weight: bold;
padding-top: 1px;
}
.hot_convo_message_content_block {
padding-left: 6px;
font-weight: normal;
}
@media only screen and (max-width: 620px) {
table[class=body] h1 {
font-size: 28px !important;

View File

@ -9,7 +9,7 @@ from cssutils.profiles import Profiles, properties, macros
ZULIP_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), '../')
if __name__ == "__main__":
escaped_jinja2_characters = [('%7B%7B%20', '{{ '), ('%20%7D%7D', ' }}')]
escaped_jinja2_characters = [('%7B%7B%20', '{{ '), ('%20%7D%7D', ' }}'), ('&gt;', '>')]
templates_to_inline = set()
for f in os.listdir(os.path.join(ZULIP_PATH, 'templates', 'zerver', 'emails')):

View File

@ -776,7 +776,6 @@ def build_custom_checkers(by_lang):
# Old-style email templates need to use inline style
# attributes; it should be possible to clean these up
# when we convert these templates to use premailer.
'templates/zerver/emails/digest.html',
'templates/zerver/emails/missed_message.html',
'templates/zerver/emails/email_base_messages.html',

View File

@ -11,4 +11,4 @@ LATEST_RELEASE_ANNOUNCEMENT = "https://blog.zulip.org/2018/11/07/zulip-1-9-relea
# Typically, adding a dependency only requires a minor version bump, and
# removing a dependency requires a major version bump.
PROVISION_VERSION = '26.15'
PROVISION_VERSION = '26.16'