[Oi-commits] r1324 - trunk/forum

oi-commits at pardus.org.tr oi-commits at pardus.org.tr
Thu May 1 20:11:12 EEST 2008


Author: erenturkay
Date: Thu May  1 20:11:12 2008
New Revision: 1324

Modified:
   trunk/forum/postmarkup.py
   trunk/forum/views.py
Log:
make postmarkup support **kwargs in each tag to be able to catch options, we will use it for e_mail rendering.

render bbcodes when sending email as well, but we should provide style to display correctly. will fix later

Modified: trunk/forum/postmarkup.py
=================================================================
Suppressed!
	Too long (more than 250 lines) diff output suppressed...
Modified: trunk/forum/views.py
=================================================================
--- trunk/forum/views.py	(original)
+++ trunk/forum/views.py	Thu May  1 20:11:12 2008
@@ -27,6 +27,9 @@
 from oi.st.wrappers import send_mail_with_header
 from oi.settings import FORUM_FROM_EMAIL, FORUM_TO_EMAIL, WEB_URL
 
+# import bbcode renderer for quotation
+from oi.forum.postmarkup import render_bbcode
+
 def main(request):
     lastvisit_control(request)
 
@@ -188,11 +191,29 @@
             else:
                 in_reply_to = topic.get_email_id()
 
+            # sorry, we have to send <style> to be able to display quotation correctly. Hardcode for now and I know, It's really UGLY!
+            # FIXME: Give postmarkup.py's QuoteTag e-mail rendering support
+
+            css = """<style type="text/css">
+.quote {
+    border: 1px solid #CCCCCC;
+    padding: 10px;
+    margin-bottom: 8px;
+    background-color: #E1E3FF;
+    color: #51615D;
+}
+
+.quote p {
+    padding-left: 12px;
+    font-style: italic;
+}
+</style>"""
+
             # send email to everyone who follows this topic.
             watchlists = WatchList.objects.all().filter(topic__id=topic_id)
             for watchlist in watchlists:
                 send_mail_with_header('[Ozgurlukicin-forum] Re: %s' % topic.title,
-                                      '%s<br /><br /><a href="%s">%s</a>' % (form.cleaned_data['text'], post_url, post_url),
+                                      '%s\n%s<br /><br /><a href="%s">%s</a>' % (css, render_bbcode(form.cleaned_data['text']), post_url, post_url),
                                       '%s <%s>' % (request.user.username, FORUM_FROM_EMAIL),
                                       [watchlist.user.email],
                                       headers = {'Message-ID': post.get_email_id(),


More information about the Oi-commits mailing list