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 kullan?c?s?ndan al?nt?. Tarih: %s

%s

' % (username, date, data) - - return text.replace(quote_string, replace_string) - except ValueError: - return text - else: - return text - - return render(context) +def renderbbcode(context): + return render_bbcode(context) @register.inclusion_tag('paginator.html', takes_context=True) def paginator(context, adjacent_pages=2): Modified: trunk/templates/forum/reply.html ================================================================= --- trunk/templates/forum/reply.html (original) +++ trunk/templates/forum/reply.html Thu May 1 00:18:54 2008 @@ -14,7 +14,7 @@ {% for field in form %}
{% if field.help_text %}
{{ field.help_text }}{% endif %}{% if field.errors %}
{{ field.errors }}{% endif %}
-
{{ field }}
+
{{ field|safe }}
{% endfor %} Modified: trunk/templates/forum/topic.html ================================================================= --- trunk/templates/forum/topic.html (original) +++ trunk/templates/forum/topic.html Thu May 1 00:18:54 2008 @@ -83,7 +83,7 @@ {% endif %}
-
{{ post.text|renderquote|safe }}
+
{{ post.text|renderbbcode|safe }}
{% if forloop.first %}
etiket{% for tag in topic.tags.all %}{{tag.name}}{% endfor %} From akin at omeroglu.net Thu May 1 00:22:39 2008 From: akin at omeroglu.net (=?utf-8?q?Ak=C4=B1n_=C3=96mero=C4=9Flu?=) Date: Thu, 1 May 2008 00:22:39 +0300 Subject: [Oi-commits] r1315 - in trunk: forum media/css st/templatetags templates/forum In-Reply-To: <20080430211854.A028713841CE@liste.pardus.org.tr> References: <20080430211854.A028713841CE@liste.pardus.org.tr> Message-ID: <200805010022.40133.akin@omeroglu.net> On Thursday 01 May 2008 00:18:54 oi-commits at pardus.org.tr wrote: > Author: erenturkay > Date: Thu May 1 00:18:54 2008 > New Revision: 1315 + ps3 Bu yukar?daki yaz?y? 10 kere daha yazd?ktan sonra senindir kendisi :D -- -- Ak?n ?mero?lu www.ozgurlukicin.com From oi-commits at pardus.org.tr Thu May 1 10:51:42 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Thu, 1 May 2008 10:51:42 +0300 (EEST) Subject: [Oi-commits] r1316 - trunk/forum Message-ID: <20080501075142.F0BF313841C6@liste.pardus.org.tr> Author: jnmbk Date: Thu May 1 10:51:42 2008 New Revision: 1316 Modified: trunk/forum/views.py Log: removed printf debugging Modified: trunk/forum/views.py ================================================================= --- trunk/forum/views.py (original) +++ trunk/forum/views.py Thu May 1 10:51:42 2008 @@ -182,15 +182,12 @@ # generate post url post_url = WEB_URL + post.get_absolute_url() # generate In-Reply-To header. If we get quote that should be quote's message id - print request.POST if request.POST.has_key('quote_id'): quote = get_object_or_404(Post, id=request.POST['quote_id']) in_reply_to = quote.get_email_id() else: in_reply_to = topic.get_email_id() - print 'In reply to: %s' % in_reply_to - # send email to everyone who follows this topic. watchlists = WatchList.objects.all().filter(topic__id=topic_id) for watchlist in watchlists: From oi-commits at pardus.org.tr Thu May 1 10:52:19 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Thu, 1 May 2008 10:52:19 +0300 (EEST) Subject: [Oi-commits] r1317 - trunk/templates/forum Message-ID: <20080501075219.A33C913841C6@liste.pardus.org.tr> Author: jnmbk Date: Thu May 1 10:52:19 2008 New Revision: 1317 Modified: trunk/templates/forum/topic.html Log: quote button Modified: trunk/templates/forum/topic.html ================================================================= --- trunk/templates/forum/topic.html (original) +++ trunk/templates/forum/topic.html Thu May 1 10:52:19 2008 @@ -38,7 +38,7 @@ {{ post.created|date:"d-m-Y H:i" }}
- Al?nt? + al?nt?la
{% if forloop.first %}
?zle
{% endif %} {% if perms.forum.change_post %} From oi-commits at pardus.org.tr Thu May 1 11:12:13 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Thu, 1 May 2008 11:12:13 +0300 (EEST) Subject: [Oi-commits] r1318 - trunk/forum Message-ID: <20080501081213.9089C13841BC@liste.pardus.org.tr> Author: jnmbk Date: Thu May 1 11:12:12 2008 New Revision: 1318 Modified: trunk/forum/views.py Log: write correct author name Modified: trunk/forum/views.py ================================================================= --- trunk/forum/views.py (original) +++ trunk/forum/views.py Thu May 1 11:12:12 2008 @@ -205,7 +205,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 kullan?c?s?ndan al?nt?...]%s[/quote]' % (request.user.username, post.text)}) + form = PostForm(auto_id=True, initial={'text': '[quote %s kullan?c?s?ndan al?nt?...]%s[/quote]' % (post.author, post.text)}) # if quote doesn't belong to this topic, just redirect to what user gets :) else: return HttpResponseRedirect(post.get_absolute_url()) From oi-commits at pardus.org.tr Thu May 1 11:30:56 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Thu, 1 May 2008 11:30:56 +0300 (EEST) Subject: [Oi-commits] r1319 - trunk/forum Message-ID: <20080501083056.CB64613841CD@liste.pardus.org.tr> Author: jnmbk Date: Thu May 1 11:30:56 2008 New Revision: 1319 Modified: trunk/forum/views.py Log: also show formatted date Modified: trunk/forum/views.py ================================================================= --- trunk/forum/views.py (original) +++ trunk/forum/views.py Thu May 1 11:30:56 2008 @@ -205,7 +205,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 kullan?c?s?ndan al?nt?...]%s[/quote]' % (post.author, post.text)}) + form = PostForm(auto_id=True, initial={'text': '[quote %s, %s tarihinde:]%s[/quote]' % (post.author, post.edited.strftime("%d/%m/%Y %H:%M"), post.text)}) # if quote doesn't belong to this topic, just redirect to what user gets :) else: return HttpResponseRedirect(post.get_absolute_url()) From turkay.eren at gmail.com Thu May 1 15:08:48 2008 From: turkay.eren at gmail.com (Eren =?utf-8?q?T=C3=BCrkay?=) Date: Thu, 1 May 2008 15:08:48 +0300 Subject: [Oi-commits] r1315 - in trunk: forum media/css st/templatetags templates/forum In-Reply-To: <200805010022.40133.akin@omeroglu.net> References: <20080430211854.A028713841CE@liste.pardus.org.tr> <200805010022.40133.akin@omeroglu.net> Message-ID: <200805011508.48793.turkay.eren@gmail.com> On 01 May 2008 Thu 00:22:39 Ak?n ?mero?lu wrote: > Bu yukar?daki yaz?y? 10 kere daha yazd?ktan sonra senindir kendisi :D ?artlar? de?i?tirmi?iz bak?yorum :P From oi-commits at pardus.org.tr Thu May 1 15:23:00 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Thu, 1 May 2008 15:23:00 +0300 (EEST) Subject: [Oi-commits] r1320 - in trunk: forum media/css Message-ID: <20080501122300.5A1F4138420C@liste.pardus.org.tr> Author: erenturkay Date: Thu May 1 15:22:59 2008 New Revision: 1320 Modified: trunk/forum/postmarkup.py trunk/media/css/forum.css Log: more polished quote, use div instead of blockquote Modified: trunk/forum/postmarkup.py ================================================================= --- trunk/forum/postmarkup.py (original) +++ trunk/forum/postmarkup.py Thu May 1 15:22:59 2008 @@ -293,10 +293,10 @@ TagBase.__init__(self, 'quote') def open(self, open_pos): - return u'
%s
'%(self.params) + return u'
%s

'%(self.params) def close(self, close_pos, content): - return u"

" + return u"

" class SearchTag(TagBase): Modified: trunk/media/css/forum.css ================================================================= --- trunk/media/css/forum.css (original) +++ trunk/media/css/forum.css Thu May 1 15:22:59 2008 @@ -310,16 +310,15 @@ font-weight: bold; } -blockquote { +.quote { border: 1px solid #CCCCCC; padding: 10px; - width: 90%; - margin-bottom: 2px; + margin-bottom: 8px; background-color: #E1E3FF; color: #51615D; } -blockquote em { +.quote p { padding-left: 12px; font-style: italic; } From oi-commits at pardus.org.tr Thu May 1 15:26:21 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Thu, 1 May 2008 15:26:21 +0300 (EEST) Subject: [Oi-commits] r1321 - trunk/templates/forum Message-ID: <20080501122621.7C7461384208@liste.pardus.org.tr> Author: erenturkay Date: Thu May 1 15:26:21 2008 New Revision: 1321 Modified: trunk/templates/forum/reply.html Log: well, if we don't control quote_id, after posting normal reply, we get 404 Modified: trunk/templates/forum/reply.html ================================================================= --- trunk/templates/forum/reply.html (original) +++ trunk/templates/forum/reply.html Thu May 1 15:26:21 2008 @@ -10,7 +10,7 @@ {% if user.is_authenticated %} {% if flood %}Flood korumas? aktif, l?tfen {{ timeout }} saniye bekleyin.{% endif %}
- +{% if quote_id %}{% endif %} {% for field in form %}
{% if field.help_text %}
{{ field.help_text }}{% endif %}{% if field.errors %}
{{ field.errors }}{% endif %}
From oi-commits at pardus.org.tr Thu May 1 16:59:07 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Thu, 1 May 2008 16:59:07 +0300 (EEST) Subject: [Oi-commits] r1322 - in trunk: forum media/css media/js/tinymce Message-ID: <20080501135908.1564913841C2@liste.pardus.org.tr> Author: erenturkay Date: Thu May 1 16:59:07 2008 New Revision: 1322 Modified: trunk/forum/views.py trunk/media/css/forum.css trunk/media/js/tinymce/forum.js Log: tinyMCE now doesn't add first

tags and use
which suits for us. Quotation now works better. Modified: trunk/forum/views.py ================================================================= --- trunk/forum/views.py (original) +++ trunk/forum/views.py Thu May 1 16:59:07 2008 @@ -196,7 +196,8 @@ '%s <%s>' % (request.user.username, FORUM_FROM_EMAIL), watchlist.user.email, headers = {'Message-ID': post.get_email_id(), - 'In-Reply-To': in_reply_to} + 'In-Reply-To': in_reply_to}, + fail_silently = True ) return HttpResponseRedirect(post.get_absolute_url()) @@ -287,7 +288,8 @@ '%s

%s' % (post.text, post_url, post_url), '%s <%s>' % (request.user.username, FORUM_FROM_EMAIL), FORUM_TO_EMAIL, - headers = {'Message-ID': topic.get_email_id()} + headers = {'Message-ID': topic.get_email_id()}, + fail_silently = True ) 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 16:59:07 2008 @@ -12,6 +12,11 @@ text-decoration: none; color: #333333; } + +p { + margin: 0px; + padding: 0px; +} /*The colors end here */ /* header */ @@ -186,6 +191,7 @@ } div.post_message_text { min-height: 160px; + padding-bottom: 9px; overflow: auto; } div.post_message_tags { Modified: trunk/media/js/tinymce/forum.js ================================================================= --- trunk/media/js/tinymce/forum.js (original) +++ trunk/media/js/tinymce/forum.js Thu May 1 16:59:07 2008 @@ -10,6 +10,9 @@ browsers : "msie,gecko,opera,safari", dialog_type : "modal", entity_encoding : "raw", + force_br_newlines : true, + force_p_newlines : false, + forced_root_block : false, relative_urls : false, convert_urls : false, width : "630", From oi-commits at pardus.org.tr Thu May 1 18:33:05 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Thu, 1 May 2008 18:33:05 +0300 (EEST) Subject: [Oi-commits] r1323 - trunk/forum Message-ID: <20080501153305.CBF291384205@liste.pardus.org.tr> Author: erenturkay Date: Thu May 1 18:33:05 2008 New Revision: 1323 Modified: trunk/forum/views.py Log: fix mail sending Modified: trunk/forum/views.py ================================================================= --- trunk/forum/views.py (original) +++ trunk/forum/views.py Thu May 1 18:33:05 2008 @@ -194,7 +194,7 @@ send_mail_with_header('[Ozgurlukicin-forum] Re: %s' % topic.title, '%s

%s' % (form.cleaned_data['text'], post_url, post_url), '%s <%s>' % (request.user.username, FORUM_FROM_EMAIL), - watchlist.user.email, + [watchlist.user.email], headers = {'Message-ID': post.get_email_id(), 'In-Reply-To': in_reply_to}, fail_silently = True From oi-commits at pardus.org.tr Thu May 1 20:11:12 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Thu, 1 May 2008 20:11:12 +0300 (EEST) Subject: [Oi-commits] r1324 - trunk/forum Message-ID: <20080501171112.89B30138415B@liste.pardus.org.tr> 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 """ + # 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

%s' % (form.cleaned_data['text'], post_url, post_url), + '%s\n%s

%s' % (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(), From oi-commits at pardus.org.tr Thu May 1 20:19:04 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Thu, 1 May 2008 20:19:04 +0300 (EEST) Subject: [Oi-commits] r1325 - trunk/forum Message-ID: <20080501171904.AE1DE1384172@liste.pardus.org.tr> Author: jnmbk Date: Thu May 1 20:19:04 2008 New Revision: 1325 Modified: trunk/forum/views.py Log: optimized querysets Modified: trunk/forum/views.py ================================================================= --- trunk/forum/views.py (original) +++ trunk/forum/views.py Thu May 1 20:19:04 2008 @@ -165,7 +165,7 @@ forum = get_object_or_404(Forum, slug=forum_slug) topic = get_object_or_404(Topic, pk=topic_id) - posts = topic.post_set.all().order_by('-created')[:POSTS_PER_PAGE] + posts = topic.post_set.order_by('-created')[:POSTS_PER_PAGE] if forum.locked or topic.locked: return HttpResponse("Forum or topic is locked") #FIXME: Give an error message @@ -210,7 +210,7 @@ """ # send email to everyone who follows this topic. - watchlists = WatchList.objects.all().filter(topic__id=topic_id) + watchlists = WatchList.objects.filter(topic__id=topic_id) for watchlist in watchlists: send_mail_with_header('[Ozgurlukicin-forum] Re: %s' % topic.title, '%s\n%s

