summaryrefslogtreecommitdiffstats
path: root/askbot/forms.py
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-08-08 10:42:33 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-08-08 10:42:33 -0400
commitd99ca01f495a76ef0d7d98f0f690676cc7e2995f (patch)
tree8d1619f79ef01b3b63783d68c19c99fde9bf4fa2 /askbot/forms.py
parent4b543178037de42717690b11fdf9fbb7f88d1510 (diff)
downloadaskbot-d99ca01f495a76ef0d7d98f0f690676cc7e2995f.tar.gz
askbot-d99ca01f495a76ef0d7d98f0f690676cc7e2995f.tar.bz2
askbot-d99ca01f495a76ef0d7d98f0f690676cc7e2995f.zip
merged Adolfo's widget work as a patch
Diffstat (limited to 'askbot/forms.py')
-rw-r--r--askbot/forms.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/askbot/forms.py b/askbot/forms.py
index 978cdf0b..7906a5e0 100644
--- a/askbot/forms.py
+++ b/askbot/forms.py
@@ -888,6 +888,24 @@ ASK_BY_EMAIL_SUBJECT_HELP = _(
'[tag1, tag2, tag3,...] question title'
)
+class AskWidgetForm(forms.Form, FormWithHideableFields):
+ '''Simple form with just the title to ask a question'''
+
+ title = TitleField()
+ ask_anonymously = forms.BooleanField(
+ label=_('ask anonymously'),
+ help_text=_(
+ 'Check if you do not want to reveal your name '
+ 'when asking this question'
+ ),
+ required=False,
+ )
+
+ def __init__(self, *args, **kwargs):
+ super(AskWidgetForm, self).__init__(*args, **kwargs)
+ #hide ask_anonymously field
+ if askbot_settings.ALLOW_ASK_ANONYMOUSLY is False:
+ self.hide_field('ask_anonymously')
class AskByEmailForm(forms.Form):
""":class:`~askbot.forms.AskByEmailForm`