Exemple #1
0
"""
Email related settings
"""
from openode.conf.settings_wrapper import settings
from openode.conf.super_groups import LOGIN_USERS_COMMUNICATION
from openode.deps import livesettings
from openode import const
from django.utils.translation import ugettext as _
from django.conf import settings as django_settings

EMAIL_SUBJECT_PREFIX = getattr(django_settings, 'EMAIL_SUBJECT_PREFIX', '')

EMAIL = livesettings.ConfigurationGroup(
            'EMAIL',
            _('Email and email alert settings'),
            super_group = LOGIN_USERS_COMMUNICATION
        )

settings.register(
    livesettings.StringValue(
        EMAIL,
        'EMAIL_SUBJECT_PREFIX',
        default = EMAIL_SUBJECT_PREFIX,
        description = _('Prefix for the email subject line'),
        help_text = _(
                'This setting takes default from the django setting'
                'EMAIL_SUBJECT_PREFIX. A value entered here will override'
                'the default.'
            )
    )
)
"""
Settings for openode data display and entry
"""
from openode.conf.settings_wrapper import settings
from openode.deps import livesettings
from openode import const
from openode.conf.super_groups import DATA_AND_FORMATTING
from django.utils.translation import ugettext as _

FORUM_DATA_RULES = livesettings.ConfigurationGroup(
    'FORUM_DATA_RULES',
    _('Data entry and display rules'),
    super_group=DATA_AND_FORMATTING)

settings.register(
    livesettings.IntegerValue(
        FORUM_DATA_RULES,
        'MAX_TAG_LENGTH',
        default=20,
        description=_('Maximum length of tag (number of characters)')))

settings.register(
    livesettings.IntegerValue(
        FORUM_DATA_RULES,
        'MIN_TITLE_LENGTH',
        default=3,
        description=_('Minimum length of title (number of characters)')))

settings.register(
    livesettings.IntegerValue(
        FORUM_DATA_RULES,
Exemple #3
0
"""External service key settings"""
from openode import const
from openode.conf.settings_wrapper import settings
from openode.conf.super_groups import EXTERNAL_SERVICES
from openode.deps import livesettings
from django.utils.translation import ugettext as _
from django.conf import settings as django_settings

EXTERNAL_KEYS = livesettings.ConfigurationGroup(
    'EXTERNAL_KEYS',
    _('Keys for external services'),
    super_group=EXTERNAL_SERVICES
)

settings.register(
    livesettings.StringValue(
        EXTERNAL_KEYS,
        'GOOGLE_SITEMAP_CODE',
        description=_('Google site verification key'),
        help_text=_(
            'This key helps google index your site '
            'please obtain is at '
            '<a href="%(url)s?hl=%(lang)s">'
            'google webmasters tools site</a>'
        ) % {
            'url': const.DEPENDENCY_URLS['google-webmaster-tools'],
            'lang': django_settings.LANGUAGE_CODE,
        }
    )
)
from openode.conf.settings_wrapper import settings
from openode.conf.super_groups import LOGIN_USERS_COMMUNICATION
from openode.deps import livesettings
from django.utils.translation import ugettext as _

ACCESS_CONTROL = livesettings.ConfigurationGroup(
                    'ACCESS_CONTROL',
                    _('Access control settings'),
                    super_group = LOGIN_USERS_COMMUNICATION
                )

settings.register(
    livesettings.BooleanValue(
        ACCESS_CONTROL,
        'OPENODE_CLOSED_FORUM_MODE',
        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',
Exemple #5
0
"""Settings for content moderation and spam control"""
from django.utils.translation import ugettext as _
from openode import const
from openode.deps import livesettings
from openode.conf.settings_wrapper import settings
from openode.conf.super_groups import EXTERNAL_SERVICES

SPAM_AND_MODERATION = livesettings.ConfigurationGroup(
                    'SPAM_AND_MODERATION',
                    _('Akismet spam protection'),
                    super_group = EXTERNAL_SERVICES
                )

settings.register(
    livesettings.BooleanValue(
        SPAM_AND_MODERATION,
        'USE_AKISMET',
        description=_('Enable Akismet spam detection(keys below are required)'),
        default=False,
        help_text = _(
                         'To get an Akismet key please visit '
                         '<a href="%(url)s">Akismet site</a>'
                     ) % {'url': const.DEPENDENCY_URLS['akismet']}
    )
)

settings.register(
    livesettings.StringValue(
        SPAM_AND_MODERATION,
        'AKISMET_API_KEY',
        description=_('Akismet key for spam detection')
"""
User policy settings
"""
from openode.conf.settings_wrapper import settings
from openode.conf.super_groups import LOGIN_USERS_COMMUNICATION
from openode.deps import livesettings
from openode.skins import utils as skin_utils
from django.utils.translation import ugettext as _
from openode import const

USER_SETTINGS = livesettings.ConfigurationGroup(
    'USER_SETTINGS', _('User settings'), super_group=LOGIN_USERS_COMMUNICATION)

# settings.register(
#     livesettings.LongStringValue(
#         USER_SETTINGS,
#         'NEW_USER_GREETING',
#         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')))

settings.register(
    livesettings.BooleanValue(
Exemple #7
0
"""
External service key settings
"""
from openode.conf.settings_wrapper import settings
from openode.conf.super_groups import LOGIN_USERS_COMMUNICATION
from openode.deps import livesettings
from django.utils.translation import ugettext as _
from django.conf import settings as django_settings
from openode.skins import utils as skin_utils

LOGIN_PROVIDERS = livesettings.ConfigurationGroup(
    'LOGIN_PROVIDERS',
    _('Login provider setings'),
    super_group=LOGIN_USERS_COMMUNICATION)

# settings.register(
#     livesettings.BooleanValue(
#         LOGIN_PROVIDERS,
#         'PASSWORD_REGISTER_SHOW_PROVIDER_BUTTONS',
#         default = True,
#         description=_('Show alternative login provider buttons on the password "Sign Up" page'),
#     )
# )

settings.register(
    livesettings.BooleanValue(
        LOGIN_PROVIDERS,
        'SIGNIN_ALWAYS_SHOW_LOCAL_LOGIN',
        default=True,
        description=_(
            'Always display local login form and hide "Openode" button.'),
"""
Q&A website settings - title, desctiption, basic urls
keywords
"""
from openode.conf.settings_wrapper import settings
from openode.conf.super_groups import CONTENT_AND_UI
from openode.deps import livesettings
from django.utils.translation import ugettext as _

QA_SITE_SETTINGS = livesettings.ConfigurationGroup(
    'QA_SITE_SETTINGS',
    _('URLS, keywords & greetings'),
    super_group=CONTENT_AND_UI)

settings.register(
    livesettings.StringValue(QA_SITE_SETTINGS,
                             'APP_TITLE',
                             default=u'OPENODE',
                             description=_('Site title for the Q&A instance')))

settings.register(
    livesettings.StringValue(QA_SITE_SETTINGS,
                             'APP_SUBTITLE',
                             default=u'smarter knowledge',
                             description=_('Site sub-title for the instance')))

settings.register(
    livesettings.StringValue(
        QA_SITE_SETTINGS,
        'APP_KEYWORDS',
        default=u'Openode,Askbot,CNPROG,forum,community',