This commit is contained in:
Sanj 2012-01-15 02:55:28 +05:30
parent 0e21445e0a
commit dcd59a5e36
2 changed files with 35 additions and 22 deletions

View File

@ -4,12 +4,7 @@ from models import *
def show_emailer(request, issue_no): def show_emailer(request, issue_no):
issue = get_object_or_404(EmailerIssue, issue_no=issue_no) issue = get_object_or_404(EmailerIssue, issue_no=issue_no)
weblinks = Weblink.objects.filter(issue=issue) # weblinks = Weblink.objects.filter(issue=issue)
bbitems = BulletinBoardItem.objects.filter(issue=issue) # bbitems = BulletinBoardItem.objects.filter(issue=issue)
articles = EmailerArticle.objects.filter(issue=issue) # articles = EmailerArticle.objects.filter(issue=issue)
return render_to_response("emailer/email.html", { return render_to_response("emailer/email.html", issue.info_dict())
'issue': issue,
'weblinks': weblinks,
'bbitems': bbitems,
'articles': articles
})

View File

@ -1,5 +1,5 @@
{% load markup %} {% load markup %}
{% load thumbnail %}
<table width="600" border="0" cellspacing="0" cellpadding="0"> <table width="600" border="0" cellspacing="0" cellpadding="0">
<tr> <tr>
@ -28,7 +28,7 @@
<td style="width:290px; padding:0px 0px 0px 10px; font-size:12px; font-family:'Century Gothic', Arial, Helvetica, sans-serif;border-bottom:2px solid #f8c92d; margin-left:8px"> <td style="width:290px; padding:0px 0px 0px 10px; font-size:12px; font-family:'Century Gothic', Arial, Helvetica, sans-serif;border-bottom:2px solid #f8c92d; margin-left:8px">
<p style="text-align:right; margin-bottom:4px;"><a href="" style="color:#ffcc00; text-decoration:none;">SUBSCRIBE |</a> <a href="" style="color:#ffcc00; text-decoration:none;">FEEDBACK </a></p> <p style="text-align:right; margin-bottom:4px;"><a href="{{ issue.get_absolute_url }}" style="color:#ffcc00; text-decoration:none;">SUBSCRIBE |</a> <a href="{{ issue.get_absolute_url }}" style="color:#ffcc00; text-decoration:none;">FEEDBACK </a></p>
</td> </td>
</tr> </tr>
@ -36,20 +36,20 @@
</table> </table>
<table width="600" border="0" cellspacing="12" cellpadding="1"> <table width="600" border="0" cellspacing="12" cellpadding="1">
<tr> <tr style="vertical-align:top;">
<td style="width:250px; height:170px; background-color:#f7bd00; color:#fff; padding:10px;"> <td style="width:250px; background-color:#f7bd00; color:#fff; padding:10px;">
<p style="font-size:16px; text-align:center; text-transform:uppercase; font-family:'Century Gothic', Arial, Helvetica, sans-serif;">Web Links</p> <p style="font-size:16px; text-align:center; text-transform:uppercase; font-family:'Century Gothic', Arial, Helvetica, sans-serif;">Web Links</p>
<p style="font-size:13px; font-family:Arial, Helvetica, sans-serif; padding-left:6px; padding-right:6px;">Some weblink</p> <p style="font-size:13px; font-family:Arial, Helvetica, sans-serif; padding-left:6px; padding-right:6px;">Some weblink</p>
<p style="font-size:13px; font-family:Arial, Helvetica, sans-serif; padding-left:6px; padding-right:6px;">Some other weblink</p> <p style="font-size:13px; font-family:Arial, Helvetica, sans-serif; padding-left:6px; padding-right:6px;">Some other weblink</p>
<p style="text-align:right;"><a href="" style="color:#fff; text-decoration:none; font-size:12px;">More &#187;</a></p> <p style="text-align:right;"><a href="#weblinks" style="color:#fff; text-decoration:none; font-size:12px;">More &#187;</a></p>
</td> </td>
<td style="width:250px; height:170px; background-color:#f7bd00; color:#fff; padding:10px;"> <td style="width:250px; background-color:#f7bd00; color:#fff; padding:10px;">
<p style="font-size:16px; text-align:center; text-transform:uppercase; font-family:'Century Gothic', Arial, Helvetica, sans-serif;">Bulletin Board</p> <p style="font-size:16px; text-align:center; text-transform:uppercase; font-family:'Century Gothic', Arial, Helvetica, sans-serif;">Bulletin Board</p>
<p style="font-size:13px; font-family:Arial, Helvetica, sans-serif; padding-left:6px; padding-right:6px;">Some bb item</p> <p style="font-size:13px; font-family:Arial, Helvetica, sans-serif; padding-left:6px; padding-right:6px;">Some bb item</p>
<p style="font-size:13px; font-family:Arial, Helvetica, sans-serif; padding-left:6px; padding-right:6px;">Some other bb item</p> <p style="font-size:13px; font-family:Arial, Helvetica, sans-serif; padding-left:6px; padding-right:6px;">Some other bb item</p>
<p style="text-align:right;"><a href="" style="color:#fff; text-decoration:none; font-size:12px;">More &#187;</a></p> <p style="text-align:right;"><a href="#bbitems" style="color:#fff; text-decoration:none; font-size:12px;">More &#187;</a></p>
</td> </td>
<!-- <!--
@ -79,29 +79,47 @@
<table> <table>
<tr> <tr>
<td style="width:600px;"> <td style="width:600px;">
<img src="/static/images/emailer/logo-erang.jpg" width="151" height="127" alt="theatre-image" style="display:block; border:1px solid #f7c00c; margin:0 auto;"> {% if article.main_image %}
{% thumbnail article.main_image "570" as im %}
<img style="display:block;margin:0 auto;border:1px solid #f7c00c;" src="{{ im.url }}" />
{% endthumbnail %}
{% endif %}
<!-- <img src="/static/images/emailer/logo-erang.jpg" width="151" height="127" alt="theatre-image" style="display:block; border:1px solid #f7c00c; margin:0 auto;"> -->
<p style="text-align:center; margin-top:10px; margin-bottom:10px; color:#888; font-family:Arial, Helvetica, sans-serif; font-size:12px;">{{ article.subtitle }}</p> <p style="text-align:center; margin-top:10px; margin-bottom:10px; color:#888; font-family:Arial, Helvetica, sans-serif; font-size:12px;">{{ article.subtitle }}</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="width:580px; padding:10px 16px; color:#888; font-family:Arial, Helvetica, sans-serif; font-size:12px;"><p>{{ article.text|markdown }}</p></td> <td style="width:580px; padding:10px 16px; color:#888; font-family:Arial, Helvetica, sans-serif; font-size:12px;">
<p>{{ article.text|markdown }}</p></td>
</tr> </tr>
{% endfor %} {% endfor %}
<tr> <tr>
<td style="width:580px; margin:10px 0 10px 0;"> <td style="width:580px; margin:10px 0 10px 0;">
<p style="padding:8px; margin-left:10px; background-color:#f7bd00; color:#fff; font-size:24px; font-family:'Century Gothic', Arial, Helvetica, sans-serif;">WEB LINKS</p> <p style="padding:8px; margin-left:10px; background-color:#f7bd00; color:#fff; font-size:24px; font-family:'Century Gothic', Arial, Helvetica, sans-serif;"><a name="weblinks"></a>WEB LINKS</p>
<p style="color:#888; font-family:Arial, Helvetica, sans-serif; font-size:12px; padding:8px;">{{ weblinks.text|markdown }}</p> {% for weblink in weblinks %}
<h2 style="padding-left:10px;"><a href="{{weblink.url}}" target="_blank" style="color:#ff8400;text-decoration:none;font-size:16px">{{ weblink.title }}</a></h2>
<div style="color:#888; font-family:Arial, Helvetica, sans-serif; font-size:12px; padding-left: 10px;">{{ weblink.text|markdown }}</div>
{% endfor %}
<!-- <p style="color:#888; font-family:Arial, Helvetica, sans-serif; font-size:12px; padding:8px;">{{ weblinks.text|markdown }}</p> -->
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="width:580px; margin:10px 0 10px 0;"> <td style="width:580px; margin:10px 0 10px 0;">
<p style="padding:8px; margin-left:10px; background-color:#f7bd00; color:#fff; font-size:24px; font-family:'Century Gothic', Arial, Helvetica, sans-serif;">BULLETIN BOARD</p> <p style="padding:8px; margin-left:10px; margin-top: 4px;background-color:#f7bd00; color:#fff; font-size:24px; font-family:'Century Gothic', Arial, Helvetica, sans-serif;"><a name="bbitems"></a>BULLETIN BOARD</p>
<p style="color:#888; font-family:Arial, Helvetica, sans-serif; font-size:12px; padding:8px;">{{ bulletinboard.text|markdown }}</p> {% for bbitem in bbitems %}
<h2 style="font-family:Arial;font-size:16px;padding-left:10px;color:#888;">{{ bbitem.title }}</h2>
<div style="color:#888; font-family:Arial, Helvetica, sans-serif; font-size:12px; padding-left: 10px;">{{ bbitem.text|markdown }}</div>
{% endfor %}
<!-- <p style="color:#888; font-family:Arial, Helvetica, sans-serif; font-size:12px; padding:8px;">{{ bulletinboard.text|markdown }}</p> -->
</td> </td>
</tr> </tr>