]> git.openstreetmap.org Git - osqa.git/commitdiff
Adds a couple of settings for email customization.
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Thu, 3 Jun 2010 22:38:11 +0000 (22:38 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Thu, 3 Jun 2010 22:38:11 +0000 (22:38 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@369 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/settings/email.py
forum/skins/default/templates/notifications/answeraccepted.html
forum/skins/default/templates/notifications/base.html
forum/skins/default/templates/notifications/newanswer.html
forum/skins/default/templates/notifications/newcomment.html
forum/skins/default/templates/notifications/newmember.html
forum/skins/default/templates/notifications/newquestion.html

index bf307e6ecde309004b4002620cac2dd80638732b..4efd131384b297784c14a113ba926d608a53dd5e 100644 (file)
@@ -45,4 +45,21 @@ label = _("Email Footer Text"),
 help_text = _("Email footer text, usually \"CAN SPAM\" compliance, or the physical address of the organization running the website. See <a href=\"http://en.wikipedia.org/wiki/CAN-SPAM_Act_of_2003\">this Wikipedia article</a> for more info."),\r
 required=False))\r
 \r
+EMAIL_BORDER_COLOR = Setting('EMAIL_BORDER_COLOR', '#e5ebf8', EMAIL_SET, dict(\r
+label = _("Email Border color"),\r
+help_text = _("The outter border color of the email base template"),\r
+required=False))\r
+\r
+EMAIL_PARAGRAPH_STYLE = Setting('EMAIL_PARAGRAPH_STYLE', "color:#333333;font-family:'helvetica neue', arial, Helvetica, sans-serif;line-height:18px;font-size:14px;margin-top:10px;", EMAIL_SET, dict(\r
+label = _("Email Paragraph style"),\r
+help_text = _("A valid css string to be used to style email paragraphs (the P tag)."),\r
+required=False))\r
+\r
+EMAIL_ANCHOR_STYLE = Setting('EMAIL_ANCHOR_STYLE', "text-decoration:none;color:#3060a8;font-weight:bold;", EMAIL_SET, dict(\r
+label = _("Email link style"),\r
+help_text = _("A valid css string to be used to style email links (the A tag)."),\r
+required=False))\r
+\r
+\r
+\r
 EMAIL_DIGEST_CONTROL = Setting('EMAIL_DIGEST_CONTROL', None)\r
index 7170a5ddcf9a3c2e2d48a89a99066bc6aeff50c0..76927e3c5d803df5ed37a41b7cb962e3001e0fc4 100644 (file)
@@ -7,17 +7,15 @@
     question = answer.question
     question_title = html.mark_safe(question.title)
     accepted_by = answer.nstate.accepted.by.username
+    accepted_by_link = html.objlink(answer.nstate.accepted.by, style=settings.EMAIL_ANCHOR_STYLE)
+    answer_author_link = html.objlink(answer.author, style=settings.EMAIL_ANCHOR_STYLE)
+    question_link = html.objlink(question, style=settings.EMAIL_ANCHOR_STYLE)
 {% enddeclare %}
 
 {% email %}
-    {% subject %}{% blocktrans %}{{ prefix }} New answer to {{ question_title }}{% endblocktrans %}{% endsubject %}
+    {% subject %}{% blocktrans %}{{ prefix }} An answer to {{ question_title }} has been accepted{% endblocktrans %}{% endsubject %}
 
     {% htmlcontent notifications/base.html %}
-        {% declare %}
-            accepted_by_link = html.objlink(answer.nstate.accepted.by, style=a_style)
-            answer_author_link = html.objlink(answer.author, style=a_style)
-            question_link = html.objlink(question, style=a_style)
-        {% enddeclare %}
         <p style="{{ p_style }}">
             {% blocktrans %}
             {{ accepted_by_link }} has just accepted {{ answer_author_link }}'s answer on his question
index 997904ca7dae50eebb47d9014afb6527fcd1a9a5..05de03faad4a980101cd7f5c9c0fde591c93bd47 100644 (file)
@@ -1,11 +1,11 @@
 {% load extra_filters extra_tags i18n email_tags %}
 
 {% declare %}
-    p_style = "color:#333333;font-family:'helvetica neue', arial, Helvetica, sans-serif;line-height:18px;font-size:14px;margin-top:10px;"
-    a_style = "text-decoration:none;color:#3060a8;font-weight:bold;"
+    p_style = settings.EMAIL_PARAGRAPH_STYLE
+    a_style = settings.EMAIL_ANCHOR_STYLE
     hr_style = "color:#ccc;border:0;height:1px;background-color:#ccc;margin-bottom:20px;"
     small_style = "color:#333333;font-family:'Lucida Grande', Trebuchet, Helvetica, sans-serif;font-size:12px;"