%s' % (css, render_bbcode(form.cleaned_data['text']), post_url, post_url), From oi-commits at pardus.org.tr Sat May 3 12:35:48 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Sat, 3 May 2008 12:35:48 +0300 (EEST) Subject: [Oi-commits] r1326 - trunk/profile Message-ID: <20080503093548.712AC13841E2@liste.pardus.org.tr> Author: jnmbk Date: Sat May 3 12:35:48 2008 New Revision: 1326 Modified: trunk/profile/forms.py Log: . is not allowed Modified: trunk/profile/forms.py ================================================================= --- trunk/profile/forms.py (original) +++ trunk/profile/forms.py Sat May 3 12:35:48 2008 @@ -39,14 +39,11 @@ def clean_username(self): field_data = self.cleaned_data['username'] - if len(field_data.split(' ')) != 1: - raise forms.ValidationError(u"Kullan?c? ad?nda bo?luk olmamal?d?r") - if len(field_data) < 3: raise forms.ValidationError(u"Kullan?c? ad? en az 3 karakter olmal?d?r") - if not re.match("[a-zA-Z0-9_.]+$", field_data): - raise forms.ValidationError(u"Kullan?c? ad? ge?ersiz. Kullan?c? ad? sadece \"a-z A-Z 0-9 _ .\" alabilir.") + if not re.match("[a-zA-Z0-9_]+$", field_data): + raise forms.ValidationError(u"Kullan?c? ad? ge?ersiz. Kullan?c? ad? sadece \"a-z A-Z 0-9 _\" karakterlerinden olu?abilir") forbidden = ForbiddenUsername.objects.filter(name__iexact=field_data) if len(forbidden) > 0: From oi-commits at pardus.org.tr Sat May 3 13:20:34 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Sat, 3 May 2008 13:20:34 +0300 (EEST) Subject: [Oi-commits] r1327 - trunk/sanat Message-ID: <20080503102034.4812C1384145@liste.pardus.org.tr> Author: jnmbk Date: Sat May 3 13:20:33 2008 New Revision: 1327 Modified: trunk/sanat/forms.py Log: Turkish translation :D Modified: trunk/sanat/forms.py ================================================================= --- trunk/sanat/forms.py (original) +++ trunk/sanat/forms.py Sat May 3 13:20:33 2008 @@ -17,32 +17,32 @@ from django.shortcuts import get_object_or_404 vote_choices=( - (0,u'Berbat'), - (1,u'K?t?'), - (2,u'Orta'), - (3,u'?yi'), - (4,u'G?zel'), - (5,u'S?per'), - ) -class VoteForm(forms.Form): - """ tema vote form validator""" - vote= forms.ChoiceField(label="Oy",required=True,choices=vote_choices) + (0, '0'), + (1, '1'), + (2, '2'), + (3, '3'), + (4, '4'), + (5, '5'), + ) +class VoteForm(forms.Form): + """tema vote form validator""" + vote= forms.ChoiceField(label="Oy", required=True, choices=vote_choices) class ScreenField(forms.Field): - """ That one will validate the screen upload things""" + """That one will validate the screen upload things""" def __init__(self,*args,**kwargs): - """ Calling the upper function""" + """Calling the upper function""" super(ScreenField,self).__init__(*args,**kwargs) def clean(self,value): - """ The validator part""" + """The validator part""" #bos musun ? super(ScreenField,self).clean(value) if self.required and not value: - raise forms.ValidationError(u'Bos birakilamaz') + raise forms.ValidationError(u'Bo? b?rak?lamaz') photo_data=value @@ -53,12 +53,12 @@ main,sub=content_type.split('/') if not (main=='image' and sub in ['jpeg','png','gif']): - raise forms.ValidationError('Sadece JPEG, PNG, GIF') + raise forms.ValidationError('Sadece JPEG, PNG, GIF t?rleri kabul ediliyor') size = len (photo_data['content']) if size > settings.MAX_PHOTO_UPLOAD_SIZE: - raise forms.ValidationError('Resim ?ok b?y?k max %s byte'%(settings.MAX_PHOTO_UPLOAD_SIZE)) + raise forms.ValidationError('Resim boyutu ?ok b?y?k, en fazla %s bayt olabilir'%(settings.MAX_PHOTO_UPLOAD_SIZE)) #get the width and height @@ -66,10 +66,10 @@ #raise forms.ValidationError(_('Buraday?z %s %s'%(width, height))) if width > settings.MAX_PHOTO_WIDTH: - raise forms.ValidationError('Geni?lik ?ok b?y?k max %s byte'%(settings.MAX_PHOTO_WIDTH)) + raise forms.ValidationError('Geni?lik ?ok b?y?k, en fazla %s piksel olabilir'%(settings.MAX_PHOTO_WIDTH)) if height > settings.MAX_PHOTO_WIDTH: - raise forms.ValidationError('Y?kseklik ?ok b?y?k max %s byte'%(settings.MAX_PHOTO_HEIGHT)) + raise forms.ValidationError('Y?kseklik ?ok b?y?k, en fazla %s piksel olabilir'%(settings.MAX_PHOTO_HEIGHT)) return value @@ -86,7 +86,7 @@ super(FileUploadField,self).clean(value) if self.required and not value: - raise forms.ValidationError(u'Bos birakilamaz') + raise forms.ValidationError(u'Bo? b?rak?lamaz') file_data=value @@ -94,7 +94,7 @@ if content_type: if content_type!='application/zip': - msg = 'Simdilik sadece ziplere izin veriyoruz!' + msg = '?imdilik sadece zip t?r?ndeki dosyalara izin veriyoruz!' raise forms.ValidationError(msg) zip = zipfile.ZipFile(StringIO.StringIO(file_data['content'])) @@ -102,18 +102,19 @@ zip.close() del zip if bad_file: - msg = '"%s" Zip icinde hata var galiba' % (bad_file,) + msg = '"%s" s?k??t?r?lm?? dosya bozuk' % (bad_file,) raise forms.ValidationError(msg) return file_data else: - raise forms.ValidationError("Bozuk bir dosya m? upload ediyorsunuz ?") + raise forms.ValidationError("G?nderdi?iniz dosya bozuk olabilir") #The file upload thing class TemaUploadForm(forms.Form): - """ That form class will handle all the stuff about uploading + """ + That form class will handle all the stuff about uploading file uploading in 0.96 is not good change it later maybe in 1.0.... """ @@ -124,20 +125,19 @@ #file upload k?s?mlar? screen=ScreenField(widget=forms.FileInput(),required=True, label="Photo", - help_text="Resim Y?kleyiniz (max %s kilobytes) izin verilenler (jpeg,png,gif)"% (settings.MAX_PHOTO_UPLOAD_SIZE)) + help_text="Y?klenecek resim (en fazla %s kilobayt), izin verilenler (jpeg,png,gif)"% (settings.MAX_PHOTO_UPLOAD_SIZE)) file_up=FileUploadField(widget=forms.FileInput(),required=True, label="Dosya", - help_text="Dosya Y?kleyiniz (max %s kilobytes) izin verilenler (zip simdlik)"% (settings.MAX_FILE_UPLOAD)) + help_text="Y?klenecek dosya (en fazla %s kilobayt), izin verilenler (zip)"% (settings.MAX_FILE_UPLOAD)) def __init__(self,*args,**kwargs): - """ It is for topic tihng they are dinamyc""" - self.base_fields['license'].choices=[(int(l.id), l.name) for l in License.objects.all()] - self.base_fields['parent_category'].choices=[(int(cat.id), cat.cat_name) for cat in Category.objects.all()] + """ Collect licenses and categories""" + self.fields['license'].choices=[(int(l.id), l.name) for l in License.objects.all()] + self.fields['parent_category'].choices=[(int(cat.id), cat.cat_name) for cat in Category.objects.all()] super(TemaUploadForm, self).__init__(*args, **kwargs) - def save(self): """ That part is adding the thning to the system""" From oi-commits at pardus.org.tr Sat May 3 13:23:07 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Sat, 3 May 2008 13:23:07 +0300 (EEST) Subject: [Oi-commits] r1328 - trunk/sanat Message-ID: <20080503102307.7488F1384222@liste.pardus.org.tr> Author: jnmbk Date: Sat May 3 13:23:07 2008 New Revision: 1328 Modified: trunk/sanat/models.py Log: converted tabs to spaces Modified: trunk/sanat/models.py ================================================================= --- trunk/sanat/models.py (original) +++ trunk/sanat/models.py Sat May 3 13:23:07 2008 @@ -17,71 +17,71 @@ class Category(models.Model): - """ The categories of thing that are published they maybe - neseted in each other a tree hieararchy..""" + """ The categories of thing that are published they maybe + neseted in each other a tree hieararchy..""" - #100 is enough for now - cat_name=models.CharField(max_length=100,verbose_name="Kategori ad?",unique=True) - #if they are nested it is needed - slug=models.SlugField(verbose_name="SEF Ba?l?k",prepopulate_from=("cat_name",)) - parent_id=models.IntegerField(verbose_name="Ebeveyn Kategori",default=0) - update=models.DateField(auto_now=True,verbose_name="Yay?n Tarihi") + #100 is enough for now + cat_name=models.CharField(max_length=100,verbose_name="Kategori ad?",unique=True) + #if they are nested it is needed + slug=models.SlugField(verbose_name="SEF Ba?l?k",prepopulate_from=("cat_name",)) + parent_id=models.IntegerField(verbose_name="Ebeveyn Kategori",default=0) + update=models.DateField(auto_now=True,verbose_name="Yay?n Tarihi") - def __str__(self): - return self.cat_name + def __str__(self): + return self.cat_name - def get_absolute_url(self): - return "/tema/kategori/%s/"%(self.slug) + def get_absolute_url(self): + return "/tema/kategori/%s/"%(self.slug) - def get_parent_choice(self): - """Get the current parent category of the model""" - return self.parent_id + def get_parent_choice(self): + """Get the current parent category of the model""" + return self.parent_id - def get_possible_parents(self,cls): - """ To have the choices in admin..""" - temp=[(0,"Kendisi")] + def get_possible_parents(self,cls): + """ To have the choices in admin..""" + temp=[(0,"Kendisi")] - choices=cls.objects.all() + choices=cls.objects.all() - if choices: - for i in choices: - temp.append((i.id,i.cat_name)) + if choices: + for i in choices: + temp.append((i.id,i.cat_name)) - #getting the final value - return tuple(choices) + #getting the final value + return tuple(choices) - #get_possible_parents=staticmethod(get_possible_parents) + #get_possible_parents=staticmethod(get_possible_parents) - class Admin: + class Admin: - list_display = ('cat_name','parent_id','update') + list_display = ('cat_name','parent_id','update') list_filter = ['update'] search_fields = ['cat_name'] ordering=["-id"] - class Meta: - verbose_name="Kategori" - verbose_name_plural="Kategoriler" + class Meta: + verbose_name="Kategori" + verbose_name_plural="Kategoriler" class SanatScreen(models.Model): - "It is modified version because we should change the upload directory ???" + "It is modified version because we should change the upload directory ???" - file=models.FileField(upload_to="upload/sanat/images/",blank=True) + file=models.FileField(upload_to="upload/sanat/images/",blank=True) - class Meta: - verbose_name="Sanat G?r?nt?" - verbose_name_plural="Sanat G?r?nt?" + class Meta: + verbose_name="Sanat G?r?nt?" + verbose_name_plural="Sanat G?r?nt?" - def __str__(self): - return self.file + def __str__(self): + return self.file - class Admin: + class Admin: - pass + pass # when we add or delete a thumb it is needed dispatcher.connect(crt_thumb,signal=signals.post_save, sender=SanatScreen) @@ -94,49 +94,49 @@ #download=models.IntegerField(verbose_name="?ndirilme",default=0) class Admin: - pass + pass def __str__(self): - return self.a_file + return self.a_file class Dosya(models.Model): - """ The catual file that will be downloaded and shown""" + """ The catual file that will be downloaded and shown""" - parent_cat=models.ForeignKey(Category,verbose_name="Kategori") - licence=models.ForeignKey(License,verbose_name="Lisans") - user=models.ForeignKey(User,verbose_name="G?nderen") + parent_cat=models.ForeignKey(Category,verbose_name="Kategori") + licence=models.ForeignKey(License,verbose_name="Lisans") + user=models.ForeignKey(User,verbose_name="G?nderen") + + screens=models.ManyToManyField(SanatScreen,verbose_name="G?r?nt?ler",blank=True) + file_data=models.ManyToManyField(ArsivDosya,verbose_name="??erik Dosyas?",blank=True) + + name=models.CharField(max_length=100,unique=True,verbose_name="Dosya ismi") + description=models.TextField(verbose_name="A??klama") + rate=models.DecimalField(verbose_name="Puan",default=0, max_digits=2, decimal_places=1) + state=models.BooleanField(verbose_name="Yay?nla",default=False) + counter= models.IntegerField(verbose_name="Saya?",default=0) + update=models.DateField(auto_now=True,verbose_name="Yay?n Tarihi") - screens=models.ManyToManyField(SanatScreen,verbose_name="G?r?nt?ler",blank=True) - file_data=models.ManyToManyField(ArsivDosya,verbose_name="??erik Dosyas?",blank=True) + #added later ... + enable_comments = models.BooleanField() - name=models.CharField(max_length=100,unique=True,verbose_name="Dosya ismi") - description=models.TextField(verbose_name="A??klama") - rate=models.DecimalField(verbose_name="Puan",default=0, max_digits=2, decimal_places=1) - state=models.BooleanField(verbose_name="Yay?nla",default=False) - counter= models.IntegerField(verbose_name="Saya?",default=0) - update=models.DateField(auto_now=True,verbose_name="Yay?n Tarihi") - #added later ... - enable_comments = models.BooleanField() - - - def __str__(self): - return self.name + def __str__(self): + return self.name - def get_absolute_url(self): - return "/tema/dosya/%s/"%(self.id) + def get_absolute_url(self): + return "/tema/dosya/%s/"%(self.id) - class Admin: - list_display=('name','rate','state','counter','update','parent_cat') - search_fields=['name','parent_cat'] - list_filter=['update'] - ordering=['-update'] + class Admin: + list_display=('name','rate','state','counter','update','parent_cat') + search_fields=['name','parent_cat'] + list_filter=['update'] + ordering=['-update'] - class Meta: + class Meta: - verbose_name="Sanat Dosya" - verbose_name_plural="Sanat Dosyalar?" + verbose_name="Sanat Dosya" + verbose_name_plural="Sanat Dosyalar?" permissions = ( ("can_upload_tema", "Can upload tema files"), ) @@ -144,10 +144,10 @@ #dont forget to disable it before uploading pff #class DosyaCommentModerator(CommentModerator): -# """ Dosya models class Comment moderation""", -# akismet = False -# email_notification = False -# enable_field = 'enable_comments' +# """ Dosya models class Comment moderation""", +# akismet = False +# email_notification = False +# enable_field = 'enable_comments' #register it #moderator.register(Dosya, DosyaCommentModerator) From oi-commits at pardus.org.tr Sat May 3 13:26:18 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Sat, 3 May 2008 13:26:18 +0300 (EEST) Subject: [Oi-commits] r1329 - in trunk/sanat: . templatetags Message-ID: <20080503102618.EDB771384222@liste.pardus.org.tr> Author: jnmbk Date: Sat May 3 13:26:18 2008 New Revision: 1329 Modified: trunk/sanat/signals.py trunk/sanat/templatetags/thumbman.py trunk/sanat/utils.py trunk/sanat/views.py Log: find sanat/ -name "*.py"|xargs sed -i "s/\t/ /g" In English: converted all tabs to spaces Modified: trunk/sanat/signals.py ================================================================= --- trunk/sanat/signals.py (original) +++ trunk/sanat/signals.py Sat May 3 13:26:18 2008 @@ -8,28 +8,28 @@ from utils import remove_model_thumbnails,make_thumbnail def crt_thumb(sender, instance, signal, *args,**kwargs): - """ create a new thumb for the created url""" + """ create a new thumb for the created url""" - #when it is deleted control if it has a thumbnail? - make_thumbnail(instance.file) + #when it is deleted control if it has a thumbnail? + make_thumbnail(instance.file) def rm_thumb(sender, instance, signal, *args,**kwargs): - """ Delete the ones that we dont need anymore""" + """ Delete the ones that we dont need anymore""" - remove_model_thumbnails(instance) + remove_model_thumbnails(instance) def rmv_files(sender, instance, signal, *args,**kwargs): - """ Delete the files associated with the tema file when it is deleted - we need that one because the relation is manytomany""" + """ Delete the files associated with the tema file when it is deleted + we need that one because the relation is manytomany""" - #may add not to remove the default one ??? + #may add not to remove the default one ??? - #remove the associated screens - for screen in instance.screens.all(): - screen.delete() - - #remove the assciated files - for file in instance.file_data.all(): - file.delete() + #remove the associated screens + for screen in instance.screens.all(): + screen.delete() + + #remove the assciated files + for file in instance.file_data.all(): + file.delete() Modified: trunk/sanat/templatetags/thumbman.py ================================================================= --- trunk/sanat/templatetags/thumbman.py (original) +++ trunk/sanat/templatetags/thumbman.py Sat May 3 13:26:18 2008 @@ -73,9 +73,9 @@ # if ('width' not in kwargs) and ('height' not in kwargs): - kwargs['width']=DEFAULT_WIDTH - kwargs['height']=DEFAULT_HEIGHT - #raise template.TemplateSyntaxError, "thumbnail filter requires arguments (width and/or height)" + kwargs['width']=DEFAULT_WIDTH + kwargs['height']=DEFAULT_HEIGHT + #raise template.TemplateSyntaxError, "thumbnail filter requires arguments (width and/or height)" ret = make_thumbnail(url, **kwargs) if ret is None: Modified: trunk/sanat/utils.py ================================================================= --- trunk/sanat/utils.py (original) +++ trunk/sanat/utils.py Sat May 3 13:26:18 2008 @@ -25,28 +25,28 @@ DEFAULT_WIDTH=100 def _get_thumbnail_path(path, width=DEFAULT_WIDTH, height=DEFAULT_HEIGHT): - """ create thumbnail path from path and required width and/or height. - thumbnail file name is constructed like this: + """ create thumbnail path from path and required width and/or height. + thumbnail file name is constructed like this: _t_[w][_h].""" - basedir = os.path.dirname(path) + '/' - base, ext = os.path.splitext(os.path.basename(path)) + basedir = os.path.dirname(path) + '/' + base, ext = os.path.splitext(os.path.basename(path)) - # make thumbnail filename - th_name = base + '_t' + # make thumbnail filename + th_name = base + '_t' - if (width is not None) and (height is not None): - th_name += '_w%d_h%d' % (width, height) + if (width is not None) and (height is not None): + th_name += '_w%d_h%d' % (width, height) - elif width is not None: - th_name += '%d' % width # for compatibility with admin + elif width is not None: + th_name += '%d' % width # for compatibility with admin - elif height is not None: - th_name += '_h%d' % height + elif height is not None: + th_name += '_h%d' % height - th_name += ext + th_name += ext - return urlparse.urljoin(basedir, th_name) + return urlparse.urljoin(basedir, th_name) # def _get_path_from_url(url, root=MEDIA_ROOT, url_root=MEDIA_URL): @@ -71,37 +71,37 @@ # one of width/height is required #assert (width is not None) or (height is not None) - #if we just want to get a default one - if not width and not height: - place=_get_path_from_url(photo_url) - - if place: - import fnmatch, os - base, ext = os.path.splitext(os.path.basename(place)) - basedir = os.path.dirname(place) - for file in fnmatch.filter(os.listdir(basedir), _THUMBNAIL_GLOB % (base, ext)): - #if it comes here it has a thumbnail - return True - - - else: - return False - - else: - import os - return os.path.isfile(_get_path_from_url(_get_thumbnail_path(photo_url, width, height), root, url_root)) + #if we just want to get a default one + if not width and not height: + place=_get_path_from_url(photo_url) + + if place: + import fnmatch, os + base, ext = os.path.splitext(os.path.basename(place)) + basedir = os.path.dirname(place) + for file in fnmatch.filter(os.listdir(basedir), _THUMBNAIL_GLOB % (base, ext)): + #if it comes here it has a thumbnail + return True + + + else: + return False + + else: + import os + return os.path.isfile(_get_path_from_url(_get_thumbnail_path(photo_url, width, height), root, url_root)) def model_has_thumbnail(model): - """ To see if given model has a thumbnail""" - for obj in model._meta.fields: - if isinstance(obj, FileField): - x=getattr(obj,'file') - if x : - x=_get_url_from_path(x) - return _has_thumbnail(x) + """ To see if given model has a thumbnail""" + for obj in model._meta.fields: + if isinstance(obj, FileField): + x=getattr(obj,'file') + if x : + x=_get_url_from_path(x) + return _has_thumbnail(x) - else: - return False + else: + return False def make_thumbnail(photo_url, width=DEFAULT_HEIGHT, height=DEFAULT_WIDTH, root=MEDIA_ROOT, url_root=MEDIA_URL): @@ -161,28 +161,28 @@ # def _remove_thumbnails(photo_url, root=MEDIA_ROOT, url_root=MEDIA_URL): - if not photo_url: return # empty url - file_name = _get_path_from_url(photo_url, root, url_root) - import fnmatch, os - base, ext = os.path.splitext(os.path.basename(file_name)) - basedir = os.path.dirname(file_name) + if not photo_url: return # empty url + file_name = _get_path_from_url(photo_url, root, url_root) + import fnmatch, os + base, ext = os.path.splitext(os.path.basename(file_name)) + basedir = os.path.dirname(file_name) - for file in fnmatch.filter(os.listdir(basedir), _THUMBNAIL_GLOB % (base, ext)): - - path = os.path.join(basedir, file) - os.remove(path) - image_cache.delete(path) # delete from cache + for file in fnmatch.filter(os.listdir(basedir), _THUMBNAIL_GLOB % (base, ext)): + + path = os.path.join(basedir, file) + os.remove(path) + image_cache.delete(path) # delete from cache def remove_model_thumbnails(model): - """ remove all thumbnails for all ImageFields (and subclasses) in the model """ - for obj in model._meta.fields: - #print obj - if isinstance(obj, FileField): - url = getattr(model,'file') - _remove_thumbnails(url) + """ remove all thumbnails for all ImageFields (and subclasses) in the model """ + for obj in model._meta.fields: + #print obj + if isinstance(obj, FileField): + url = getattr(model,'file') + _remove_thumbnails(url) # # Modified: trunk/sanat/views.py ================================================================= Suppressed! Too long (more than 250 lines) diff output suppressed... From turkay.eren at gmail.com Sat May 3 15:29:12 2008 From: turkay.eren at gmail.com (Eren =?utf-8?q?T=C3=BCrkay?=) Date: Sat, 3 May 2008 15:29:12 +0300 Subject: [Oi-commits] r1326 - trunk/profile In-Reply-To: <20080503093548.712AC13841E2@liste.pardus.org.tr> References: <20080503093548.712AC13841E2@liste.pardus.org.tr> Message-ID: <200805031529.12659.turkay.eren@gmail.com> On 03 May 2008 Sat 12:35:48 oi-commits at pardus.org.tr wrote: > - ? ? ? ?if len(field_data.split(' ')) != 1: > - ? ? ? ? ? ?raise forms.ValidationError(u"Kullan?c? ad?nda bo?luk > olmamal?d?r") - Bu neden ??kt?? Bo?luk olmamas? gerekiyor. From ugur.jnmbk at gmail.com Sat May 3 15:42:26 2008 From: ugur.jnmbk at gmail.com (=?UTF-8?Q?U=C4=9Fur_=C3=87etin?=) Date: Sat, 3 May 2008 15:42:26 +0300 Subject: [Oi-commits] r1326 - trunk/profile In-Reply-To: <200805031529.12659.turkay.eren@gmail.com> References: <20080503093548.712AC13841E2@liste.pardus.org.tr> <200805031529.12659.turkay.eren@gmail.com> Message-ID: <9dca79e40805030542i7809c0d0v53ba2d759f890c8@mail.gmail.com> 2008/5/3 Eren T?rkay : > Bu neden ??kt?? Bo?luk olmamas? gerekiyor. regexp ona da bak?yor... -- U?ur ?etin From oi-commits at pardus.org.tr Sat May 3 17:23:37 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Sat, 3 May 2008 17:23:37 +0300 (EEST) Subject: [Oi-commits] r1330 - trunk/sanat Message-ID: <20080503142337.CBF3F138411C@liste.pardus.org.tr> Author: jnmbk Date: Sat May 3 17:23:37 2008 New Revision: 1330 Modified: trunk/sanat/forms.py trunk/sanat/utils.py Log: small changes and a small fix Modified: trunk/sanat/forms.py ================================================================= --- trunk/sanat/forms.py (original) +++ trunk/sanat/forms.py Sat May 3 17:23:37 2008 @@ -32,10 +32,6 @@ class ScreenField(forms.Field): """That one will validate the screen upload things""" - def __init__(self,*args,**kwargs): - """Calling the upper function""" - super(ScreenField,self).__init__(*args,**kwargs) - def clean(self,value): """The validator part""" #bos musun ? @@ -126,18 +122,15 @@ #file upload k?s?mlar? screen=ScreenField(widget=forms.FileInput(),required=True, label="Photo", help_text="Y?klenecek resim (en fazla %s kilobayt), izin verilenler (jpeg,png,gif)"% (settings.MAX_PHOTO_UPLOAD_SIZE)) - file_up=FileUploadField(widget=forms.FileInput(),required=True, label="Dosya", help_text="Y?klenecek dosya (en fazla %s kilobayt), izin verilenler (zip)"% (settings.MAX_FILE_UPLOAD)) - def __init__(self,*args,**kwargs): """ Collect licenses and categories""" + super(TemaUploadForm, self).__init__(*args, **kwargs) self.fields['license'].choices=[(int(l.id), l.name) for l in License.objects.all()] self.fields['parent_category'].choices=[(int(cat.id), cat.cat_name) for cat in Category.objects.all()] - super(TemaUploadForm, self).__init__(*args, **kwargs) - def save(self): """ That part is adding the thning to the system""" Modified: trunk/sanat/utils.py ================================================================= --- trunk/sanat/utils.py (original) +++ trunk/sanat/utils.py Sat May 3 17:23:37 2008 @@ -1,4 +1,3 @@ - #!/usr/bin/python # -*- coding: utf-8 -*- # @@ -17,7 +16,7 @@ image_cache = get_cache('locmem:///') #is it alot ? -_FILE_CACHE_TIMEOUT = 60 * 60 * 60 * 24 # 1 day +_FILE_CACHE_TIMEOUT = 5184000 # 1 day _THUMBNAIL_GLOB = '%s_t*%s' #some value not important for now @@ -25,9 +24,11 @@ DEFAULT_WIDTH=100 def _get_thumbnail_path(path, width=DEFAULT_WIDTH, height=DEFAULT_HEIGHT): - """ create thumbnail path from path and required width and/or height. + """ + create thumbnail path from path and required width and/or height. thumbnail file name is constructed like this: - _t_[w][_h].""" + _t_[w][_h]. + """ basedir = os.path.dirname(path) + '/' base, ext = os.path.splitext(os.path.basename(path)) @@ -47,7 +48,6 @@ th_name += ext return urlparse.urljoin(basedir, th_name) -# def _get_path_from_url(url, root=MEDIA_ROOT, url_root=MEDIA_URL): """ make filesystem path from url """ @@ -56,7 +56,6 @@ url = url[len(url_root):] # strip media root url return os.path.normpath(os.path.join(root, url)) -# def _get_url_from_path(path, root=MEDIA_ROOT, url_root=MEDIA_URL): """ make url from filesystem path """ @@ -65,7 +64,6 @@ path = path[len(root):] # strip media root return urlparse.urljoin(root, path.replace('\\', '/')) -# def _has_thumbnail(photo_url, width=None, height=None, root=MEDIA_ROOT, url_root=MEDIA_URL): # one of width/height is required @@ -123,7 +121,6 @@ return th_url # make thumbnail - # get original image size orig_w, orig_h = get_image_size(photo_url, root, url_root) if (orig_w is None) and (orig_h) is None: @@ -158,7 +155,6 @@ return photo_url return th_url -# def _remove_thumbnails(photo_url, root=MEDIA_ROOT, url_root=MEDIA_URL): if not photo_url: return # empty url @@ -167,29 +163,24 @@ base, ext = os.path.splitext(os.path.basename(file_name)) basedir = os.path.dirname(file_name) - for file in fnmatch.filter(os.listdir(basedir), _THUMBNAIL_GLOB % (base, ext)): path = os.path.join(basedir, file) os.remove(path) - image_cache.delete(path) # delete from cache - + # delete from cache + image_cache.delete(path) def remove_model_thumbnails(model): - """ remove all thumbnails for all ImageFields (and subclasses) in the model """ for obj in model._meta.fields: #print obj if isinstance(obj, FileField): url = getattr(model,'file') _remove_thumbnails(url) - # -# def _make_admin_thumbnail(url): """ make thumbnails for admin interface """ make_thumbnail(url, width=120) -# def make_admin_thumbnails(model): """ create thumbnails for admin interface for all ImageFields (and subclasses) in the model """ @@ -198,13 +189,11 @@ if isinstance(obj, FileField): url = getattr(model,'file') make_thumbnail(url, width=120) - # -# def _get_thumbnail_url(photo_url, width=DEFAULT_HEIGHT, height=DEFAULT_WIDTH, root=MEDIA_ROOT, url_root=MEDIA_URL): - """ return thumbnail URL for requested photo_url and required width and/or height - - if thumbnail file do not exists returns original URL + """ + return thumbnail URL for requested photo_url and required width and/or height + if thumbnail file do not exists returns original URL """ # one of width/height is required @@ -214,21 +203,21 @@ return _get_thumbnail_path(photo_url, width, height) else: return photo_url -# def _set_cached_file(path, value): - """ Store file dependent data in cache. - Timeout is set to _FILE_CACHE_TIMEOUT (1month). + """ + Store file dependent data in cache. + Timeout is set to _FILE_CACHE_TIMEOUT (1month). """ mtime = os.path.getmtime(path) image_cache.set(path, (mtime, value,), _FILE_CACHE_TIMEOUT) -# def _get_cached_file(path, default=None): - """ Get file content from cache. - If modification time differ return None and delete - data from cache. + """ + Get file content from cache. + If modification time differ return None and delete + data from cache. """ cached = image_cache.get(path, default) @@ -249,9 +238,10 @@ # def get_image_size(photo_url, root=MEDIA_ROOT, url_root=MEDIA_URL): - """ returns image size. + """ + returns image size. - image sizes are cached (using separate locmem:/// cache instance) + image sizes are cached (using separate locmem:/// cache instance) """ path = os.path.join(root, _get_path_from_url(photo_url, root, url_root)) @@ -265,11 +255,8 @@ #import sys #print >>sys.stderr, '[GET IMAGE SIZE] error %s for file %r' % (err, photo_url) return None, None - # if size is not None: _set_cached_file(path, size) else: return None, None - # return size -# From oi-commits at pardus.org.tr Sat May 3 18:58:29 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Sat, 3 May 2008 18:58:29 +0300 (EEST) Subject: [Oi-commits] r1331 - trunk Message-ID: <20080503155829.CCA591384120@liste.pardus.org.tr> Author: erenturkay Date: Sat May 3 18:58:29 2008 New Revision: 1331 Modified: trunk/settings.py Log: we don't need this. I hope, spammers doesn't follow our commit list :P Modified: trunk/settings.py ================================================================= --- trunk/settings.py (original) +++ trunk/settings.py Sat May 3 18:58:29 2008 @@ -27,7 +27,6 @@ # Email DEFAULT_FROM_EMAIL = 'noreply at ozgurlukicin.com' FORUM_FROM_EMAIL = 'forum at ozgurlukicin.com' -FORUM_TO_EMAIL = ['turkay.eren at gmail.com'] # should be array #EMAIL_USE_TLS = True # Pagination From oi-commits at pardus.org.tr Sun May 4 17:25:01 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Sun, 4 May 2008 17:25:01 +0300 (EEST) Subject: [Oi-commits] r1332 - in trunk: forum profile templates/forum templates/user Message-ID: <20080504142501.A59AC1384149@liste.pardus.org.tr> Author: erenturkay Date: Sun May 4 17:25:01 2008 New Revision: 1332 Added: trunk/templates/user/followed_topics.html Modified: trunk/forum/forms.py trunk/forum/urls.py trunk/forum/views.py trunk/profile/models.py trunk/profile/urls.py trunk/profile/views.py trunk/templates/forum/forum_header.html trunk/templates/forum/merge.html trunk/templates/user/profile_edit.html trunk/templates/user/user_list.html Log: * add followed topics delete/add support. * change URLs that's written with _, it's ugly. Modified: trunk/forum/forms.py ================================================================= --- trunk/forum/forms.py (original) +++ trunk/forum/forms.py Sun May 4 17:25:01 2008 @@ -6,7 +6,7 @@ # See the file http://www.gnu.org/copyleft/gpl.txt. from django import newforms as forms -from oi.forum.models import Topic, Forum +from oi.forum.models import Topic, Forum, WatchList from oi.st.models import Tag from oi.st.forms import XssField @@ -20,7 +20,7 @@ tags = forms.MultipleChoiceField(label='Etiket', required=True,help_text="CTRL bas?l? tutarak birden fazla etiket se?ebilirsiniz!(En ?ok 5)") def __init__(self,*args,**kwargs): - """ It is for topic tihng they are dinamyc""" + """ It is for topic thing they are dynamic""" super(TopicForm, self).__init__(*args, **kwargs) self.fields['tags'].choices=[(tag.name, tag.name) for tag in Tag.objects.all()] @@ -51,3 +51,13 @@ """ This is for collecting forums """ super(MoveForm, self).__init__(*args, **kwargs) self.fields['forum2'].choices=[(forum.id, forum.name) for forum in Forum.objects.order_by("name")] + + +# A form that is used in profile page displaying topics that user is following. +class TopicWatchForm(forms.Form): + topic_watch_list = forms.MultipleChoiceField(label="Takip etti?im konular", required=False, help_text="CTRL bas?l? tutarak birden fazla konu se?ebilirsiniz") + + # topic list generator according to user object. + def __init__(self, userObj, *args, **kwargs): + super(TopicWatchForm, self).__init__(*args, **kwargs) + self.fields['topic_watch_list'].choices = [(watch.topic.id, watch.topic.title) for watch in WatchList.objects.filter(user__username=userObj.username)] Modified: trunk/forum/urls.py ================================================================= --- trunk/forum/urls.py (original) +++ trunk/forum/urls.py Sun May 4 17:25:01 2008 @@ -27,8 +27,8 @@ (r'^atom/(?P.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': atom_dict}), #(r'^okunmamis_konular/$', 'oi.forum.views.unread_topics'), - (r'^son_iletiler/$', 'oi.forum.views.latest_posts'), - (r'^tumunu_okunmus_say/$', 'oi.forum.views.mark_all_as_read'), + (r'^son-iletiler/$', 'oi.forum.views.latest_posts'), + (r'^tumunu-okunmus-say/$', 'oi.forum.views.mark_all_as_read'), (r'^(?P.*)/(?P\d+)/delete/(?P\d+)/$','oi.forum.views.delete_post'), (r'^(?P.*)/new/$', 'oi.forum.views.new_topic'), (r'^(?P.*)/(?P\d+)/quote/(?P\d+)/$', 'oi.forum.views.reply'), Modified: trunk/forum/views.py ================================================================= --- trunk/forum/views.py (original) +++ trunk/forum/views.py Sun May 4 17:25:01 2008 @@ -25,7 +25,7 @@ # import our function for sending e-mails and setting from oi.st.wrappers import send_mail_with_header -from oi.settings import FORUM_FROM_EMAIL, FORUM_TO_EMAIL, WEB_URL +from oi.settings import FORUM_FROM_EMAIL, WEB_URL # import bbcode renderer for quotation from oi.forum.postmarkup import render_bbcode Modified: trunk/profile/models.py ================================================================= --- trunk/profile/models.py (original) +++ trunk/profile/models.py Sun May 4 17:25:01 2008 @@ -95,7 +95,7 @@ class Admin: fields = ( - ('?yelik Bilgileri', {'fields': ('user', 'avatar', 'homepage', 'msn', 'city', 'birthday', 'contributes', 'contributes_summary', 'show_email',)}), + ('?yelik Bilgileri', {'fields': ('user', 'avatar', 'homepage', 'msn', 'city', 'birthday', 'contributes', 'contributes_summary', 'show_email', 'latitude', 'longitude',)}), ('Di?er', {'fields': ('activation_key', 'key_expires', 'signature'), 'classes': 'collapse',}), ) Modified: trunk/profile/urls.py ================================================================= --- trunk/profile/urls.py (original) +++ trunk/profile/urls.py Sun May 4 17:25:01 2008 @@ -21,13 +21,14 @@ (r'^liste/$', 'django.views.generic.simple.redirect_to', {'url': "sayfa/1/"}), (r'^liste/sayfa/(?P[0-9]+)/$', 'django.views.generic.list_detail.object_list', dict(user_dict)), #the tested ones + (r'^takip-ettigim-konular/$', 'oi.profile.views.followed_topics'), (r'^giris/$', 'django.contrib.auth.views.login', {'template_name': 'user/login.html'}), (r'^cikis/$', 'django.contrib.auth.views.logout', {'template_name': 'user/logout.html'}), (r'^kayit/$', 'oi.profile.views.user_register'), (r'^onay/(?P[\w-]+)/(?P[\w-]+)/$', 'oi.profile.views.user_confirm'), (r'^duzenle/$', 'oi.profile.views.user_profile_edit'), (r'^sayfam/$', 'oi.profile.views.user_dashboard'), - (r'^parola_degistir/$', 'oi.profile.views.change_password'), + (r'^parola-degistir/$', 'oi.profile.views.change_password'), (r'^kayip/$', 'oi.profile.views.lost_password'), (r'^kayip/degistir/(?P[\w-]+)/$', 'oi.profile.views.reset_password'), #(r'^kullanici/(?P[\w-]+)/yorumlar/$', 'oi.profile.views.user_comments'), Modified: trunk/profile/views.py ================================================================= --- trunk/profile/views.py (original) +++ trunk/profile/views.py Sun May 4 17:25:01 2008 @@ -8,7 +8,7 @@ import sha, datetime, random from os import path -from django.http import HttpResponseRedirect +from django.http import HttpResponseRedirect, HttpResponse from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User @@ -17,6 +17,10 @@ from oi.settings import DEFAULT_FROM_EMAIL, LOGIN_URL, WEB_URL, PROFILE_EDIT_URL +# Form and Model objects for followed topics +from oi.forum.models import WatchList +from oi.forum.forms import TopicWatchForm + from oi.profile.models import Avatar, Profile, LostPassword from oi.profile.forms import RegisterForm, ProfileEditForm, LostPasswordForm, ChangePasswordForm, ResetPasswordForm from oi.profile.settings import googleMapsApiKey @@ -24,6 +28,26 @@ from oi.petition.models import Petitioner @login_required +def followed_topics(request): + print request + if request.method == 'POST': + list = request.POST.getlist('topic_watch_list') + if list: + for id in list: + # control if posted topic id belongs to user + if not WatchList.objects.filter(topic__id=id).filter(user__username=request.user.username): + return HttpResponse('You idiot! Are you trying to hack us?') + else: + WatchList.objects.filter(topic__id=id).filter(user__username=request.user.username).delete() + # FIXME: Shouldn't be hardcoded. + return HttpResponseRedirect('/kullanici/takip-ettigim-konular/') + else: + if len(WatchList.objects.filter(user__username=request.user.username)) == 0: + return render_response(request, 'user/followed_topics.html', {'no_entry': True}) + else: + return render_response(request, 'user/followed_topics.html', {'form': TopicWatchForm(request.user)}) + + at login_required def user_dashboard(request): return render_response(request, 'user/dashboard.html') Modified: trunk/templates/forum/forum_header.html ================================================================= --- trunk/templates/forum/forum_header.html (original) +++ trunk/templates/forum/forum_header.html Sun May 4 17:25:01 2008 @@ -16,7 +16,7 @@ {% else %}

