From oi-commits at pardus.org.tr Thu May 1 00:18:54 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Thu, 1 May 2008 00:18:54 +0300 (EEST) Subject: [Oi-commits] r1315 - in trunk: forum media/css st/templatetags templates/forum Message-ID: <20080430211854.A028713841CE@liste.pardus.org.tr> Author: erenturkay Date: Thu May 1 00:18:54 2008 New Revision: 1315 Added: trunk/forum/postmarkup.py Modified: trunk/forum/views.py trunk/media/css/forum.css trunk/st/templatetags/library.py trunk/templates/forum/reply.html trunk/templates/forum/topic.html Log: fully quation support, as well as bbcode. should be tested carefully for html injection Modified: trunk/forum/views.py ================================================================= --- trunk/forum/views.py (original) +++ trunk/forum/views.py Thu May 1 00:18:54 2008 @@ -208,7 +208,7 @@ post = get_object_or_404(Post, pk=quote_id) if post in topic.post_set.all(): - form = PostForm(auto_id=True, initial={'text': '[quote]%s|%s|%s[/quote]' % (post.author.username, post.created, post.text)}) + form = PostForm(auto_id=True, initial={'text': '[quote %s kullan?c?s?ndan al?nt?...]%s[/quote]' % (request.user.username, post.text)}) # if quote doesn't belong to this topic, just redirect to what user gets :) else: return HttpResponseRedirect(post.get_absolute_url()) Modified: trunk/media/css/forum.css ================================================================= --- trunk/media/css/forum.css (original) +++ trunk/media/css/forum.css Thu May 1 00:18:54 2008 @@ -310,15 +310,16 @@ font-weight: bold; } -.quote { +blockquote { border: 1px solid #CCCCCC; padding: 10px; - margin-bottom: 8px; + width: 90%; + margin-bottom: 2px; background-color: #E1E3FF; color: #51615D; } -.quote p { +blockquote em { padding-left: 12px; font-style: italic; } Modified: trunk/st/templatetags/library.py ================================================================= --- trunk/st/templatetags/library.py (original) +++ trunk/st/templatetags/library.py Thu May 1 00:18:54 2008 @@ -6,6 +6,8 @@ from django.utils.timesince import timesince from oi.settings import MEDIA_ROOT, MEDIA_URL +from oi.forum.postmarkup import render_bbcode + register = Library() @register.filter @@ -27,29 +29,8 @@ return miniature_url @register.filter -def renderquote(context): - def render(text): - if text.find("[quote]") > 0 and text.find("[/quote]") > 0: - first_find = text.find("[quote]") - second_find = text.find("[/quote]") - - # get [quote]user|date|message[/quote] - quote_string = text[first_find:second_find+8] - - # clean it, just gets user|date|message - clean_string = quote_string[7:-8] - - try: - username, date, data = clean_string.split("|") - replace_string = '
%s