-    table_style = "border:20px #e5ebf8 solid;margin:10px auto 10px auto;width:750px;text-align:left;"
+    table_style = "border:20px %s solid;margin:10px auto 10px auto;width:750px;text-align:left;" % settings.EMAIL_BORDER_COLOR
 {% enddeclare %}
 <html>
 <head>
index 947de0ca513dee5c8073b9c2c58a5b73f31abea4..2350185e2a686468a50f4c2dc4991124a75c3632 100644 (file)
@@ -7,16 +7,14 @@
     question = answer.question
     question_title = html.mark_safe(question.title)
     safe_body = html.html2text(answer.html)
+    author_link = html.objlink(answer.author, style=settings.EMAIL_ANCHOR_STYLE)
+    question_link = html.objlink(question, style=settings.EMAIL_ANCHOR_STYLE)
 {% enddeclare %}
 
 {% email %}
     {% subject %}{% blocktrans %}{{ prefix }} New answer to {{ question_title }}{% endblocktrans %}{% endsubject %}
 
     {% htmlcontent notifications/base.html %}
-        {% declare %}
-            author_link = html.objlink(answer.author, style=a_style)
-            question_link = html.objlink(question, style=a_style)
-        {% enddeclare %}
         <p style="{{ p_style }}">
             {% blocktrans %}
             {{ author_link }} has just posted a new answer on {{ app_name }} to the question
index 043a24d9dfffb3237ab6a6b145fe2b89777ade81..fbb95138cfda4427e568d0a84c22b86d1ab6a7c0 100644 (file)
     question_url = question.get_absolute_url()
     question_title = html.mark_safe(question.title)
     safe_body = html.html2text(comment.comment)
+    author_link = html.objlink(comment.author, style=settings.EMAIL_ANCHOR_STYLE)
+    question_link = html.objlink(question, style=settings.EMAIL_ANCHOR_STYLE)
 {% enddeclare %}
 
 {% email %}
     {% subject %}{% blocktrans %}{{ prefix }} New comment on {{ question_title }}{% endblocktrans %}{% endsubject %}
 
     {% htmlcontent notifications/base.html %}
-        {% declare %}
-            author_link = html.objlink(comment.author, style=a_style)
-            question_link = html.objlink(question, style=a_style)
-        {% enddeclare %}
         <p style="{{ p_style }}">
             {% blocktrans %}{{ author_link }} has just posted a comment on {% endblocktrans %}
             {% ifnotequal post question %}
index 53c5fd480821dd1ab187bcd9b701a4f0d865b69b..67fba1ffacc118ae8163e633a5e97812ff1485e9 100644 (file)
@@ -6,15 +6,13 @@
     app_url = settings.APP_URL
     newmember_name = newmember.username
     newmember_url = newmember.get_profile_url()
+    newmember_link = html.objlink(newmember, style=settings.EMAIL_ANCHOR_STYLE)
 {% enddeclare %}
 
 {% email %}
     {% subject %}{% blocktrans %}{{ prefix }}{{ newmember_name }} is a new member on {{ app_name }}{% endblocktrans %}{% endsubject %}
 
     {% htmlcontent notifications/base.html %}
-        {% declare %}
-            newmember_link = html.objlink(newmember, style=a_style)
-        {% enddeclare %}
         <p style="{{ p_style }}">
             {% blocktrans %}
             {{ newmember_link }} has just joined {{ app_name }}. You can visit {{ newmember_name }}'s profile using the following link: <br />
index e408950cc6d78294d96855678fc785dc11dcb142..746b6b41d89fe5a1c9b66edd75ededc61d77235e 100644 (file)
@@ -8,18 +8,15 @@
     question_title = question.title
     question_tags = question.tagnames
     safe_body = html.html2text(question.html)
+    author_link = html.objlink(question.author, style=settings.EMAIL_ANCHOR_STYLE)
+    question_link = html.objlink(question, style=settings.EMAIL_ANCHOR_STYLE)
+    tag_links = html.mark_safe(" ".join([html.objlink(t, style=settings.EMAIL_ANCHOR_STYLE) for t in question.tags.all()]))
 {% enddeclare %}
 
 {% email %}
     {% subject %}{% blocktrans %}{{ prefix }} New question on {{ app_name }}{% endblocktrans %}{% endsubject %}
 
     {% htmlcontent notifications/base.html %}
-        {% declare %}
-            author_link = html.objlink(question.author, style=a_style)
-            question_link = html.objlink(question, style=a_style)
-            tag_links = html.mark_safe(" ".join([html.objlink(t, style=a_style) for t in question.tags.all()]))
-        {% enddeclare %}
-
         <p style="{{ p_style }}">
             {% blocktrans %}
             {{ author_link }} has just posted a new question on {{ app_name }}, entitled