Ho?geldin {{ user.username }}!
- Profil | Son ?letiler | T?m?n? Okunmu? Say | ??k?? + Profil | Son ?letiler | T?m?n? Okunmu? Say | Takip Etti?im Konular | ??k??
{% endif %} Modified: trunk/templates/forum/merge.html ================================================================= --- trunk/templates/forum/merge.html (original) +++ trunk/templates/forum/merge.html Sun May 4 17:25:01 2008 @@ -7,8 +7,8 @@
{{ form.topic2.label_tag }}
{{ form.topic2 }}
- {% if form.topic2.help_text %}
{{ field.topic2.help_text }}
{% endif %} - {% if form.topic2.errors %}
{{ field.topic2.errors }}
{% endif %} + {% if form.topic2.help_text %}
{{ form.topic2.help_text }}
{% endif %} + {% if form.topic2.errors %}
{{ form.topic2.errors }}
{% endif %}
Modified: trunk/templates/user/profile_edit.html ================================================================= --- trunk/templates/user/profile_edit.html (original) +++ trunk/templates/user/profile_edit.html Sun May 4 17:25:01 2008 @@ -86,7 +86,7 @@ {% endfor %}
-
Parolay? De?i?tir
+
Parolay? De?i?tir
{% endblock %} Modified: trunk/templates/user/user_list.html ================================================================= --- trunk/templates/user/user_list.html (original) +++ trunk/templates/user/user_list.html Sun May 4 17:25:01 2008 @@ -19,7 +19,6 @@ {% block content %} - {% for user in user_list %} Name: {{ user.username }}
{% endfor %} From oi-commits at pardus.org.tr Sun May 4 17:34:58 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Sun, 4 May 2008 17:34:58 +0300 (EEST) Subject: [Oi-commits] r1333 - in trunk: forum templates/forum templates/user Message-ID: <20080504143458.AD3201384149@liste.pardus.org.tr> Author: erenturkay Date: Sun May 4 17:34:57 2008 New Revision: 1333 Modified: trunk/forum/forms.py trunk/templates/forum/forum_header.html trunk/templates/user/followed_topics.html Log: change URL, it's better Modified: trunk/forum/forms.py ================================================================= --- trunk/forum/forms.py (original) +++ trunk/forum/forms.py Sun May 4 17:34:57 2008 @@ -55,7 +55,7 @@ # A form that is used in profile page displaying topics that user is following. class TopicWatchForm(forms.Form): - topic_watch_list = forms.MultipleChoiceField(label="Takip etti?im konular", required=False, help_text="CTRL bas?l? tutarak birden fazla konu se?ebilirsiniz") + topic_watch_list = forms.MultipleChoiceField(label="Takip edilen konular", required=False, help_text="CTRL bas?l? tutarak birden fazla konu se?ebilirsiniz") # topic list generator according to user object. def __init__(self, userObj, *args, **kwargs): Modified: trunk/templates/forum/forum_header.html ================================================================= --- trunk/templates/forum/forum_header.html (original) +++ trunk/templates/forum/forum_header.html Sun May 4 17:34:57 2008 @@ -16,7 +16,7 @@ {% else %}
Ho?geldin {{ user.username }}!
- Profil | Son ?letiler | T?m?n? Okunmu? Say | Takip Etti?im Konular | ??k?? + Profil | Son ?letiler | T?m?n? Okunmu? Say | Takip Edilen Konular | ??k??
{% endif %} Modified: trunk/templates/user/followed_topics.html ================================================================= --- trunk/templates/user/followed_topics.html (original) +++ trunk/templates/user/followed_topics.html Sun May 4 17:34:57 2008 @@ -1,6 +1,6 @@ {% extends "base.html" %} -{% block title %}Takip Etti?im Konular - {% endblock %} +{% block title %}Takip Edilen Konular - {% endblock %} {% block header_menu %} {% include "header.html" %} From oi-commits at pardus.org.tr Sun May 4 18:52:59 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Sun, 4 May 2008 18:52:59 +0300 (EEST) Subject: [Oi-commits] r1334 - in trunk: forum profile templates/user Message-ID: <20080504155259.AF434138414E@liste.pardus.org.tr> Author: erenturkay Date: Sun May 4 18:52:59 2008 New Revision: 1334 Modified: trunk/forum/forms.py trunk/profile/urls.py trunk/profile/views.py trunk/templates/user/followed_topics.html Log: keep it stupid simple we don't need additional Form for listing followed topic list. now, followed topics is listed as checkbox, which is the best Modified: trunk/forum/forms.py ================================================================= --- trunk/forum/forms.py (original) +++ trunk/forum/forms.py Sun May 4 18:52:59 2008 @@ -51,13 +51,3 @@ """ This is for collecting forums """ super(MoveForm, self).__init__(*args, **kwargs) self.fields['forum2'].choices=[(forum.id, forum.name) for forum in Forum.objects.order_by("name")] - - -# A form that is used in profile page displaying topics that user is following. -class TopicWatchForm(forms.Form): - topic_watch_list = forms.MultipleChoiceField(label="Takip edilen konular", required=False, help_text="CTRL bas?l? tutarak birden fazla konu se?ebilirsiniz") - - # topic list generator according to user object. - def __init__(self, userObj, *args, **kwargs): - super(TopicWatchForm, self).__init__(*args, **kwargs) - self.fields['topic_watch_list'].choices = [(watch.topic.id, watch.topic.title) for watch in WatchList.objects.filter(user__username=userObj.username)] Modified: trunk/profile/urls.py ================================================================= --- trunk/profile/urls.py (original) +++ trunk/profile/urls.py Sun May 4 18:52:59 2008 @@ -21,7 +21,7 @@ (r'^liste/$', 'django.views.generic.simple.redirect_to', {'url': "sayfa/1/"}), (r'^liste/sayfa/(?P[0-9]+)/$', 'django.views.generic.list_detail.object_list', dict(user_dict)), #the tested ones - (r'^takip-ettigim-konular/$', 'oi.profile.views.followed_topics'), + (r'^takip-edilen-konular/$', 'oi.profile.views.followed_topics'), (r'^giris/$', 'django.contrib.auth.views.login', {'template_name': 'user/login.html'}), (r'^cikis/$', 'django.contrib.auth.views.logout', {'template_name': 'user/logout.html'}), (r'^kayit/$', 'oi.profile.views.user_register'), Modified: trunk/profile/views.py ================================================================= --- trunk/profile/views.py (original) +++ trunk/profile/views.py Sun May 4 18:52:59 2008 @@ -17,9 +17,8 @@ from oi.settings import DEFAULT_FROM_EMAIL, LOGIN_URL, WEB_URL, PROFILE_EDIT_URL -# Form and Model objects for followed topics +# Model object for followed topics from oi.forum.models import WatchList -from oi.forum.forms import TopicWatchForm from oi.profile.models import Avatar, Profile, LostPassword from oi.profile.forms import RegisterForm, ProfileEditForm, LostPasswordForm, ChangePasswordForm, ResetPasswordForm @@ -29,7 +28,6 @@ @login_required def followed_topics(request): - print request if request.method == 'POST': list = request.POST.getlist('topic_watch_list') if list: @@ -40,12 +38,13 @@ else: WatchList.objects.filter(topic__id=id).filter(user__username=request.user.username).delete() # FIXME: Shouldn't be hardcoded. - return HttpResponseRedirect('/kullanici/takip-ettigim-konular/') + return HttpResponseRedirect('/kullanici/takip-edilen-konular/') else: if len(WatchList.objects.filter(user__username=request.user.username)) == 0: return render_response(request, 'user/followed_topics.html', {'no_entry': True}) else: - return render_response(request, 'user/followed_topics.html', {'form': TopicWatchForm(request.user)}) + watch_list = WatchList.objects.filter(user__username=request.user.username) + return render_response(request, 'user/followed_topics.html', {'watch_list': watch_list}) @login_required def user_dashboard(request): Modified: trunk/templates/user/followed_topics.html ================================================================= --- trunk/templates/user/followed_topics.html (original) +++ trunk/templates/user/followed_topics.html Sun May 4 18:52:59 2008 @@ -18,12 +18,10 @@ ?u anda izlemekte oldu?unuz herhangi bir konu bulunmamaktad?r. Foruma d?nmek i?in T?klay?n {% else %}
-
-
{{ form.topic_watch_list.label_tag }}
-
{{ form.topic_watch_list }}
- {% if form.topic_watch_list.help_text %}
{{ form.topic_watch_list.help_text }}
{% endif %} - {% if form.topic_watch_list.errors %}
{{ form.topic_watch_list.errors }}
{% endif %} -
+ Takip edilen konular:

