Пример #1
0
SIGNUP_VERIFY_EMAIL_SUCCESS_TEXT = getattr(settings, 'SITEGATE_SIGNUP_VERIFY_EMAIL_SUCCESS_TEXT', _('E-mail was successfully verified. You can now proceed to sign in.'))
SIGNUP_VERIFY_EMAIL_ERROR_TEXT = getattr(settings, 'SITEGATE_SIGNUP_VERIFY_EMAIL_ERROR_TEXT', _('Unable to verify an e-mail. User account was not activated.'))

SIGNUP_VERIFY_EMAIL_VIEW_NAME = getattr(settings, 'SITEGATE_SIGNUP_VERIFY_EMAIL_VIEW_NAME', 'verify_email')

try:
    from siteprefs.toolbox import patch_locals, register_prefs, pref, pref_group
    from django.db.models import CharField

    patch_locals()
    register_prefs(
        pref(SIGNIN_ENABLED, verbose_name=_('Signin enabled'), static=False),
        pref(SIGNIN_DISABLED_TEXT, verbose_name=_('Sign in disabled text'), help_text=_('This text is shown instead of a signin form when sign in in disabled.'), static=False),
        pref(SIGNUP_ENABLED, verbose_name=_('Signup enabled'), static=False),
        pref(SIGNUP_DISABLED_TEXT, verbose_name=_('Sign up disabled text'), help_text=_('This text is shown instead of a signup form when sign up in disabled.'), static=False),

        pref_group(_('E-mail verification'), (
            pref(SIGNUP_VERIFY_EMAIL_NOTICE, verbose_name=_('Verification notice'), help_text=_('Text shown to a user after a registration form is submitted.'), static=False),

            pref(SIGNUP_VERIFY_EMAIL_TITLE, verbose_name=_('Message title'), help_text=_('Title of an email message containing an account activation URL.'), static=False, field=CharField(max_length=160)),
            pref(SIGNUP_VERIFY_EMAIL_BODY, verbose_name=_('Message body'), help_text=_('<b>NOTE:</b> Message body must include `%(url)s` marker to indicate a place to put an activation URL at.'), static=False),

            pref(SIGNUP_VERIFY_EMAIL_SUCCESS_TEXT, verbose_name=_('Verification success notice'), help_text=_('A message shown to a user after he has followed an account activation URL if activation was a success.'), static=False),
            pref(SIGNUP_VERIFY_EMAIL_ERROR_TEXT, verbose_name=_('Verification error notice'), help_text=_('A message shown to a user after he has followed an account activation URL if there was an error during an activation process.'), static=False),
        ))
    )

except ImportError:
    pass
Пример #2
0
# ------------------------------------------------------------------------------
HELP_URL = getattr(settings, 'ONTASK_HELP_URL', '')

patch_locals()  # That's for bootstrapping.

register_prefs(
    pref_group(
        _('Notification Emails'),
        (
            pref(
                NOTIFICATION_TEMPLATE,
                verbose_name=_('Template to send email notification'),
                static=False,
                field=models.TextField()),
            pref(
                NOTIFICATION_SUBJECT,
                verbose_name=_('Subject line for notification messages'),
                static=False,
                field=models.CharField(max_length=1024)),
            pref(
                NOTIFICATION_SENDER,
                verbose_name=_('"From:" field in notification emails'),
                static=False,
                field=models.CharField(max_length=1024)),
        ),
        static=False),
    pref_group(
        _('Uploads'),
        (
            pref(
                CONTENT_TYPES,
                verbose_name=_('Content types allowed in uploads'),
Пример #3
0
                               "OnTask: Action executed")

NOTIFICATION_SENDER = getattr(settings, 'EMAIL_ACTION_NOTIFICATION_SENDER',
                              '*****@*****.**')

PIXEL = getattr(settings, 'EMAIL_ACTION_PIXEL', None)

if 'siteprefs' in settings.INSTALLED_APPS:
    # Respect those users who don't have siteprefs installed.
    from siteprefs.toolbox import patch_locals, register_prefs, pref, \
        pref_group

    patch_locals()  # That's bootstrap.

    register_prefs(
        pref_group('Notification Emails', (
            pref(NOTIFICATION_TEMPLATE,
                 verbose_name='Template to send email notification',
                 static=False,
                 field=models.TextField(max_length=65536)),
            pref(NOTIFICATION_SUBJECT,
                 verbose_name='Subject line for notification messages',
                 static=False,
                 field=models.CharField(max_length=1024)),
            pref(NOTIFICATION_SENDER,
                 verbose_name='To: field in notification emails',
                 static=False,
                 field=models.CharField(max_length=1024)),
        ),
                   static=False), )
Пример #4
0
 pref_group(_('E-mail verification'), (
     pref(
         SIGNUP_VERIFY_EMAIL_NOTICE,
         verbose_name=_('Verification notice'),
         help_text=
         _('Text shown to a user after a registration form is submitted.'
           ),
         static=False),
     pref(
         SIGNUP_VERIFY_EMAIL_TITLE,
         verbose_name=_('Message title'),
         help_text=
         _('Title of an email message containing an account activation URL.'
           ),
         static=False,
         field=CharField(max_length=160)),
     pref(
         SIGNUP_VERIFY_EMAIL_BODY,
         verbose_name=_('Message body'),
         help_text=_(
             '<b>NOTE:</b> Message body must include `%(url)s` marker to indicate a place '
             'to put an activation URL at.'),
         static=False),
     pref(
         SIGNUP_VERIFY_EMAIL_SUCCESS_TEXT,
         verbose_name=_('Verification success notice'),
         help_text=_(
             'A message shown to a user after he has followed an account activation URL '
             'if activation was a success.'),
         static=False),
     pref(
         SIGNUP_VERIFY_EMAIL_ERROR_TEXT,
         verbose_name=_('Verification error notice'),
         help_text=_(
             'A message shown to a user after he has followed an account activation URL '
             'if there was an error during an activation process.'),
         static=False),
 )))
Пример #5
0
		return getattr(name, 'get_value')()
	else:
		return name

# to allow to edit it online:
# To be sure our app is still functional without django-siteprefs
# we use this try-except block.
try:
	from siteprefs.toolbox import patch_locals, register_prefs, pref_group, pref
	patch_locals()  # This bootstrap is required before `register_prefs` step.

	# And that's how we expose our options to Admin.
	register_prefs(
		pref_group(
			_('Standin parser settings'), (
				PLAN_FILES_ENCODING, PLAN_PARSER_MODEL, PLAN_PARSER_REGEX_MOVED_TO, PLAN_PARSER_REGEX_MOVED_FROM
			),
			static=False
		),
		pref(
			PLAN_PUPIL_TEACHER_FULLNAME,
			field=BooleanField(),
			static=False,
			verbose_name=_('Show full name of teachers'),
			category=_('Standin pupil view')
		),
		pref(
			PLAN_PUPIL_TEACHER_SHORTCUT,
			field=BooleanField(),
			static=False,
			verbose_name=_('Show abbreviation of teachers'),
			help_text=_('This setting has only an affect if the full name of teachers are shown. In this case, the teachers abbreviation is appended in brackets.'),