コード例 #1
0
        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.'
                    ),
        default = '/images/logo.gif',
        url_resolver = skin_utils.get_media_url
    )
)

#cannot use HAS_ASKBOT_LOCALE_MIDDLEWARE due to circular import error
if not getattr(django_settings, 'ASKBOT_MULTILINGUAL', False) and \
        'askbot.middleware.locale.LocaleMiddleware' in django_settings.MIDDLEWARE_CLASSES:
    settings.register(
        values.StringValue(
            GENERAL_SKIN_SETTINGS,
            'ASKBOT_LANGUAGE',
            default = django_settings.LANGUAGE_CODE,
コード例 #2
0
from django.utils.translation import ugettext as _
from django.conf import settings as django_settings
from askbot.skins import utils as skin_utils
from askbot import const

GENERAL_SKIN_SETTINGS = ConfigurationGroup(
    'GENERAL_SKIN_SETTINGS',
    _('Skin and User Interface settings'),
)

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.'),
                      upload_directory=django_settings.ASKBOT_FILE_UPLOAD_DIR,
                      upload_url='/' +
                      django_settings.ASKBOT_UPLOADED_FILES_URL,
                      default='/images/logo.gif',
                      url_resolver=skin_utils.get_media_url))

settings.register(
    values.BooleanValue(
        GENERAL_SKIN_SETTINGS,
        'SHOW_LOGO',
        description=_('Show logo'),
        help_text=_('Check if you want to show logo in the forum header '
                    'or uncheck in the case you do not want the logo to '
                    'appear in the default location'),
        default=True))