+{% for watch in watch_list %} +   {{ watch.topic.title }}
+{% endfor %}
From oi-commits at pardus.org.tr Sun May 4 18:55:08 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Sun, 4 May 2008 18:55:08 +0300 (EEST) Subject: [Oi-commits] r1335 - trunk/templates/user Message-ID: <20080504155508.9AECE138414E@liste.pardus.org.tr> Author: erenturkay Date: Sun May 4 18:55:08 2008 New Revision: 1335 Modified: trunk/templates/user/followed_topics.html Log: target=_blank Modified: trunk/templates/user/followed_topics.html ================================================================= --- trunk/templates/user/followed_topics.html (original) +++ trunk/templates/user/followed_topics.html Sun May 4 18:55:08 2008 @@ -20,7 +20,7 @@
Takip edilen konular:

{% for watch in watch_list %} -   {{ watch.topic.title }}
+   {{ watch.topic.title }}
{% endfor %}
From oi-commits at pardus.org.tr Tue May 6 12:30:58 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Tue, 6 May 2008 12:30:58 +0300 (EEST) Subject: [Oi-commits] r1336 - trunk/templates/forum Message-ID: <20080506093059.03753138411F@liste.pardus.org.tr> Author: akin Date: Tue May 6 12:30:58 2008 New Revision: 1336 Modified: trunk/templates/forum/post_edit.html trunk/templates/forum/reply.html trunk/templates/forum/topic.html Log: font d?zeltmesi Modified: trunk/templates/forum/post_edit.html ================================================================= --- trunk/templates/forum/post_edit.html (original) +++ trunk/templates/forum/post_edit.html Tue May 6 12:30:58 2008 @@ -28,7 +28,7 @@ {% else %}
- {{ post.author }}{% if post.author.is_staff %}
Forum Y?neticisi{% endif %}


