From: hernani Date: Thu, 3 Jun 2010 22:38:11 +0000 (+0000) Subject: Adds a couple of settings for email customization. X-Git-Tag: live~763 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/58120aed9b7ba336d9935358f0716e9e0de8b7f0?hp=c020cb3ffd56949b581cd812d5ce445d4daf6e44 Adds a couple of settings for email customization. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@369 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/settings/email.py b/forum/settings/email.py index bf307e6..4efd131 100644 --- a/forum/settings/email.py +++ b/forum/settings/email.py @@ -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 this Wikipedia article for more info."), required=False)) +EMAIL_BORDER_COLOR = Setting('EMAIL_BORDER_COLOR', '#e5ebf8', EMAIL_SET, dict( +label = _("Email Border color"), +help_text = _("The outter border color of the email base template"), +required=False)) + +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( +label = _("Email Paragraph style"), +help_text = _("A valid css string to be used to style email paragraphs (the P tag)."), +required=False)) + +EMAIL_ANCHOR_STYLE = Setting('EMAIL_ANCHOR_STYLE', "text-decoration:none;color:#3060a8;font-weight:bold;", EMAIL_SET, dict( +label = _("Email link style"), +help_text = _("A valid css string to be used to style email links (the A tag)."), +required=False)) + + + EMAIL_DIGEST_CONTROL = Setting('EMAIL_DIGEST_CONTROL', None) diff --git a/forum/skins/default/templates/notifications/answeraccepted.html b/forum/skins/default/templates/notifications/answeraccepted.html index 7170a5d..76927e3 100644 --- a/forum/skins/default/templates/notifications/answeraccepted.html +++ b/forum/skins/default/templates/notifications/answeraccepted.html @@ -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 %}

{% blocktrans %} {{ accepted_by_link }} has just accepted {{ answer_author_link }}'s answer on his question diff --git a/forum/skins/default/templates/notifications/base.html b/forum/skins/default/templates/notifications/base.html index 997904c..05de03f 100644 --- a/forum/skins/default/templates/notifications/base.html +++ b/forum/skins/default/templates/notifications/base.html @@ -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 %} diff --git a/forum/skins/default/templates/notifications/newanswer.html b/forum/skins/default/templates/notifications/newanswer.html index 947de0c..2350185 100644 --- a/forum/skins/default/templates/notifications/newanswer.html +++ b/forum/skins/default/templates/notifications/newanswer.html @@ -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 %}

{% blocktrans %} {{ author_link }} has just posted a new answer on {{ app_name }} to the question diff --git a/forum/skins/default/templates/notifications/newcomment.html b/forum/skins/default/templates/notifications/newcomment.html index 043a24d..fbb9513 100644 --- a/forum/skins/default/templates/notifications/newcomment.html +++ b/forum/skins/default/templates/notifications/newcomment.html @@ -10,16 +10,14 @@ 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 %}

{% blocktrans %}{{ author_link }} has just posted a comment on {% endblocktrans %} {% ifnotequal post question %} diff --git a/forum/skins/default/templates/notifications/newmember.html b/forum/skins/default/templates/notifications/newmember.html index 53c5fd4..67fba1f 100644 --- a/forum/skins/default/templates/notifications/newmember.html +++ b/forum/skins/default/templates/notifications/newmember.html @@ -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 %}

{% blocktrans %} {{ newmember_link }} has just joined {{ app_name }}. You can visit {{ newmember_name }}'s profile using the following link:
diff --git a/forum/skins/default/templates/notifications/newquestion.html b/forum/skins/default/templates/notifications/newquestion.html index e408950..746b6b4 100644 --- a/forum/skins/default/templates/notifications/newquestion.html +++ b/forum/skins/default/templates/notifications/newquestion.html @@ -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 %} -

{% blocktrans %} {{ author_link }} has just posted a new question on {{ app_name }}, entitled