예제 #1
0
def templates_create(request):

    context = {
        'sadmin2_menu_main_active': 'emails',
        'sadmin2_breadcrumbs_active': 'emails_templates_create',
        'sadmin2_menu_tab': menu.sadmin2_menu_tab_emails,
        'sadmin2_menu_tab_active': 'templates'
    }

    return generic_create_view(request,
                               TemplateForm,
                               reverse('sadmin2:emails_templates'),
                               message_success=_('Template created'),
                               context=context)
예제 #2
0
def template(request, template_pk):

    instance = get_object_or_404(EmailSpecification, pk=template_pk)

    context = {
        'sadmin2_menu_main_active': 'emails',
        'sadmin2_breadcrumbs_active': 'emails_template',
        'sadmin2_menu_tab': menu.sadmin2_menu_tab_template,
        'sadmin2_menu_tab_active': 'template',

        'template': instance
    }

    return generic_create_view(request,
                               TemplateForm,
                               reverse('sadmin2:emails_template', kwargs={'template_pk': instance.pk}),
                               message_success=_('Template saved'),
                               context=context,
                               instance=instance)
예제 #3
0
def user_password(request, user_pk):

    user = get_object_or_404(get_user_model(), pk=user_pk)

    context = {
        'sadmin2_menu_main_active': 'userportal',
        'sadmin2_breadcrumbs_active': 'user_password',
        'sadmin2_menu_tab': menu.sadmin2_menu_tab_user,
        'sadmin2_menu_tab_active': 'password',

        'user': user
    }

    return generic_create_view(request,
                               PasswordForm,
                               redirect_success_url=reverse('sadmin2:user_password', kwargs={'user_pk': user.pk}),
                               message_success=_('Password updated'),
                               context=context,
                               instance=user)