+ {{ post.author }}{% if post.author.is_staff %}
Forum Y?neticisi{% endif %}


avatar
{% if perms.forum.can_see_post_ip %}({{ post.ip }})
{% endif %} Kay?t Tarihi: {{ post.author.date_joined|date:"d-m-Y" }}
Modified: trunk/templates/forum/reply.html ================================================================= --- trunk/templates/forum/reply.html (original) +++ trunk/templates/forum/reply.html Tue May 6 12:30:58 2008 @@ -29,7 +29,7 @@ {% else %}
- {{ post.author }}{% if post.author.is_staff %}
Forum Y?neticisi{% endif %}


+ {{ post.author }}{% if post.author.is_staff %}
Forum Y?neticisi{% endif %}


avatar
{% if perms.forum.can_see_post_ip %}({{ post.ip }})
{% endif %} Kay?t Tarihi: {{ post.author.date_joined|date:"d-m-Y" }}
Modified: trunk/templates/forum/topic.html ================================================================= --- trunk/templates/forum/topic.html (original) +++ trunk/templates/forum/topic.html Tue May 6 12:30:58 2008 @@ -22,7 +22,7 @@
- {{ post.author }}{% if post.author.is_staff %}
Forum Y?neticisi{% endif %}


+ {{ post.author }}{% if post.author.is_staff %}
Forum Y?neticisi{% endif %}


