summaryrefslogtreecommitdiffstats
path: root/askbot/conf
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-08-22 09:49:53 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-08-22 09:49:53 -0400
commit260305720861c09a37373bf00689c9ea4e51f1cc (patch)
tree06d2c690431217e490ad99bce281feb8c38d144f /askbot/conf
parent7e5c66a4bd37720d24ff86b87ac5d81b89340d39 (diff)
parenta485a301207f401dc9a8d838bcb3442fdbe8bccd (diff)
downloadaskbot-260305720861c09a37373bf00689c9ea4e51f1cc.tar.gz
askbot-260305720861c09a37373bf00689c9ea4e51f1cc.tar.bz2
askbot-260305720861c09a37373bf00689c9ea4e51f1cc.zip
completed merge of user-groups with tag-editor, not tested yet
Diffstat (limited to 'askbot/conf')
-rw-r--r--askbot/conf/__init__.py1
-rw-r--r--askbot/conf/access_control.py38
-rw-r--r--askbot/conf/user_settings.py15
-rw-r--r--askbot/conf/widgets.py99
4 files changed, 49 insertions, 104 deletions
diff --git a/askbot/conf/__init__.py b/askbot/conf/__init__.py
index 7ccd19bd..3e80877c 100644
--- a/askbot/conf/__init__.py
+++ b/askbot/conf/__init__.py
@@ -26,7 +26,6 @@ import askbot.conf.badges
import askbot.conf.login_providers
import askbot.conf.access_control
import askbot.conf.site_modes
-import askbot.conf.widgets
#import main settings object
from askbot.conf.settings_wrapper import settings
diff --git a/askbot/conf/access_control.py b/askbot/conf/access_control.py
index cd2364b5..5da88936 100644
--- a/askbot/conf/access_control.py
+++ b/askbot/conf/access_control.py
@@ -13,9 +13,45 @@ settings.register(
livesettings.BooleanValue(
ACCESS_CONTROL,
'ASKBOT_CLOSED_FORUM_MODE',
- default = False,
+ default=False,
description=_('Allow only registered user to access the forum'),
)
)
+EMAIL_VALIDATION_CASE_CHOICES = (
+ ('nothing', _('nothing - not required')),
+ ('see-content', _('access to content')),
+ #'post-content', _('posting content'),
+)
+
+settings.register(
+ livesettings.StringValue(
+ ACCESS_CONTROL,
+ 'REQUIRE_VALID_EMAIL_FOR',
+ default='nothing',
+ choices=EMAIL_VALIDATION_CASE_CHOICES,
+ description=_(
+ 'Require valid email for'
+ )
+ )
+)
+settings.register(
+ livesettings.LongStringValue(
+ ACCESS_CONTROL,
+ 'ALLOWED_EMAILS',
+ default='',
+ description=_('Allowed email addresses'),
+ help_text=_('Please use space to separate the entries')
+ )
+)
+
+settings.register(
+ livesettings.LongStringValue(
+ ACCESS_CONTROL,
+ 'ALLOWED_EMAIL_DOMAINS',
+ default='',
+ description=_('Allowed email domain names'),
+ help_text=_('Please use space to separate the entries, do not use the @ symbol!')
+ )
+)
diff --git a/askbot/conf/user_settings.py b/askbot/conf/user_settings.py
index 84c16628..adbdd5ff 100644
--- a/askbot/conf/user_settings.py
+++ b/askbot/conf/user_settings.py
@@ -16,11 +16,20 @@ USER_SETTINGS = livesettings.ConfigurationGroup(
)
settings.register(
- livesettings.StringValue(
+ livesettings.LongStringValue(
USER_SETTINGS,
'NEW_USER_GREETING',
- default = '',
- description = _('On-screen greeting shown to the new users')
+ default='',
+ description=_('On-screen greeting shown to the new users')
+ )
+)
+
+settings.register(
+ livesettings.BooleanValue(
+ USER_SETTINGS,
+ 'ALLOW_ANONYMOUS_FEEDBACK',
+ default=True,
+ description=_('Allow anonymous users send feedback')
)
)
diff --git a/askbot/conf/widgets.py b/askbot/conf/widgets.py
deleted file mode 100644
index d704ea12..00000000
--- a/askbot/conf/widgets.py
+++ /dev/null
@@ -1,99 +0,0 @@
-"""
-Settings for embeddable widgets
-"""
-from django.utils.translation import ugettext as _
-from django.utils.html import escape
-from askbot.conf.settings_wrapper import settings
-from askbot.deps.livesettings import ConfigurationGroup
-from askbot.deps.livesettings import values
-from askbot.conf.super_groups import CONTENT_AND_UI
-
-EMBEDDABLE_WIDGETS = ConfigurationGroup(
- 'EMBEDDABLE_WIDGETS',
- _('Embeddable widgets'),
- super_group = CONTENT_AND_UI
-)
-
-#we need better capabilities for the settings here
-#
-
-settings.register(
- values.IntegerValue(
- EMBEDDABLE_WIDGETS,
- 'QUESTIONS_WIDGET_MAX_QUESTIONS',
- default = 7,
- description = _('Number of questions to show'),
- help_text = escape(
- _(
- 'To embed the widget, add the following code '
- 'to your site (and fill in correct base url, preferred tags, width and height):'
- '<iframe '
- 'src="{{base_url}}/widgets/questions?tags={{comma-separated-tags}}" '
- 'width="100%" '
- 'height="300"'
- 'scrolling="no">'
- '<p>Your browser does not support iframes.</p>'
- '</iframe>'
- )
- )
- )
-)
-settings.register(
- values.LongStringValue(
- EMBEDDABLE_WIDGETS,
- 'QUESTIONS_WIDGET_CSS',
- default = """
-body {
- overflow: hidden;
-}
-#container {
- width: 200px;
- height: 350px;
-}
-ul {
- list-style: none;
- padding: 5px;
- margin: 5px;
-}
-li {
- border-bottom: #CCC 1px solid;
- padding-bottom: 5px;
- padding-top: 5px;
-}
-li:last-child {
- border: none;
-}
-a {
- text-decoration: none;
- color: #464646;
- font-family: 'Yanone Kaffeesatz', sans-serif;
- font-size: 15px;
-}
-""",
- descripton = _('CSS for the questions widget')
- )
-)
-
-settings.register(
- values.LongStringValue(
- EMBEDDABLE_WIDGETS,
- 'QUESTIONS_WIDGET_HEADER',
- description = _('Header for the questions widget'),
- default = ''
- )
-)
-
-settings.register(
- values.LongStringValue(
- EMBEDDABLE_WIDGETS,
- 'QUESTIONS_WIDGET_FOOTER',
- description = _('Footer for the questions widget'),
- default = """
-<link
- href='http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:300,400,700'
- rel='stylesheet'
- type='text/css'
->
-"""
- )
-)