Show sponsor emails on the send mail page
authorMagnus Hagander <magnus@hagander.net>
Tue, 15 May 2018 12:44:29 +0000 (14:44 +0200)
committerMagnus Hagander <magnus@hagander.net>
Tue, 15 May 2018 12:44:29 +0000 (14:44 +0200)
So that previous emails sent can be viewed

postgresqleu/confsponsor/views.py
template/confsponsor/sendmail.html

index 9594fb39765509502929cc15fc4a2c788ba663cf..37e418f749426b12a9370c416421fc14bf517976 100644 (file)
@@ -633,6 +633,7 @@ def sponsor_admin_send_mail(request, confurlname):
        return render(request, 'confsponsor/sendmail.html', {
                'conference': conference,
                'form': form,
+               'mails': SponsorMail.objects.filter(conference=conference).order_by('sentat'),
        })
 
 @login_required
index 3ddc601f29ff8bb5bc68f9fd2e8617c4a23eed37..6c56611b7294b22042bd465033d69223d0c63380 100644 (file)
@@ -22,6 +22,16 @@ be made available historically to both those and to anybody else who signs
 up as a sponsor at that level later.
 </p>
 
+{%if mails%}
+<h2>Previous emails</h2>
+<ul>
+{%for m in mails%}
+ <li>{{m.sentat|date:"Y-m-d H:i"}} <a href="../viewmail/{{m.id}}/">{{m.subject}}</a> ({{m.levels.all|join:", "}})</li>
+{%endfor%}
+</ul>
+{%endif%}
+
+<h2>New email</h2>
 <form method="post" action=".">{% csrf_token %}
 <table class="emailform">
  <tr><th>From</th><td>{{conference.sponsoraddr}}</td></tr>