From 32c46c35fc9dbf3305dc774b144ff5af5176c9de Mon Sep 17 00:00:00 2001 From: qw3rty Date: Tue, 27 Apr 2010 14:36:34 +0000 Subject: [PATCH] osqa-89: password field should be type password osqa-107: comment length should be configurable. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@74 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- forum/models/comment.py | 2 +- forum/settings/basic.py | 11 +++++++++-- forum/settings/email.py | 4 +++- forum/skins/default/templates/faq.html | 2 +- forum/templatetags/node_tags.py | 3 ++- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/forum/models/comment.py b/forum/models/comment.py index 15049b2..a2e7425 100644 --- a/forum/models/comment.py +++ b/forum/models/comment.py @@ -32,7 +32,7 @@ class Comment(Node): try: ping_google() except Exception: - logging.debug('problem pinging google did you register you sitemap with google?') + logging.debug('problem pinging google did you register your sitemap with google?') def mark_deleted(self, user): if super(Comment, self).mark_deleted(user): diff --git a/forum/settings/basic.py b/forum/settings/basic.py index cbfdbbd..b712365 100644 --- a/forum/settings/basic.py +++ b/forum/settings/basic.py @@ -54,8 +54,15 @@ The introductory page that is visible in the sidebar for anonymous users. """), widget=Textarea)) -APP_COPYRIGHT = Setting('APP_COPYRIGHT', 'Copyright OSQA, 2009. Some rights reserved under creative commons license.', BASIC_SET, dict( +APP_COPYRIGHT = Setting('APP_COPYRIGHT', 'Copyright OSQA, 2010. Some rights reserved under creative commons license.', BASIC_SET, dict( label = _("Copyright notice"), help_text = _(""" The copyright notice visible at the footer of your page. -"""))) \ No newline at end of file +"""))) + +COMMENT_MAX_LENGTH = Setting('COMMENT_MAX_LENGTH', 300, BASIC_SET, dict( +label = _("Maximum length of comment"), +help_text = _(""" +The maximum length a user can enter for a comment. +"""))) + diff --git a/forum/settings/email.py b/forum/settings/email.py index 71c2e69..7a0725b 100644 --- a/forum/settings/email.py +++ b/forum/settings/email.py @@ -1,5 +1,6 @@ from base import Setting, SettingSet from django.utils.translation import ugettext_lazy as _ +from django.forms.widgets import PasswordInput EMAIL_SET = SettingSet('email', _('Email Settings'), _("Email server and other email related settings."), 50) @@ -29,7 +30,8 @@ label = _("Email Password"), help_text = _(""" The password for your SMTP connection. """), -required=False)) +required=False, +widget=PasswordInput)) EMAIL_USE_TLS = Setting('EMAIL_USE_TLS', False, EMAIL_SET, dict( label = _("Use TLS"), diff --git a/forum/skins/default/templates/faq.html b/forum/skins/default/templates/faq.html index 284e122..0876db4 100644 --- a/forum/skins/default/templates/faq.html +++ b/forum/skins/default/templates/faq.html @@ -14,7 +14,7 @@

{% trans "What kinds of questions can I ask here?" %}

-

{% trans "Most importanly - questions should be relevant to this community." %} +

{% trans "Most importantly - questions should be relevant to this community." %} {% trans "Before asking the question - please make sure to use search to see whether your question has alredy been answered."%}

diff --git a/forum/templatetags/node_tags.py b/forum/templatetags/node_tags.py index 8a6b069..5e772bc 100644 --- a/forum/templatetags/node_tags.py +++ b/forum/templatetags/node_tags.py @@ -4,6 +4,7 @@ from forum.models import Question, FavoriteQuestion from django.utils.translation import ugettext as _ from django.core.urlresolvers import reverse from django import template +from django.conf import settings register = template.Library() @@ -120,7 +121,7 @@ def comments(post, user): 'comments': comments, 'post': post, 'can_comment': user.can_comment(post), - 'max_length': 300, + 'max_length': settings.COMMENT_MAX_LENGTH, 'showing': showing, 'total': len(all_comments), } -- 2.45.1