emailer display for email

This commit is contained in:
Sanj 2011-12-06 04:12:18 +05:30
parent fe42ca8692
commit caa91ebc28
3 changed files with 106 additions and 0 deletions

View File

@ -1 +1,15 @@
# Create your views here. # Create your views here.
from django.shortcuts import render_to_response, get_object_or_404
from models import *
def show_emailer(request, issue_no):
issue = get_object_or_404(EmailerIssue, issue_no=issue_no)
weblinks = Weblink.objects.filter(issue=issue)
bbitems = BulletinBoardItem.objects.filter(issue=issue)
articles = IssueArticle.objects.filter(issue=issue)
return render_to_response("emailer/email.html", {
'issue': issue,
'weblinks': weblinks,
'bbitems': bbitems,
'articles': articles
})

View File

@ -0,0 +1,91 @@
<table width="600" border="0" cellspacing="0" cellpadding="1">
<tr>
<td style="width:400px;">
<img src="logoItfSmall.jpg" width="125" height="34" alt="itf-logo">
<p style="font-family:'Century Gothic', Arial, Helvetica, sans-serif; font-size:12px; color:#888; font-weight:bold;">Issue No: {{ issue.issue_no }}</p>
<p style="font-family:'Century Gothic', Arial, Helvetica, sans-serif; font-size:12px; color:#888; font-weight:bold;">{{ issue.date|date:"d-M-Y" }}</p>
</td>
<td style="width:200px;">
<img src="logo-erang.jpg" width="151" height="127" alt="erang-logo" align="right">
</td>
</tr>
<tr>
<td style="width:400px;">
<p id="emailerDescription" style="width:430px; background-color:#f7bd00; font-size:12px; font-weight:bold; color:#fff; padding:6px; font-family:'Century Gothic', Arial, Helvetica, sans-serif;">A fortnightly theatre e-journal from the India Theatre Forum<br>Co-Editors: Vikram Iyengar, Joyoti Roy</p>
</td>
<td style="width:200px;">&nbsp;</td>
</tr>
<tr>
<td style="width:400px; font-size:14px; padding-bottom:10px; border-bottom:2px; border-color:#f7bd00; border-bottom-style:solid; font-weight:bold; font-family:'Century Gothic', Arial, Helvetica, sans-serif;"><a href="" style="color:#f7bd00; text-decoration:none; margin-left:20px;">SUBSCRIBE |</a> <a href="" style="color:#f7bd00; text-decoration:none;">FEEDBACK |</a> <a href="" style="color:#f7bd00; text-decoration:none;">BULLETIN BOARD |</a> <a href="" style="color:#f7bd00; text-decoration:none;">LINKS</a></td>
<td style="width:400px; border-bottom:2px; border-color:#f7bd00; border-bottom-style:solid;">
&nbsp;
</td>
</tr>
</table>
<table width="600" border="0" cellspacing="6" cellpadding="1" style="margin-top:6px;">
<tr>
{% for b in bbitems %}
<td style="width:170px; height:130px; background-color:#f7bd00; color:#fff; padding:8px;">
<p style="font-size:16px; text-align:center; text-transform:uppercase; font-family:'Century Gothic', Arial, Helvetica, sans-serif;">{{ b.title }}</p>
<p style="font-size:14px;">{{ b.text|truncate:80 }}</p>
<p><a href="" style="text-align:right; color:#fff; text-decoration:none; font-size:12px;">More &#187;</a></p>
</td>
{% endfor %}
<!--
<td style="width:182px; height:142px; background-color:#f7bd00; color:#fff; padding:8px;">
<p style="font-size:16px; text-align:center; text-transform:uppercase; font-family:'Century Gothic', Arial, Helvetica, sans-serif;">{{ box_title }}</p>
<p style="font-size:14px;">{{ box_text }}</p>
<p><a href="" style="text-align:right; color:#fff; text-decoration:none; font-size:12px;">More &#187;</a></p>
</td>
<td style="width:182px; height:142px; background-color:#f7bd00; color:#fff; padding:8px;">
<p style="font-size:16px; text-align:center; text-transform:uppercase; font-family:'Century Gothic', Arial, Helvetica, sans-serif;">{{ box_title }}</p>
<p style="font-size:14px;">{{ box_text }}</p>
<p><a href="" style="text-align:right; color:#fff; text-decoration:none; font-size:12px;">More &#187;</a></p>
</td>
-->
</tr>
</table>
{% for article in articles %}
<table width="600" border="0" cellspacing="6" cellpadding="1">
<tr>
<td style="width:600px;"><p style="font-size:24px; font-weight:normal; color:#f7bd00; text-transform:uppercase; font-family:'Century Gothic', Arial, Helvetica, sans-serif;">{{ article.title }}</p></td>
</tr>
<tr>
<td style="width:600px;">
<img src="logo-erang.jpg" width="151" height="127" alt="theatre-image" style="display:block; border:1px solid #f7bd00; margin:0 auto;">
<p style="text-align:center; margin-top:10px; margin-bottom:10px; color:#888; font-family:Arial, Helvetica, sans-serif; font-size:14px;">{{ article.subtitle }}</p>
</td>
</tr>
<tr>
<td style="width:600px; color:#888; font-family:Arial, Helvetica, sans-serif; font-size:14px;">{{ article.text|markdown }}</td>
</tr>
</table>
{% endfor %}
<table width="600" border="0" cellspacing="6" cellpadding="1">
<tr>
<td style="width:600px; border-bottom:2px solid #f7bd00; color:#888; font-family:Arial, Helvetica, sans-serif; font-size:12px; text-align:center;">
<p>Contribute your articles to e-Rang and become part of this theatre community! Email us at <a href="" style="color:#0066ff; text-decoration:none;">erang@theatreforum.in</a> to know more about how to contribute..</p>
</td>
</tr>
<tr>
<td style="width:600px; border-bottom:2px solid #f7bd00; color:#888; font-family:Arial, Helvetica, sans-serif; font-size:12px; text-align:center;">
<p>The India Theatre Forum (ITF), a Prithvi Theatre initiative, was formed in 2006 as a loose association of theatre people coming together in the larger interests of theatre. For more on the ITF, please visit <a href="" style="color:#0066ff; text-decoration:none;">www.theatreforum.in</a>. The ITF is currently supported by HIVOS.</p>
</td>
</tr>
<tr>
<td style="width:600px; color:#888; font-family:Arial, Helvetica, sans-serif; font-size:12px; text-align:center;">
<p>If you'd prefer not to receive theatre updates and theatre news, simply click here to <a href="" style="color:#0066ff; text-decoration:none;">unsubscribe.</a></p>
</td>
</tr>
</table>

View File

@ -19,6 +19,7 @@ urlpatterns = patterns('',
(r'^t/$', "frontpage.views.index"), (r'^t/$', "frontpage.views.index"),
(r'm/', include('insidepages.urls')), (r'm/', include('insidepages.urls')),
(r'^contact/$', 'frontpage.views.contact'), (r'^contact/$', 'frontpage.views.contact'),
(r'^emailer/issue/(?P<issue_no>d+)', 'emailer.views.show_emailer'),
# ('m/(?P<module_slug>.*)', 'insidepages.views.main'), # ('m/(?P<module_slug>.*)', 'insidepages.views.main'),
(r'^comments/', include('django.contrib.comments.urls')), (r'^comments/', include('django.contrib.comments.urls')),
(r'^ckeditor/', include('ckeditor.urls')), (r'^ckeditor/', include('ckeditor.urls')),