avatar
{% if perms.forum.can_see_post_ip %}({{ post.ip }})
{% endif %} Kay?t Tarihi: {{ post.author.date_joined|date:"d-m-Y" }}
From oi-commits at pardus.org.tr Tue May 6 13:45:58 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Tue, 6 May 2008 13:45:58 +0300 (EEST) Subject: [Oi-commits] r1337 - in trunk: media/upload/sanat media/upload/tema sanat Message-ID: <20080506104558.C182013840C6@liste.pardus.org.tr> Author: jnmbk Date: Tue May 6 13:45:58 2008 New Revision: 1337 Added: trunk/media/upload/tema/ - copied from r1336, trunk/media/upload/sanat/ Removed: trunk/media/upload/sanat/ Modified: trunk/sanat/feeds.py trunk/sanat/models.py Log: sanat->tema Modified: trunk/sanat/feeds.py ================================================================= --- trunk/sanat/feeds.py (original) +++ trunk/sanat/feeds.py Tue May 6 13:45:58 2008 @@ -120,6 +120,3 @@ """ Bu da atom k?sm? olsun """ feed_type = Atom1Feed subtitle = User_Tema_Rss.description - - -############################################################################ Modified: trunk/sanat/models.py ================================================================= --- trunk/sanat/models.py (original) +++ trunk/sanat/models.py Tue May 6 13:45:58 2008 @@ -5,7 +5,6 @@ # Licensed under the GNU General Public License, version 3. # See the file http://www.gnu.org/copyleft/gpl.txt. -#Requires.. from django.db import models from django.contrib.auth.models import User from oi.st.models import License @@ -63,14 +62,10 @@ verbose_name="Kategori" verbose_name_plural="Kategoriler" - - - - class SanatScreen(models.Model): "It is modified version because we should change the upload directory ???" - file=models.FileField(upload_to="upload/sanat/images/",blank=True) + file=models.FileField(upload_to="upload/tema/images/",blank=True) class Meta: verbose_name="Sanat G?r?nt?" @@ -90,7 +85,7 @@ class ArsivDosya(models.Model): """ The data file that includes the archives for templates and etc""" - a_file=models.FileField(upload_to="upload/sanat/dosya/") + a_file=models.FileField(upload_to="upload/tema/dosya/") #download=models.IntegerField(verbose_name="?ndirilme",default=0) class Admin: @@ -119,7 +114,6 @@ #added later ... enable_comments = models.BooleanField() - def __str__(self): return self.name From oi-commits at pardus.org.tr Tue May 6 14:01:13 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Tue, 6 May 2008 14:01:13 +0300 (EEST) Subject: [Oi-commits] r1338 - in trunk: . sanat tema tema/templatetags templates/sanat templates/tema Message-ID: <20080506110113.3F5CD13840E2@liste.pardus.org.tr> Author: jnmbk Date: Tue May 6 14:01:12 2008 New Revision: 1338 Added: trunk/tema/ - copied from r1336, trunk/sanat/ trunk/tema/feeds.py - copied, changed from r1337, trunk/sanat/feeds.py trunk/tema/models.py - copied, changed from r1337, trunk/sanat/models.py trunk/templates/tema/ - copied from r1336, trunk/templates/sanat/ Removed: trunk/sanat/ trunk/templates/sanat/ Modified: trunk/settings.py trunk/tema/forms.py trunk/tema/templatetags/thumbman.py trunk/tema/urls.py trunk/tema/views.py trunk/templates/tema/detail.html trunk/templates/tema/eski_detail.html trunk/templates/tema/main.html trunk/urls.py Log: sanat>tema Modified: trunk/settings.py ================================================================= --- trunk/settings.py (original) +++ trunk/settings.py Tue May 6 14:01:12 2008 @@ -114,7 +114,7 @@ 'oi.seminar', 'oi.profile', 'oi.forum', - 'oi.sanat', + 'oi.tema', 'oi.comments', 'oi.petition', ) Copied: trunk/tema/feeds.py (from r1337, trunk/sanat/feeds.py) ================================================================= --- trunk/sanat/feeds.py (original) +++ trunk/tema/feeds.py Tue May 6 14:01:12 2008 @@ -8,7 +8,7 @@ from django.contrib.syndication.feeds import Feed from django.utils.feedgenerator import Atom1Feed -from oi.sanat.models import Dosya,Category +from oi.tema.models import Dosya,Category from oi.settings import SITE_NAME, WEB_URL, SITE_DESC from django.contrib.syndication.feeds import FeedDoesNotExist @@ -19,8 +19,8 @@ title = SITE_NAME + "Temalar" link = WEB_URL description = SITE_DESC + "Pencere dekorasyonlar?, duvar ka??tlar? ve daha fazlas?." - title_template = 'sanat/feed_title.html' - description_template = 'sanat/feed_description.html' + title_template = 'tema/feed_title.html' + description_template = 'tema/feed_description.html' def items(self): return Dosya.objects.filter(state=True).order_by("-update")[:10] Modified: trunk/tema/forms.py ================================================================= --- trunk/sanat/forms.py (original) +++ trunk/tema/forms.py Tue May 6 14:01:12 2008 @@ -11,8 +11,8 @@ import zipfile from django import newforms as forms -import sanat_settings as settings -from oi.sanat.models import Dosya,SanatScreen,Category,License,ArsivDosya +import tema_settings as settings +from oi.tema.models import Dosya,SanatScreen,Category,License,ArsivDosya import Image from django.shortcuts import get_object_or_404 Copied: trunk/tema/models.py (from r1337, trunk/sanat/models.py) ================================================================= --- trunk/sanat/models.py (original) +++ trunk/tema/models.py Tue May 6 14:01:12 2008 @@ -10,7 +10,7 @@ from oi.st.models import License from django.db.models import signals from django.dispatch import dispatcher -from oi.sanat.signals import rm_thumb,crt_thumb,rmv_files +from oi.tema.signals import rm_thumb,crt_thumb,rmv_files from oi.comments.moderation import CommentModerator, moderator Modified: trunk/tema/templatetags/thumbman.py ================================================================= --- trunk/sanat/templatetags/thumbman.py (original) +++ trunk/tema/templatetags/thumbman.py Tue May 6 14:01:12 2008 @@ -12,7 +12,7 @@ from django import template from django.template import TemplateSyntaxError -from oi.sanat.utils import make_thumbnail, get_image_size +from oi.tema.utils import make_thumbnail, get_image_size register = template.Library() ################################################## ## FILTERS ## Modified: trunk/tema/urls.py ================================================================= --- trunk/sanat/urls.py (original) +++ trunk/tema/urls.py Tue May 6 14:01:12 2008 @@ -1,5 +1,5 @@ from django.conf.urls.defaults import * -from oi.sanat.feeds import * +from oi.tema.feeds import * feed_dict = { 'rss': Tema_RSS, @@ -18,7 +18,7 @@ } -urlpatterns = patterns ('oi.sanat.views', +urlpatterns = patterns ('oi.tema.views', #the first page listing (r'^goster/(?P[a-z]+)/$','list_material'), (r'^kategori/(?P[a-z]+)/$','list_category'), Modified: trunk/tema/views.py ================================================================= --- trunk/sanat/views.py (original) +++ trunk/tema/views.py Tue May 6 14:01:12 2008 @@ -7,14 +7,14 @@ # Create your views here. from django.views.generic.list_detail import object_list -from sanat_settings import HOME_ITEMS -from oi.sanat.models import Dosya,Category +from tema_settings import HOME_ITEMS +from oi.tema.models import Dosya,Category from django.shortcuts import render_to_response,get_object_or_404 from django.contrib.auth.models import User from django.http import HttpResponseRedirect from django.contrib.auth.decorators import login_required -from oi.sanat.forms import VoteForm,TemaUploadForm +from oi.tema.forms import VoteForm,TemaUploadForm from django.core.urlresolvers import reverse try: @@ -46,7 +46,7 @@ 'queryset':sorgu, 'paginate_by':HOME_ITEMS, - 'template_name':'sanat/main.html', + 'template_name':'tema/main.html', } @@ -88,7 +88,7 @@ 'queryset':sorgu, 'paginate_by':HOME_ITEMS, - 'template_name':'sanat/main.html', + 'template_name':'tema/main.html', } @@ -109,7 +109,7 @@ if request.user.is_authenticated(): auth=request.user.username - return render_to_response('sanat/detail.html', {'dosya':dosya,'auth':auth,'form':VoteForm()}) + return render_to_response('tema/detail.html', {'dosya':dosya,'auth':auth,'form':VoteForm()}) def list_user(request,username): @@ -128,7 +128,7 @@ 'queryset':sorgu, 'paginate_by':HOME_ITEMS, - 'template_name':'sanat/main.html', + 'template_name':'tema/main.html', } @@ -156,22 +156,22 @@ #new_data.setlist('parent_category',[int(request.POST['parent_category'].strip())]) form=TemaUploadForm(new_data) - #return render_to_response('sanat/upload.html',{'form':form,'extralar':new_data['parent_category'],'secenek':form.base_fields['parent_category'].choices}) + #return render_to_response('tema/upload.html',{'form':form,'extralar':new_data['parent_category'],'secenek':form.base_fields['parent_category'].choices}) if form.is_valid(): #save all the things form.save() sort_by="son" - #return render_to_response('sanat/upload.html',{'form':form}) - #return HttpResponseRedirect(reverse(viewname="oi.sanat.views.list_category",args=[sort_by])) + #return render_to_response('tema/upload.html',{'form':form}) + #return HttpResponseRedirect(reverse(viewname="oi.tema.views.list_category",args=[sort_by])) return HttpResponseRedirect("/tema/goster/begenilen/") else: form=TemaUploadForm() else: form=TemaUploadForm() - return render_to_response('sanat/upload.html',{'form':form}) + return render_to_response('tema/upload.html',{'form':form}) @@ -207,7 +207,7 @@ if request.session.get(d_id): #it was voted before #should add a new error arg - return render_to_response('sanat/detail.html',{'dosya':dosya,'auth':auth,'form':VoteForm(),'error':u'2 kez oy kullanamzsiniz'}) + return render_to_response('tema/detail.html',{'dosya':dosya,'auth':auth,'form':VoteForm(),'error':u'2 kez oy kullanamzsiniz'}) vf=VoteForm( { 'vote':request.POST['vote'] } ) @@ -231,7 +231,7 @@ - return render_to_response('sanat/detail.html', {'dosya':dosya,'auth':auth,'form':VoteForm()}) + return render_to_response('tema/detail.html', {'dosya':dosya,'auth':auth,'form':VoteForm()}) return render_to_response('404.html') Modified: trunk/templates/tema/detail.html ================================================================= --- trunk/templates/sanat/detail.html (original) +++ trunk/templates/tema/detail.html Tue May 6 14:01:12 2008 @@ -72,7 +72,7 @@
{% if auth %}
- {% comment_form for sanat.dosya dosya.id %} + {% comment_form for tema.dosya dosya.id %}
{% endif %} @@ -83,7 +83,7 @@ - {% get_public_comment_list for sanat.dosya dosya.id as comments %} + {% get_public_comment_list for tema.dosya dosya.id as comments %}


{% if comments %} Modified: trunk/templates/tema/eski_detail.html ================================================================= --- trunk/templates/sanat/eski_detail.html (original) +++ trunk/templates/tema/eski_detail.html Tue May 6 14:01:12 2008 @@ -47,11 +47,11 @@ - {% free_comment_form for sanat.dosya dosya.id %} + {% free_comment_form for tema.dosya dosya.id %} - {% get_free_comment_list for sanat.dosya dosya.id as comment_list %} + {% get_free_comment_list for tema.dosya dosya.id as comment_list %} {% if comment_list %} Modified: trunk/templates/tema/main.html ================================================================= --- trunk/templates/sanat/main.html (original) +++ trunk/templates/tema/main.html Tue May 6 14:01:12 2008 @@ -49,7 +49,7 @@ - + {% endfor %} Modified: trunk/urls.py ================================================================= --- trunk/urls.py (original) +++ trunk/urls.py Tue May 6 14:01:12 2008 @@ -166,7 +166,7 @@ (r'^gezegen/', include('oi.feedjack.urls')), #Tema - (r'^tema/', include('oi.sanat.urls')), + (r'^tema/', include('oi.tema.urls')), #Petition (r'^petition/', include('oi.petition.urls')), From oi-commits at pardus.org.tr Tue May 6 15:44:36 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Tue, 6 May 2008 15:44:36 +0300 (EEST) Subject: [Oi-commits] r1339 - trunk/tema Message-ID: <20080506124436.BBCF713840DD@liste.pardus.org.tr> Author: jnmbk Date: Tue May 6 15:44:36 2008 New Revision: 1339 Added: trunk/tema/settings.py - copied unchanged from r1338, trunk/tema/sanat_settings.py Removed: trunk/tema/sanat_settings.py Modified: trunk/tema/forms.py trunk/tema/views.py Log: sanat_settings>settings Modified: trunk/tema/forms.py ================================================================= --- trunk/tema/forms.py (original) +++ trunk/tema/forms.py Tue May 6 15:44:36 2008 @@ -11,7 +11,7 @@ import zipfile from django import newforms as forms -import tema_settings as settings +import settings from oi.tema.models import Dosya,SanatScreen,Category,License,ArsivDosya import Image from django.shortcuts import get_object_or_404 Modified: trunk/tema/views.py ================================================================= --- trunk/tema/views.py (original) +++ trunk/tema/views.py Tue May 6 15:44:36 2008 @@ -7,7 +7,7 @@ # Create your views here. from django.views.generic.list_detail import object_list -from tema_settings import HOME_ITEMS +from settings import HOME_ITEMS from oi.tema.models import Dosya,Category from django.shortcuts import render_to_response,get_object_or_404 from django.contrib.auth.models import User @@ -21,7 +21,6 @@ import cStringIO as StringIO except ImportError: import StringIO -#the pil thing import Image def list_material(request,sort_by="son"): From oi-commits at pardus.org.tr Tue May 6 17:51:49 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Tue, 6 May 2008 17:51:49 +0300 (EEST) Subject: [Oi-commits] r1340 - in trunk: . forum Message-ID: <20080506145149.E22C613840FF@liste.pardus.org.tr> Author: erenturkay Date: Tue May 6 17:51:49 2008 New Revision: 1340 Modified: trunk/forum/views.py trunk/settings.py Log: send e-mail to list Modified: trunk/forum/views.py ================================================================= --- trunk/forum/views.py (original) +++ trunk/forum/views.py Tue May 6 17:51:49 2008 @@ -25,7 +25,7 @@ # import our function for sending e-mails and setting from oi.st.wrappers import send_mail_with_header -from oi.settings import FORUM_FROM_EMAIL, WEB_URL +from oi.settings import FORUM_FROM_EMAIL, WEB_URL, FORUM_MESSAGE_LIST # import bbcode renderer for quotation from oi.forum.postmarkup import render_bbcode @@ -221,6 +221,16 @@ fail_silently = True ) + # send mailing list also. + send_mail_with_header('Re: %s' % topic.title, + '%s\n%s

%s' % (css, render_bbcode(form.cleaned_data['text']), 'url', 'url'), + '%s <%s>' % (request.user.username, FORUM_FROM_EMAIL), + [FORUM_MESSAGE_LIST], + headers = {'Message-ID': post.get_email_id(), + 'In-Reply-To': in_reply_to}, + fail_silently = True + ) + return HttpResponseRedirect(post.get_absolute_url()) else: if quote_id: @@ -304,11 +314,11 @@ # generate post url post_url = WEB_URL + topic.get_absolute_url() - # send e-mail. We really rock, yeah! - send_mail_with_header('[Ozgurlukicin-forum] %s' % topic.title, - '%s

%s' % (post.text, post_url, post_url), + # send e-mail to mailing list. We really rock, yeah! + send_mail_with_header('%s' % topic.title, + '%s

