if url.startswith('/'): return url validate = URLValidator() try: validate(url) return url except ValidationError: raise ValueError(_('Please enter a valid url')) settings.register( values.StringValue( GENERAL_SKIN_SETTINGS, 'LOGO_DESTINATION_URL', default = '', description = _('Custom destination URL for the logo'), update_callback=logo_destination_callback ) ) settings.register( values.ImageValue( GENERAL_SKIN_SETTINGS, 'SITE_LOGO_URL', description = _('Q&A site logo'), help_text = _( 'To change the logo, select new file, ' 'then submit this whole form.' ),
from askbot.conf.settings_wrapper import settings from askbot.deps.livesettings import ConfigurationGroup from askbot.deps.livesettings import values from django.utils.translation import ugettext_lazy as _ from askbot.skins import utils as skin_utils from askbot import const from askbot.conf.super_groups import CONTENT_AND_UI WORDS = ConfigurationGroup('WORDS', _('Site terms vocabulary'), super_group=CONTENT_AND_UI) settings.register( values.StringValue(WORDS, 'WORDS_ASK_YOUR_QUESTION', default=_('Ask Your Question'), description=_('Ask Your Question'), help_text=_('Used on a button'))) settings.register( values.StringValue( WORDS, 'WORDS_PLEASE_ENTER_YOUR_QUESTION', default=_('Please enter your question'), description=_('Please enter your question'), )) settings.register( values.StringValue(WORDS, 'WORDS_ASK_THE_GROUP', default=_('Ask the Group'),
values.BooleanValue(GENERAL_SKIN_SETTINGS, 'ALWAYS_SHOW_ALL_UI_FUNCTIONS', default=False, description=_('Show all UI functions to all users'), help_text=_( 'If checked, all forum functions ' 'will be shown to users, regardless of their ' 'reputation. However to use those functions, ' 'moderation rules, reputation and other limits ' 'will still apply.'))) settings.register( values.StringValue( GENERAL_SKIN_SETTINGS, 'ASKBOT_DEFAULT_SKIN', default='default', choices=skin_utils.get_skin_choices(), description=_('Select skin'), )) settings.register( values.IntegerValue(GENERAL_SKIN_SETTINGS, 'MEDIA_RESOURCE_REVISION', default=1, description=_('Skin media revision number'), help_text=_( 'Increment this number when you change ' 'image in skin media or stylesheet. ' 'This helps avoid showing your users ' 'outdated images from their browser cache.')))
values.BooleanValue(GENERAL_SKIN_SETTINGS, 'ALWAYS_SHOW_ALL_UI_FUNCTIONS', default=False, description=_('Show all UI functions to all users'), help_text=_( 'If checked, all forum functions ' 'will be shown to users, regardless of their ' 'reputation. However to use those functions, ' 'moderation rules, reputation and other limits ' 'will still apply.'))) settings.register( values.StringValue( GENERAL_SKIN_SETTINGS, 'ASKBOT_DEFAULT_SKIN', default='default', choices=skin_utils.get_skin_choices(), description=_('Select skin'), )) settings.register( values.BooleanValue(GENERAL_SKIN_SETTINGS, 'USE_CUSTOM_HTML_HEAD', default=False, description=_('Customize HTML <HEAD>'))) settings.register( values.LongStringValue( GENERAL_SKIN_SETTINGS, 'CUSTOM_HTML_HEAD', default='',
from askbot.conf.settings_wrapper import settings from askbot.deps.livesettings import ConfigurationGroup from askbot.deps.livesettings import values from django.utils.translation import ugettext_lazy as _ from askbot.skins import utils as skin_utils from askbot import const from askbot.conf.super_groups import CONTENT_AND_UI WORDS = ConfigurationGroup('WORDS', _('Site terms vocabulary'), super_group=CONTENT_AND_UI) settings.register( values.StringValue(WORDS, 'WORDS_ASK_YOUR_QUESTION', default=_('Post New Decision'), description=_('Post New Decision'), help_text=_('Used on a button'))) settings.register( values.StringValue( WORDS, 'WORDS_PLEASE_ENTER_YOUR_QUESTION', default=_('Describe new decision'), description=_('Describe new decision'), )) settings.register( values.StringValue(WORDS, 'WORDS_ASK_THE_GROUP', default=_('Ask the Group'),