From dbe7ddb2994c1e4ec186c45cf645c2126b5a0734 Mon Sep 17 00:00:00 2001 From: Sanj Date: Mon, 16 Jan 2012 02:21:31 +0530 Subject: [PATCH] few changes to emailer --- itf/static/js/insidepage.js | 26 +++++++++++++++++++ itf/templates/emailer/email.html | 23 ++++++++-------- .../modules/emailer/emailerissue.html | 17 +++++++++++- 3 files changed, 54 insertions(+), 12 deletions(-) diff --git a/itf/static/js/insidepage.js b/itf/static/js/insidepage.js index 731380e..a38bfc0 100755 --- a/itf/static/js/insidepage.js +++ b/itf/static/js/insidepage.js @@ -524,3 +524,29 @@ jQuery.fn.hasAttr = function(name) { return this.attr(name) !== undefined; }; +//from: http://rosskendall.com/blog/web/javascript-function-to-check-an-email-address-conforms-to-rfc822 + +function isRFC822ValidEmail(sEmail) { + + var sQtext = '[^\\x0d\\x22\\x5c\\x80-\\xff]'; + var sDtext = '[^\\x0d\\x5b-\\x5d\\x80-\\xff]'; + var sAtom = '[^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+'; + var sQuotedPair = '\\x5c[\\x00-\\x7f]'; + var sDomainLiteral = '\\x5b(' + sDtext + '|' + sQuotedPair + ')*\\x5d'; + var sQuotedString = '\\x22(' + sQtext + '|' + sQuotedPair + ')*\\x22'; + var sDomain_ref = sAtom; + var sSubDomain = '(' + sDomain_ref + '|' + sDomainLiteral + ')'; + var sWord = '(' + sAtom + '|' + sQuotedString + ')'; + var sDomain = sSubDomain + '(\\x2e' + sSubDomain + ')*'; + var sLocalPart = sWord + '(\\x2e' + sWord + ')*'; + var sAddrSpec = sLocalPart + '\\x40' + sDomain; // complete RFC822 email address spec + var sValidEmail = '^' + sAddrSpec + '$'; // as whole string + + var reValidEmail = new RegExp(sValidEmail); + + if (reValidEmail.test(sEmail)) { + return true; + } + + return false; +} diff --git a/itf/templates/emailer/email.html b/itf/templates/emailer/email.html index 14b1f75..ac0e845 100755 --- a/itf/templates/emailer/email.html +++ b/itf/templates/emailer/email.html @@ -22,13 +22,13 @@ -

Issue No: {{ issue.issue_no }}    {{ issue.date|date:"d-M-Y" }}

+

Issue No: {{ issue.issue_no }}    {{ issue.date|date:"F j, Y" }}

-

SUBSCRIBE | FEEDBACK

+

SUBSCRIBE | FEEDBACK

@@ -40,15 +40,16 @@

Web Links

- -

Some weblink

-

Some other weblink

+ {% for weblink in weblinks %} +

{{ weblink.title|truncatewords:6 }}

+ {% endfor %}

More »

Bulletin Board

-

Some bb item

-

Some other bb item

+ {% for bbitem in bbitems %} +

{{ bbitem.title|truncatewords:6 }}

+ {% endfor %}

More »

@@ -71,7 +72,7 @@ {% for article in articles %} - +

{{ article.title }}

{{ article.title }}

by: {{ article.author }}

@@ -81,7 +82,7 @@ {% if article.main_image %} - {% thumbnail article.main_image "570" as im %} + {% thumbnail article.main_image "x380" as im %} {% endthumbnail %} {% endif %} @@ -102,7 +103,7 @@

WEB LINKS

{% for weblink in weblinks %} -

{{ weblink.title }}

+

{{ weblink.title }}

{{ weblink.text|markdown }}
{% endfor %} @@ -115,7 +116,7 @@

BULLETIN BOARD

{% for bbitem in bbitems %} -

{{ bbitem.title }}

+

{{ bbitem.title }}

{{ bbitem.text|markdown }}
{% endfor %} diff --git a/itf/templates/modules/emailer/emailerissue.html b/itf/templates/modules/emailer/emailerissue.html index c8048af..2117c5e 100755 --- a/itf/templates/modules/emailer/emailerissue.html +++ b/itf/templates/modules/emailer/emailerissue.html @@ -10,7 +10,7 @@ logo-itf-small
-

Issue No: {{ issue.issue_no }}{{ issue.date|date:"d-M-Y" }}

+

Issue No: {{ issue.issue_no }}{{ issue.date|date:"F j, Y" }}

@@ -159,4 +159,19 @@ association of theatre people coming together in the larger interests of theatre +