%s' % (post.text, 'url', 'url'), '%s <%s>' % (request.user.username, FORUM_FROM_EMAIL), - FORUM_TO_EMAIL, + [FORUM_MESSAGE_LIST], headers = {'Message-ID': topic.get_email_id()}, fail_silently = True ) Modified: trunk/settings.py ================================================================= --- trunk/settings.py (original) +++ trunk/settings.py Tue May 6 17:51:49 2008 @@ -27,6 +27,7 @@ # Email DEFAULT_FROM_EMAIL = 'noreply at ozgurlukicin.com' FORUM_FROM_EMAIL = 'forum at ozgurlukicin.com' +FORUM_MESSAGE_LIST = 'forum at liste.ozgurlukicin.com' #EMAIL_USE_TLS = True # Pagination From oi-commits at pardus.org.tr Tue May 6 18:39:24 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Tue, 6 May 2008 18:39:24 +0300 (EEST) Subject: [Oi-commits] r1341 - trunk/templates/forum Message-ID: <20080506153925.00FFD138410F@liste.pardus.org.tr> Author: erenturkay Date: Tue May 6 18:39:24 2008 New Revision: 1341 Modified: trunk/templates/forum/reply.html Log: render bbcode in reply as well Modified: trunk/templates/forum/reply.html ================================================================= --- trunk/templates/forum/reply.html (original) +++ trunk/templates/forum/reply.html Tue May 6 18:39:24 2008 @@ -1,4 +1,5 @@ {% extends "forum/forum_base.html" %} +{% load library %} {% block extrahead %} @@ -45,7 +46,7 @@
-
{{ post.text|safe }}
+
{{ post.text|renderbbcode|safe }}
From oi-commits at pardus.org.tr Tue May 6 18:52:57 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Tue, 6 May 2008 18:52:57 +0300 (EEST) Subject: [Oi-commits] r1342 - trunk/templates/forum Message-ID: <20080506155257.340CC13840FF@liste.pardus.org.tr> Author: jnmbk Date: Tue May 6 18:52:56 2008 New Revision: 1342 Modified: trunk/templates/forum/forum_header.html Log: change order Modified: trunk/templates/forum/forum_header.html ================================================================= --- trunk/templates/forum/forum_header.html (original) +++ trunk/templates/forum/forum_header.html Tue May 6 18:52:56 2008 @@ -16,7 +16,7 @@ {% else %} {% endif %} From oi-commits at pardus.org.tr Tue May 6 19:21:47 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Tue, 6 May 2008 19:21:47 +0300 (EEST) Subject: [Oi-commits] r1343 - in trunk: media/dijital/img/forum templates/forum Message-ID: <20080506162147.D433F13840FF@liste.pardus.org.tr> Author: jnmbk Date: Tue May 6 19:21:47 2008 New Revision: 1343 Added: trunk/media/dijital/img/forum/watch.gif (contents, props changed) Modified: trunk/templates/forum/topic.html Log: watch image Modified: trunk/templates/forum/topic.html ================================================================= --- trunk/templates/forum/topic.html (original) +++ trunk/templates/forum/topic.html Tue May 6 19:21:47 2008 @@ -40,7 +40,11 @@
al?nt?la
- {% if forloop.first %}
?zle
{% endif %} + {% if forloop.first %} +
+ izle +
+ {% endif %} {% if perms.forum.change_post %}
d?zenle From oi-commits at pardus.org.tr Tue May 6 20:01:08 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Tue, 6 May 2008 20:01:08 +0300 (EEST) Subject: [Oi-commits] r1344 - trunk/media/dijital/img/forum Message-ID: <20080506170108.A380213841A5@liste.pardus.org.tr> Author: jnmbk Date: Tue May 6 20:01:08 2008 New Revision: 1344 Modified: trunk/media/dijital/img/forum/watch.gif Log: this is from Mirat Modified: trunk/media/dijital/img/forum/watch.gif ================================================================= Binary files. No diff available. From oi-commits at pardus.org.tr Wed May 7 12:23:11 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Wed, 7 May 2008 12:23:11 +0300 (EEST) Subject: [Oi-commits] r1346 - in trunk: forum media/css templates/forum Message-ID: <20080507092312.2648613841C4@liste.pardus.org.tr> Author: erenturkay Date: Wed May 7 12:23:11 2008 New Revision: 1346 Added: trunk/templates/forum/forum_error.html Modified: trunk/forum/views.py trunk/media/css/forum.css Log: add error page Modified: trunk/forum/views.py ================================================================= --- trunk/forum/views.py (original) +++ trunk/forum/views.py Wed May 7 12:23:11 2008 @@ -153,8 +153,8 @@ # determine if user already added this to prevent double adding. if len(WatchList.objects.filter(topic__id=topic_id).filter(user__username=request.user.username)) > 0: - # FIXME: Give proper error. - return HttpResponse('Sorry, you are already following this topic') + error = 'Bu ba?l??? zaten izlemektesiniz.' + return render_response(request, 'forum/forum_error.html', {'error': error}) else: watchlist = WatchList(topic=topic, user=request.user) watchlist.save() Modified: trunk/media/css/forum.css ================================================================= --- trunk/media/css/forum.css (original) +++ trunk/media/css/forum.css Wed May 7 12:23:11 2008 @@ -40,12 +40,20 @@ margin: 0px auto; width: 900px; } + +#space { + width: 100%; + height: 2px; + background-color: #6A91A6; +} + #content { padding: 0px 0px 20px 0px; float: left; width: 100%; background-color:#FFFFFF; } + .page_title { font-size: 18px; border-bottom: 1px dashed #c0c0c0; @@ -229,6 +237,22 @@ .tag { padding-left: 5px; } + +div.forum_error { + margin-top: 20px; + margin-left: auto; + margin-right: auto; + text-align: center; + padding: 6px;; + background-color: #C84E4A; + border: 1px solid #D1514D; + color: #EDE4E1; + font-weight: bold; + font-size: 14px; + width: 50%; + height: 20px; +} + div.topic_news_area { width: 100%; overflow: hidden; From oi-commits at pardus.org.tr Wed May 7 12:47:11 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Wed, 7 May 2008 12:47:11 +0300 (EEST) Subject: [Oi-commits] r1347 - trunk/media/hackergotchi Message-ID: <20080507094711.7A3F113840F1@liste.pardus.org.tr> Author: akin Date: Wed May 7 12:47:11 2008 New Revision: 1347 Modified: trunk/media/hackergotchi/alpersomuncu.png Log: alper somuncu kellesi de?i?sin Modified: trunk/media/hackergotchi/alpersomuncu.png ================================================================= Binary files. No diff available. From oi-commits at pardus.org.tr Wed May 7 13:12:52 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Wed, 7 May 2008 13:12:52 +0300 (EEST) Subject: [Oi-commits] r1348 - trunk/forum Message-ID: <20080507101252.76921138412F@liste.pardus.org.tr> Author: erenturkay Date: Wed May 7 13:12:51 2008 New Revision: 1348 Modified: trunk/forum/views.py Log: comment out parts sending emails to list for testing :) Modified: trunk/forum/views.py ================================================================= --- trunk/forum/views.py (original) +++ trunk/forum/views.py Wed May 7 13:12:51 2008 @@ -222,14 +222,14 @@ ) # send mailing list also. - send_mail_with_header('Re: %s' % topic.title, - '%s\n%s

%s' % (css, render_bbcode(form.cleaned_data['text']), 'url', 'url'), - '%s <%s>' % (request.user.username, FORUM_FROM_EMAIL), - [FORUM_MESSAGE_LIST], - headers = {'Message-ID': post.get_email_id(), - 'In-Reply-To': in_reply_to}, - fail_silently = True - ) + # send_mail_with_header('Re: %s' % topic.title, + # '%s\n%s

%s' % (css, render_bbcode(form.cleaned_data['text']), post_url, post_url), + # '%s <%s>' % (request.user.username, FORUM_FROM_EMAIL), + # [FORUM_MESSAGE_LIST], + # headers = {'Message-ID': post.get_email_id(), + # 'In-Reply-To': in_reply_to}, + # fail_silently = True + # ) return HttpResponseRedirect(post.get_absolute_url()) else: @@ -315,13 +315,13 @@ post_url = WEB_URL + topic.get_absolute_url() # send e-mail to mailing list. We really rock, yeah! - send_mail_with_header('%s' % topic.title, - '%s

%s' % (post.text, 'url', 'url'), - '%s <%s>' % (request.user.username, FORUM_FROM_EMAIL), - [FORUM_MESSAGE_LIST], - headers = {'Message-ID': topic.get_email_id()}, - fail_silently = True - ) + # send_mail_with_header('%s' % topic.title, + # '%s

%s' % (post.text, post_url, post_url), + # '%s <%s>' % (request.user.username, FORUM_FROM_EMAIL), + # [FORUM_MESSAGE_LIST], + # headers = {'Message-ID': topic.get_email_id()}, + # fail_silently = True + # ) return HttpResponseRedirect(post.get_absolute_url()) else: From oi-commits at pardus.org.tr Wed May 7 13:16:07 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Wed, 7 May 2008 13:16:07 +0300 (EEST) Subject: [Oi-commits] r1349 - in branches/stable: forum media/css media/hackergotchi templates/forum Message-ID: <20080507101607.6D8D3138412F@liste.pardus.org.tr> Author: erenturkay Date: Wed May 7 13:16:07 2008 New Revision: 1349 Added: branches/stable/templates/forum/forum_error.html - copied unchanged from r1348, trunk/templates/forum/forum_error.html Modified: branches/stable/forum/views.py branches/stable/media/css/forum.css branches/stable/media/hackergotchi/alpersomuncu.png Log: merge last changes Modified: branches/stable/forum/views.py ================================================================= --- branches/stable/forum/views.py (original) +++ branches/stable/forum/views.py Wed May 7 13:16:07 2008 @@ -153,8 +153,8 @@ # determine if user already added this to prevent double adding. if len(WatchList.objects.filter(topic__id=topic_id).filter(user__username=request.user.username)) > 0: - # FIXME: Give proper error. - return HttpResponse('Sorry, you are already following this topic') + error = 'Bu ba?l??? zaten izlemektesiniz.' + return render_response(request, 'forum/forum_error.html', {'error': error}) else: watchlist = WatchList(topic=topic, user=request.user) watchlist.save() @@ -222,14 +222,14 @@ ) # send mailing list also. - send_mail_with_header('Re: %s' % topic.title, - '%s\n%s

%s' % (css, render_bbcode(form.cleaned_data['text']), 'url', 'url'), - '%s <%s>' % (request.user.username, FORUM_FROM_EMAIL), - [FORUM_MESSAGE_LIST], - headers = {'Message-ID': post.get_email_id(), - 'In-Reply-To': in_reply_to}, - fail_silently = True - ) + # send_mail_with_header('Re: %s' % topic.title, + # '%s\n%s

%s' % (css, render_bbcode(form.cleaned_data['text']), post_url, post_url), + # '%s <%s>' % (request.user.username, FORUM_FROM_EMAIL), + # [FORUM_MESSAGE_LIST], + # headers = {'Message-ID': post.get_email_id(), + # 'In-Reply-To': in_reply_to}, + # fail_silently = True + # ) return HttpResponseRedirect(post.get_absolute_url()) else: @@ -315,13 +315,13 @@ post_url = WEB_URL + topic.get_absolute_url() # send e-mail to mailing list. We really rock, yeah! - send_mail_with_header('%s' % topic.title, - '%s

%s' % (post.text, 'url', 'url'), - '%s <%s>' % (request.user.username, FORUM_FROM_EMAIL), - [FORUM_MESSAGE_LIST], - headers = {'Message-ID': topic.get_email_id()}, - fail_silently = True - ) + # send_mail_with_header('%s' % topic.title, + # '%s

%s' % (post.text, post_url, post_url), + # '%s <%s>' % (request.user.username, FORUM_FROM_EMAIL), + # [FORUM_MESSAGE_LIST], + # headers = {'Message-ID': topic.get_email_id()}, + # fail_silently = True + # ) return HttpResponseRedirect(post.get_absolute_url()) else: Modified: branches/stable/media/css/forum.css ================================================================= --- branches/stable/media/css/forum.css (original) +++ branches/stable/media/css/forum.css Wed May 7 13:16:07 2008 @@ -40,12 +40,20 @@ margin: 0px auto; width: 900px; } + +#space { + width: 100%; + height: 2px; + background-color: #6A91A6; +} + #content { padding: 0px 0px 20px 0px; float: left; width: 100%; background-color:#FFFFFF; } + .page_title { font-size: 18px; border-bottom: 1px dashed #c0c0c0; @@ -229,6 +237,22 @@ .tag { padding-left: 5px; } + +div.forum_error { + margin-top: 20px; + margin-left: auto; + margin-right: auto; + text-align: center; + padding: 6px;; + background-color: #C84E4A; + border: 1px solid #D1514D; + color: #EDE4E1; + font-weight: bold; + font-size: 14px; + width: 50%; + height: 20px; +} + div.topic_news_area { width: 100%; overflow: hidden; Modified: branches/stable/media/hackergotchi/alpersomuncu.png ================================================================= Binary files. No diff available. From oi-commits at pardus.org.tr Wed May 7 13:25:52 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Wed, 7 May 2008 13:25:52 +0300 (EEST) Subject: [Oi-commits] r1350 - in trunk: forum media/css templates/forum Message-ID: <20080507102552.50A6513840E4@liste.pardus.org.tr> Author: jnmbk Date: Wed May 7 13:25:51 2008 New Revision: 1350 Modified: trunk/forum/views.py trunk/media/css/forum.css trunk/templates/forum/forum_error.html trunk/templates/forum/topic.html Log: smarter watch button Modified: trunk/forum/views.py ================================================================= --- trunk/forum/views.py (original) +++ trunk/forum/views.py Wed May 7 13:25:51 2008 @@ -131,19 +131,25 @@ return HttpResponseRedirect(topic.get_absolute_url()) posts = topic.post_set.all().order_by('created') news_list = News.objects.filter(status=1).order_by('-update')[:3] + watching = False if request.user.is_authenticated(): request.session["read_topic_dict"][topic.id] = datetime.now() request.session["read_forum_dict"][forum.id] = datetime.now() request.session.modified = True + # is the user watching this topic? + if len(request.user.watchlist_set.filter(topic=topic_id)) > 0: + watching = True + topic.views += 1 topic.save() + # we love Django, just 1 line and pagination is ready :) return object_list(request, posts, template_name = 'forum/topic.html', template_object_name = 'post', - extra_context = {'forum': forum, 'topic': topic, 'news_list':news_list}, + extra_context = {'forum': forum, 'topic': topic, 'news_list':news_list, "watching":watching}, paginate_by = POSTS_PER_PAGE, allow_empty = True) Modified: trunk/media/css/forum.css ================================================================= --- trunk/media/css/forum.css (original) +++ trunk/media/css/forum.css Wed May 7 13:25:51 2008 @@ -250,7 +250,10 @@ font-weight: bold; font-size: 14px; width: 50%; - height: 20px; +} + +div.forum_error a { + color: #EDE4E1; } div.topic_news_area { Modified: trunk/templates/forum/forum_error.html ================================================================= --- trunk/templates/forum/forum_error.html (original) +++ trunk/templates/forum/forum_error.html Wed May 7 13:25:51 2008 @@ -4,5 +4,5 @@ {% block content %}
 
