Exemplo n.º 1
0
def register_badge_settings(badge_slug=None, badge_name=None, params=None):
    settings.register(
        BooleanValue(BADGES,
                     badge_slug + '_BADGE_ENABLED',
                     default=True,
                     description=_('Enable "%s" badge') % badge_name))
    if params is None:
        return
    for param_slug, param_data in params.items():
        param_description = param_data[0]
        param_default = param_data[1]
        settings.register(
            IntegerValue(BADGES,
                         badge_slug + '_BADGE_' + param_slug,
                         description=string_concat(badge_name, ': ',
                                                   param_description),
                         default=param_default))
Exemplo n.º 2
0
from askbot.conf.settings_wrapper import settings
from askbot.conf.super_groups import REP_AND_BADGES
from askbot.deps.livesettings import ConfigurationGroup, IntegerValue
from django.utils.translation import ugettext as _

BADGES = ConfigurationGroup(
                    'BADGES',
                    _('Badge settings'),
                    ordering=2,
                    super_group = REP_AND_BADGES
                )

settings.register(
    IntegerValue(
        BADGES,
        'DISCIPLINED_BADGE_MIN_UPVOTES',
        default=3,
        description=_('Disciplined: minimum upvotes for deleted post')
    )
)

settings.register(
    IntegerValue(
        BADGES,
        'PEER_PRESSURE_BADGE_MIN_DOWNVOTES',
        default=3,
        description=_('Peer Pressure: minimum downvotes for deleted post')
    )
)

