From 033cc3ce81854468e87a3ea0d326ba5a47aaa36d Mon Sep 17 00:00:00 2001 From: "Jonathan S. Katz" Date: Wed, 18 Apr 2018 14:57:57 -0400 Subject: [PATCH] Refactor message display. This will make it easier to apply styles to different messages --- .../mailarchives/templates/_message.html | 143 ++++++++++++++++++ .../mailarchives/templates/message.html | 142 +---------------- .../mailarchives/templates/message_flat.html | 74 +-------- 3 files changed, 145 insertions(+), 214 deletions(-) create mode 100644 django/archives/mailarchives/templates/_message.html diff --git a/django/archives/mailarchives/templates/_message.html b/django/archives/mailarchives/templates/_message.html new file mode 100644 index 0000000..aa5afd4 --- /dev/null +++ b/django/archives/mailarchives/templates/_message.html @@ -0,0 +1,143 @@ +{%load pgfilters%} + + + + + + + + + + +{%if msg.cc%} + + + + +{%endif%} + + + + + + + + + + + + + + + + + {% if not show_all %} + + + + + {% endif %} + {% if lists %} + + + + + {% endif %} +
From:{{msg.mailfrom|hidemail}}
To:{{msg.to|hidemail}}
Cc:{{msg.cc|hidemail}}
Subject:{%if not msg.hiddenstatus%}{{msg.subject}}{%endif%}
Date:{{msg.printdate}}
Message-ID:{{msg.messageid}}
Views: + Raw Message + Whole Thread + Download mbox +
Thread: + +
Lists:{%for l in lists %}{{l.listname}}{%endfor%}
+{%if msg.hiddenstatus%} +
{{msg.hiddenreason}}
+{%else%} +
{{msg.bodytxt|hideallemail|urlize}}
+ +{%if msg.has_attachment%} +
Attachments
+ + + + + + + + + + {%for a in msg.attachments%} + + + + + + {%endfor%} + +
AttachmentContent-TypeSize
+ {% if a.inlineable %} + + + + {% else %} + {{a.filename}} + {% endif %} + {{ a.contenttype }}{{a.len|filesizeformat}}
+{%endif%} + +{%if parent%} +

In response to

+ +{%endif%} + +{%if responses%} +

Responses

+ +{%endif%} + +{%if nextprev%} + {%for list, info in nextprev.items %} +

Browse {{list}} by date

+ + + + + + + + + + + {%if info.next%} + + + + + + + {%endif%} + {%if info.prev%} + + + + + + + {%endif%} + +
 FromDateSubject
Next Message{{info.next.from|nameonly}}{{info.next.date}}{{info.next.subject}}
Previous Message{{info.prev.from|nameonly}}{{info.prev.date}}{{info.prev.subject}}
+ {%endfor%} +{%endif%} + +{%endif%}{%comment%}hidden{%endcomment%} diff --git a/django/archives/mailarchives/templates/message.html b/django/archives/mailarchives/templates/message.html index ce7c89a..c136ac0 100644 --- a/django/archives/mailarchives/templates/message.html +++ b/django/archives/mailarchives/templates/message.html @@ -1,6 +1,5 @@ {%extends "page.html"%} {%block title%}{%if not msg.hiddenstatus%}{{msg.subject}}{%endif%}{%endblock%} -{%load pgfilters%} {%block extrahead%}