summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2011-02-03 00:14:00 -0500
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2011-02-03 00:14:00 -0500
commitde41a4611acc262a7e593a1275e2d30c21150717 (patch)
tree728fc660b4b97296b267407029bbebe8bdf9c06e
parent666abbe37a2860f8092f7728b44ae1ae44f84719 (diff)
downloadaskbot-de41a4611acc262a7e593a1275e2d30c21150717.tar.gz
askbot-de41a4611acc262a7e593a1275e2d30c21150717.tar.bz2
askbot-de41a4611acc262a7e593a1275e2d30c21150717.zip
added tags to the email update about a new question
-rw-r--r--askbot/models/__init__.py14
-rwxr-xr-xaskbot/skins/default/media/style/style.css4
-rw-r--r--askbot/urls.py6
3 files changed, 21 insertions, 3 deletions
diff --git a/askbot/models/__init__.py b/askbot/models/__init__.py
index 0fbf18a0..09bbcfbe 100644
--- a/askbot/models/__init__.py
+++ b/askbot/models/__init__.py
@@ -1708,6 +1708,20 @@ def format_instant_notification_email(
#todo: remove hardcoded style
else:
content_preview = post.html
+ tag_style = "white-space: nowrap; " \
+ + "font-size: 11px; color: #333;" \
+ + "background-color: #EEE;" \
+ + "border-left: 3px solid #777;" \
+ + "border-top: 1px solid #EEE;" \
+ + "border-bottom: 1px solid #CCC;" \
+ + "border-right: 1px solid #CCC;" \
+ + "padding: 1px 8px 1px 8px;" \
+ + "margin-right:3px;"
+ if post.post_type == 'question':#add tags to the question
+ content_preview += '<div>'
+ for tag_name in post.get_tag_names():
+ content_preview += '<span style="%s">%s</span>' % (tag_style, tag_name)
+ content_preview += '</div>'
update_data = {
'update_author_name': from_user.username,
diff --git a/askbot/skins/default/media/style/style.css b/askbot/skins/default/media/style/style.css
index 9542377f..dc41c897 100755
--- a/askbot/skins/default/media/style/style.css
+++ b/askbot/skins/default/media/style/style.css
@@ -106,6 +106,7 @@ pre {
background-color: #F5F5F5;
padding-left: 5px;
padding-top: 5px;
+ width: 671px;
padding-bottom: 20px ! ie7;
}
@@ -543,6 +544,9 @@ blockquote {
padding: 5px 0 10px 0;
}
+/* tag formatting is also copy-pasted in template
+ askbot/models/__init__.py:format_instant_notification_email()
+*/
.tags {
font-family: sans-serif;
line-height: 170%;
diff --git a/askbot/urls.py b/askbot/urls.py
index 128c8a20..c0891679 100644
--- a/askbot/urls.py
+++ b/askbot/urls.py
@@ -139,19 +139,19 @@ urlpatterns = patterns('',
name='tags'
),
url(#ajax only
- r'^%s%s$' % (_('mark-tag/'),_('interesting/')),
+ r'^%s%s$' % ('mark-tag/', 'interesting/'),
views.commands.mark_tag,
kwargs={'reason':'good','action':'add'},
name='mark_interesting_tag'
),
url(#ajax only
- r'^%s%s$' % (_('mark-tag/'),_('ignored/')),
+ r'^%s%s$' % ('mark-tag/', 'ignored/'),
views.commands.mark_tag,
kwargs={'reason':'bad','action':'add'},
name='mark_ignored_tag'
),
url(#ajax only
- _('unmark-tag/'),
+ 'unmark-tag/',
views.commands.mark_tag,
kwargs={'action':'remove'},
name='unmark_tag'