-
{{ error }}
+ {% endblock %} Modified: trunk/templates/forum/topic.html ================================================================= --- trunk/templates/forum/topic.html (original) +++ trunk/templates/forum/topic.html Wed May 7 13:25:51 2008 @@ -40,9 +40,9 @@
al?nt?la
- {% if forloop.first %} + {% if request.user.is_authenticated and forloop.first and not watching %}
- izle + izle
{% endif %} {% if perms.forum.change_post %} From oi-commits at pardus.org.tr Wed May 7 13:28:24 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Wed, 7 May 2008 13:28:24 +0300 (EEST) Subject: [Oi-commits] r1351 - branches/stable/forum Message-ID: <20080507102824.ED7A713840E4@liste.pardus.org.tr> Author: erenturkay Date: Wed May 7 13:28:24 2008 New Revision: 1351 Modified: branches/stable/forum/views.py Log: send email to me, yes, I really want it Modified: branches/stable/forum/views.py ================================================================= --- branches/stable/forum/views.py (original) +++ branches/stable/forum/views.py Wed May 7 13:28:24 2008 @@ -221,15 +221,21 @@ fail_silently = True ) - # send mailing list also. - # send_mail_with_header('Re: %s' % topic.title, - # '%s\n%s

%s' % (css, render_bbcode(form.cleaned_data['text']), post_url, post_url), - # '%s <%s>' % (request.user.username, FORUM_FROM_EMAIL), - # [FORUM_MESSAGE_LIST], - # headers = {'Message-ID': post.get_email_id(), - # 'In-Reply-To': in_reply_to}, - # fail_silently = True - # ) + + email_list = [] + # send emails to me, at least I'm the only one who are willing to follow the forum via email :) + for user in User.objects.filter(is_staff=1): + if user.username == 'Eren': + email_list.add(user.email) + + send_mail_with_header('Re: %s' % topic.title, + '%s\n%s

%s' % (css, render_bbcode(form.cleaned_data['text']), post_url, post_url), + '%s <%s>' % (request.user.username, FORUM_FROM_EMAIL), + email_list, + headers = {'Message-ID': post.get_email_id(), + 'In-Reply-To': in_reply_to}, + fail_silently = True + ) return HttpResponseRedirect(post.get_absolute_url()) else: @@ -314,14 +320,19 @@ # generate post url post_url = WEB_URL + topic.get_absolute_url() - # send e-mail to mailing list. We really rock, yeah! - # send_mail_with_header('%s' % topic.title, - # '%s

%s' % (post.text, post_url, post_url), - # '%s <%s>' % (request.user.username, FORUM_FROM_EMAIL), - # [FORUM_MESSAGE_LIST], - # headers = {'Message-ID': topic.get_email_id()}, - # fail_silently = True - # ) + email_list = [] + # send emails to me, at least I'm the only one who are willing to follow the forum via email :) + for user in User.objects.filter(is_staff=1): + if user.username == 'Eren': + email_list.add(user.email) + + send_mail_with_header('[Ozgurlukicin-forum] %s' % topic.title, + '%s

%s' % (post.text, post_url, post_url), + '%s <%s>' % (request.user.username, FORUM_FROM_EMAIL), + email_list, + headers = {'Message-ID': topic.get_email_id()}, + fail_silently = True + ) return HttpResponseRedirect(post.get_absolute_url()) else: From oi-commits at pardus.org.tr Wed May 7 13:34:36 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Wed, 7 May 2008 13:34:36 +0300 (EEST) Subject: [Oi-commits] r1352 - in trunk: . forum Message-ID: <20080507103436.1F3E713840E4@liste.pardus.org.tr> Author: jnmbk Date: Wed May 7 13:34:35 2008 New Revision: 1352 Modified: trunk/forum/models.py trunk/forum/settings.py trunk/forum/views.py trunk/settings.py Log: put settings in right place Modified: trunk/forum/models.py ================================================================= --- trunk/forum/models.py (original) +++ trunk/forum/models.py Wed May 7 13:34:35 2008 @@ -13,7 +13,7 @@ from oi.middleware import threadlocals from oi.st.models import Tag -from oi.settings import FORUM_FROM_EMAIL +from oi.forum.settings import FORUM_FROM_EMAIL import md5 Modified: trunk/forum/settings.py ================================================================= --- trunk/forum/settings.py (original) +++ trunk/forum/settings.py Wed May 7 13:34:35 2008 @@ -5,7 +5,14 @@ # Licensed under the GNU General Public License, version 3. # See the file http://www.gnu.org/copyleft/gpl.txt. +# e-mail +FORUM_FROM_EMAIL = 'forum at ozgurlukicin.com' +FORUM_MESSAGE_LIST = 'forum at liste.ozgurlukicin.com' + +# paginator TOPICS_PER_PAGE = 20 POSTS_PER_PAGE = 15 ALL_POSTS_PER_PAGE = 10 + +# misc FLOOD_TIMEOUT = 10 Modified: trunk/forum/views.py ================================================================= --- trunk/forum/views.py (original) +++ trunk/forum/views.py Wed May 7 13:34:35 2008 @@ -25,7 +25,7 @@ # import our function for sending e-mails and setting from oi.st.wrappers import send_mail_with_header -from oi.settings import FORUM_FROM_EMAIL, WEB_URL, FORUM_MESSAGE_LIST +from oi.settings import WEB_URL # import bbcode renderer for quotation from oi.forum.postmarkup import render_bbcode Modified: trunk/settings.py ================================================================= --- trunk/settings.py (original) +++ trunk/settings.py Wed May 7 13:34:35 2008 @@ -26,8 +26,6 @@ # Email DEFAULT_FROM_EMAIL = 'noreply at ozgurlukicin.com' -FORUM_FROM_EMAIL = 'forum at ozgurlukicin.com' -FORUM_MESSAGE_LIST = 'forum at liste.ozgurlukicin.com' #EMAIL_USE_TLS = True # Pagination From oi-commits at pardus.org.tr Wed May 7 13:58:04 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Wed, 7 May 2008 13:58:04 +0300 (EEST) Subject: [Oi-commits] r1353 - trunk/forum Message-ID: <20080507105804.5EFF1138415A@liste.pardus.org.tr> Author: jnmbk Date: Wed May 7 13:58:03 2008 New Revision: 1353 Modified: trunk/forum/views.py Log: faster Modified: trunk/forum/views.py ================================================================= --- trunk/forum/views.py (original) +++ trunk/forum/views.py Wed May 7 13:58:03 2008 @@ -21,6 +21,7 @@ from oi.forum import customgeneric from django.core.urlresolvers import reverse +from django.core.exceptions import ObjectDoesNotExist from oi.st.models import Tag, News # import our function for sending e-mails and setting @@ -139,8 +140,10 @@ request.session.modified = True # is the user watching this topic? - if len(request.user.watchlist_set.filter(topic=topic_id)) > 0: - watching = True + try: + watching = request.user.watchlist_set.get(topic=topic_id) + except ObjectDoesNotExist: + pass topic.views += 1 topic.save() From oi-commits at pardus.org.tr Wed May 7 14:12:05 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Wed, 7 May 2008 14:12:05 +0300 (EEST) Subject: [Oi-commits] r1354 - trunk/forum Message-ID: <20080507111206.05F5A13841FB@liste.pardus.org.tr> Author: jnmbk Date: Wed May 7 14:12:05 2008 New Revision: 1354 Modified: trunk/forum/views.py Log: faster again Modified: trunk/forum/views.py ================================================================= --- trunk/forum/views.py (original) +++ trunk/forum/views.py Wed May 7 14:12:05 2008 @@ -141,7 +141,8 @@ # is the user watching this topic? try: - watching = request.user.watchlist_set.get(topic=topic_id) + request.user.watchlist_set.get(topic__id=topic_id) + watching = True except ObjectDoesNotExist: pass From oi-commits at pardus.org.tr Wed May 7 14:22:37 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Wed, 7 May 2008 14:22:37 +0300 (EEST) Subject: [Oi-commits] r1355 - trunk/templates/forum Message-ID: <20080507112237.3438C13841FB@liste.pardus.org.tr> Author: jnmbk Date: Wed May 7 14:22:36 2008 New Revision: 1355 Modified: trunk/templates/forum/topic.html Log: mark signature as safe Modified: trunk/templates/forum/topic.html ================================================================= --- trunk/templates/forum/topic.html (original) +++ trunk/templates/forum/topic.html Wed May 7 14:22:36 2008 @@ -98,7 +98,7 @@ Bu ileti {{ post.edit_count }} kez de?i?tirilmi? olup, son kez {{ post.edited|date:"d-m-Y H:i" }} tarihinde {{ post.last_edited_by }} taraf?ndan de?i?tirilmi?tir.
{% endifnotequal %} - {% if post.author.get_profile.signature %}

{{ post.author.get_profile.signature }}
{% endif %} + {% if post.author.get_profile.signature %}

{{ post.author.get_profile.signature|safe }}
{% endif %} From oi-commits at pardus.org.tr Wed May 7 15:32:51 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Wed, 7 May 2008 15:32:51 +0300 (EEST) Subject: [Oi-commits] r1356 - in branches/stable: . forum templates/forum Message-ID: <20080507123251.B13C613840FB@liste.pardus.org.tr> Author: jnmbk Date: Wed May 7 15:32:51 2008 New Revision: 1356 Modified: branches/stable/forum/models.py branches/stable/forum/settings.py branches/stable/forum/views.py branches/stable/settings.py branches/stable/templates/forum/topic.html Log: merge Modified: branches/stable/forum/models.py ================================================================= --- branches/stable/forum/models.py (original) +++ branches/stable/forum/models.py Wed May 7 15:32:51 2008 @@ -13,7 +13,7 @@ from oi.middleware import threadlocals from oi.st.models import Tag -from oi.settings import FORUM_FROM_EMAIL +from oi.forum.settings import FORUM_FROM_EMAIL import md5 Modified: branches/stable/forum/settings.py ================================================================= --- branches/stable/forum/settings.py (original) +++ branches/stable/forum/settings.py Wed May 7 15:32:51 2008 @@ -5,7 +5,14 @@ # Licensed under the GNU General Public License, version 3. # See the file http://www.gnu.org/copyleft/gpl.txt. +# e-mail +FORUM_FROM_EMAIL = 'forum at ozgurlukicin.com' +FORUM_MESSAGE_LIST = 'forum at liste.ozgurlukicin.com' + +# paginator TOPICS_PER_PAGE = 20 POSTS_PER_PAGE = 15 ALL_POSTS_PER_PAGE = 10 + +# misc FLOOD_TIMEOUT = 10 Modified: branches/stable/forum/views.py ================================================================= --- branches/stable/forum/views.py (original) +++ branches/stable/forum/views.py Wed May 7 15:32:51 2008 @@ -21,11 +21,12 @@ from oi.forum import customgeneric from django.core.urlresolvers import reverse +from django.core.exceptions import ObjectDoesNotExist from oi.st.models import Tag, News # import our function for sending e-mails and setting from oi.st.wrappers import send_mail_with_header -from oi.settings import FORUM_FROM_EMAIL, WEB_URL, FORUM_MESSAGE_LIST +from oi.settings import WEB_URL # import bbcode renderer for quotation from oi.forum.postmarkup import render_bbcode @@ -131,19 +132,28 @@ return HttpResponseRedirect(topic.get_absolute_url()) posts = topic.post_set.all().order_by('created') news_list = News.objects.filter(status=1).order_by('-update')[:3] + watching = False if request.user.is_authenticated(): request.session["read_topic_dict"][topic.id] = datetime.now() request.session["read_forum_dict"][forum.id] = datetime.now() request.session.modified = True + # is the user watching this topic? + try: + request.user.watchlist_set.get(topic__id=topic_id) + watching = True + except ObjectDoesNotExist: + pass + topic.views += 1 topic.save() + # we love Django, just 1 line and pagination is ready :) return object_list(request, posts, template_name = 'forum/topic.html', template_object_name = 'post', - extra_context = {'forum': forum, 'topic': topic, 'news_list':news_list}, + extra_context = {'forum': forum, 'topic': topic, 'news_list':news_list, "watching":watching}, paginate_by = POSTS_PER_PAGE, allow_empty = True) @@ -221,21 +231,15 @@ fail_silently = True ) - - email_list = [] - # send emails to me, at least I'm the only one who are willing
{{dosya.licence}} {{dosya.counter}} {{dosya.rate}}{% get_public_comment_count for sanat.dosya dosya.id as comment_count %}{{comment_count}}{% get_public_comment_count for tema.dosya dosya.id as comment_count %}{{comment_count}}