diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2013-03-21 21:05:49 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2013-03-21 21:05:49 -0400 |
commit | db812f38a5fe96e0ac589a85b1207b6cebc16a10 (patch) | |
tree | 00524840a4cda4df5795a8265e6e409646d42afd | |
parent | a3596220c202acb29eb7263e0548386243e4c0c7 (diff) | |
download | askbot-db812f38a5fe96e0ac589a85b1207b6cebc16a10.tar.gz askbot-db812f38a5fe96e0ac589a85b1207b6cebc16a10.tar.bz2 askbot-db812f38a5fe96e0ac589a85b1207b6cebc16a10.zip |
added setting to turn on and off selected scopes of questions
-rw-r--r-- | askbot/conf/questions_page.py | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/askbot/conf/questions_page.py b/askbot/conf/questions_page.py new file mode 100644 index 00000000..b1a9b689 --- /dev/null +++ b/askbot/conf/questions_page.py @@ -0,0 +1,71 @@ +""" +Settings responsible for display of questions lists +""" +from askbot.conf.settings_wrapper import settings +from askbot.conf.super_groups import DATA_AND_FORMATTING +from askbot.deps import livesettings +from django.utils.translation import ugettext_lazy as _ + +MAIN_PAGES = livesettings.ConfigurationGroup( + 'MAIN_PAGES', + _('Questions page'), + super_group=DATA_AND_FORMATTING + ) + +settings.register( + livesettings.StringValue( + MAIN_PAGES, + 'ALL_SCOPE_ENABLED', + default=True, + description=_('Enable "All Questions" selector'), + ) +) + +settings.register( + livesettings.BooleanValue( + MAIN_PAGES, + 'UNANSWERED_SCOPE_ENABLED', + default=True, + description=_('Enable "Unanswered Questions" selector'), + ) +) + +settings.register( + livesettings.BooleanValue( + MAIN_PAGES, + 'FOLLOWED_SCOPE_ENABLED', + default=True, + description=_('Enable "Followed Questions" selector'), + ) +) + +SCOPE_CHOICES_AUTHENTICATED = ( + ('all', _('All Questions')), + ('unanswered', _('Unanswered Questions')), + ('followed', _('Followed Questions')) +) + +settings.register( + livesettings.StringValue( + MAIN_PAGES, + 'DEFAULT_SCOPE_AUTHENTICATED', + choices=SCOPE_CHOICES_AUTHENTICATED, + default='all', + description=_('Default questions selector for the authenticated users') + ) +) + +SCOPE_CHOICES_ANONYMOUS = (#anonymous users can't see followed questions + ('all', _('All Questions')), + ('unanswered', _('Unanswered Questions')), +) + +settings.register( + livesettings.StringValue( + MAIN_PAGES, + 'DEFAULT_SCOPE_ANONYMOUS', + choices=SCOPE_CHOICES_ANONYMOUS, + default='all', + description=_('Default questions selector for the anonymous users') + ) +) |