Beispiel #1
0
def preferences(request):
    api = TemplateAPI(request, _('Your preferences'))
    current_lang = locale_negotiator(request)
    settings = request.registry.settings
    available_langs = settings['lasco.available_languages'].split()
    current_theme = request.cookies.get('color_theme', 'default')
    return {'api': api,
            'current_theme': current_theme,
            'available_themes': AVAILABLE_THEMES,
            'current_lang': current_lang,
            'available_langs': available_langs}
Beispiel #2
0
def login_form(request, failed=False):
    api = TemplateAPI(request, 'Log in')
    next = request.GET.get('next') or \
        request.POST.get('next') or \
        quote_plus(api.referrer or api.app_url)
    login = request.POST.get('login', '')
    if failed:
        error_msg = _(u'Wrong user name or password.')
    else:
        error_msg = None
    return {'api': api,
            'login': login,
            'next': next,
            'error_msg': error_msg}
Beispiel #3
0
def help(request):
    api = TemplateAPI(request, _('Help'))
    return {'api': api}
Beispiel #4
0
def not_found(request):
    api = TemplateAPI(request, _(u'Page not found'))
    api.show_login_link = False
    request.response.status = 404
    return {'api': api,
            'resource_url': request.url}