settings.register(
    IntegerValue(
Exemplo n.º 3
0
For example number of times a person can vote each day, etc.
"""
from askbot.conf.settings_wrapper import settings
from askbot.conf.super_groups import REP_AND_BADGES
from askbot.deps.livesettings import ConfigurationGroup, IntegerValue
from django.utils.translation import ugettext as _

VOTE_RULES = ConfigurationGroup('VOTE_RULES',
                                _('Vote and flag limits'),
                                ordering=1,
                                super_group=REP_AND_BADGES)

settings.register(
    IntegerValue(VOTE_RULES,
                 'MAX_VOTES_PER_USER_PER_DAY',
                 default=30,
                 description=_('Number of votes a user can cast per day')))

settings.register(
    IntegerValue(VOTE_RULES,
                 'MAX_FLAGS_PER_USER_PER_DAY',
                 default=5,
                 description=_('Maximum number of flags per user per day')))

settings.register(
    IntegerValue(
        VOTE_RULES,
        'VOTES_LEFT_WARNING_THRESHOLD',
        default=5,
        description=_('Threshold for warning about remaining daily votes')))
Exemplo n.º 4
0
from askbot.conf.settings_wrapper import settings
from askbot.conf.super_groups import REP_AND_BADGES
from askbot.deps.livesettings import ConfigurationGroup, IntegerValue
from django.utils.translation import ugettext as _

VOTE_RULES = ConfigurationGroup(
                    'VOTE_RULES', 
                    _('Vote and flag limits'), 
                    ordering = 1,
                    super_group = REP_AND_BADGES
                )

settings.register(
    IntegerValue(
        VOTE_RULES,
        'MAX_VOTES_PER_USER_PER_DAY',
        default=30,
        description=_('Number of votes a user can cast per day')
    )
)

settings.register(
    IntegerValue(
        VOTE_RULES,
        'MAX_FLAGS_PER_USER_PER_DAY',
        default=5,
        description=_('Maximum number of flags per user per day')
    )
)

settings.register(
    IntegerValue(
Exemplo n.º 5
0
For example number of times a person can vote each day, etc.
"""
from askbot.conf.settings_wrapper import settings
from askbot.deps.livesettings import ConfigurationGroup, IntegerValue
from django.utils.translation import ugettext as _

VOTE_RULES = ConfigurationGroup(
    'VOTE_RULES',
    _('Limits applicable to votes and moderation flags'),
    ordering=1,
)

settings.register(
    IntegerValue(VOTE_RULES,
                 'MAX_VOTES_PER_USER_PER_DAY',
                 default=30,
                 description=_('Number of votes a user can cast per day')))

settings.register(
    IntegerValue(VOTE_RULES,
                 'MAX_FLAGS_PER_USER_PER_DAY',
                 default=5,
                 description=_('Maximum number of flags per user per day')))

settings.register(
    IntegerValue(
        VOTE_RULES,
        'VOTES_LEFT_WARNING_THRESHOLD',
        default=5,
        description=_('Threshold for warning about remaining daily votes')))
Exemplo n.º 6
0
user in response to various actions by the same
users or others
"""
from askbot.conf.settings_wrapper import settings
from askbot.deps.livesettings import ConfigurationGroup, IntegerValue
from django.utils.translation import ugettext_lazy as _
from askbot.conf.super_groups import REP_AND_BADGES

REP_CHANGES = ConfigurationGroup('REP_CHANGES',
                                 _('Karma loss and gain rules'),
                                 super_group=REP_AND_BADGES,
                                 ordering=2)

settings.register(
    IntegerValue(REP_CHANGES,
                 'MAX_REP_GAIN_PER_USER_PER_DAY',
                 default=200,
                 description=_('Maximum daily reputation gain per user')))

settings.register(
    IntegerValue(REP_CHANGES,
                 'REP_GAIN_FOR_RECEIVING_UPVOTE',
                 default=10,
                 description=_('Gain for receiving an upvote')))

settings.register(
    IntegerValue(REP_CHANGES,
                 'REP_GAIN_FOR_RECEIVING_ANSWER_ACCEPTANCE',
                 default=15,
                 description=_('Gain for the author of accepted answer')))

settings.register(
"""
Skin settings to color view, vote and answer counters
"""
from askbot.conf.settings_wrapper import settings
from askbot.deps.livesettings import ConfigurationGroup, IntegerValue, StringValue
from django.utils.translation import ugettext as _
from askbot.deps.grapefruit import Color

SKIN_COUNTER_SETTINGS = ConfigurationGroup(
    'SKIN_COUNTER_SETTINGS', _('Skin: view, vote and answer counters'))

settings.register(
    IntegerValue(
        SKIN_COUNTER_SETTINGS,
        'VOTE_COUNTER_EXPECTED_MAXIMUM',
        default=3,
        description=_('Vote counter value to give "full color"'),
        hidden=True,
    ))

settings.register(
    StringValue(
        SKIN_COUNTER_SETTINGS,
        'COLORS_VOTE_COUNTER_EMPTY_BG',
        default='white',
        description=_('Background color for votes = 0'),
        help_text=_('HTML color name or hex value'),
        hidden=True,
    ))

settings.register(
Exemplo n.º 8
0
user in response to various actions by the same
users or others
"""
from askbot.conf.settings_wrapper import settings
from askbot.deps.livesettings import ConfigurationGroup, IntegerValue
from django.utils.translation import ugettext as _
from askbot.conf.super_groups import REP_AND_BADGES

REP_CHANGES = ConfigurationGroup('REP_CHANGES',
                                 _('Karma loss and gain rules'),
                                 super_group=REP_AND_BADGES,
                                 ordering=2)

settings.register(
    IntegerValue(REP_CHANGES,
                 'MAX_REP_GAIN_PER_USER_PER_DAY',
                 default=200,
                 description=_('Maximum daily reputation gain per user')))

settings.register(
    IntegerValue(REP_CHANGES,
                 'REP_GAIN_FOR_RECEIVING_UPVOTE',
                 default=10,
                 description=_('Gain for receiving an upvote')))

settings.register(
    IntegerValue(REP_CHANGES,
                 'REP_GAIN_FOR_RECEIVING_PROBLEM_ACCEPTANCE',
                 default=15,
                 description=_('Gain for the author of accepted problem')))

settings.register(