Route('mediagoblin.auth.register', '/register/',
controller='mediagoblin.auth.views:register'),
Route('mediagoblin.auth.register_success', '/register/success/',
- controller='mediagoblin.auth.views:register_success'),
+ template='mediagoblin/auth/register_success.html',
+ controller='mediagoblin.views:simple_template_render'),
Route('mediagoblin.auth.login', '/login/',
controller='mediagoblin.auth.views:login'),
Route('mediagoblin.auth.logout', '/logout/',
Route('mediagoblin.auth.verify_email', '/verify_email/',
controller='mediagoblin.auth.views:verify_email'),
Route('mediagoblin.auth.verify_email_notice', '/verification_required/',
- controller='mediagoblin.auth.views:verify_email_notice'),
+ template='mediagoblin/auth/verification_needed.html',
+ controller='mediagoblin.views:simple_template_render'),
Route('mediagoblin.auth.resend_verification', '/resend_verification/',
controller='mediagoblin.auth.views:resend_activation'),
Route('mediagoblin.auth.resend_verification_success',
'/resend_verification_success/',
- controller='mediagoblin.auth.views:resend_activation_success')]
+ template='mediagoblin/auth/resent_verification_email.html',
+ controller='mediagoblin.views:simple_template_render')]
{'register_form': register_form})
-def register_success(request):
- return render_to_response(
- request,
- 'mediagoblin/auth/register_success.html', {})
-
-
def login(request):
"""
MediaGoblin login view.
{'user': user,
'verification_successful': verification_successful})
-def verify_email_notice(request):
- """
- Verify warning view.
-
- When the user tries to do some action that requires their account
- to be verified beforehand, this view is called upon!
- """
- return render_to_response(
- request, 'mediagoblin/auth/verification_needed.html', {})
-
def resend_activation(request):
"""
Resend the activation email.
"""
-
request.user['verification_key'] = unicode(uuid.uuid4())
request.user.save()
send_verification_email(request.user, request)
return redirect(request, 'mediagoblin.auth.resend_verification_success')
-
-
-def resend_activation_success(request):
- return render_to_response(
- request, 'mediagoblin/auth/resent_verification_email.html', {})
Route('mediagoblin.submit.start', '/',
controller='mediagoblin.submit.views:submit_start'),
Route('mediagoblin.submit.success', '/success/',
- controller='mediagoblin.submit.views:submit_success'),
- ]
+ template='mediagoblin/submit/success.html',
+ controller='mediagoblin.views:simple_template_render')]
{u'state': u'processed'}).sort('created', DESCENDING)
return render_to_response(
- request,
- 'mediagoblin/root.html',
+ request, 'mediagoblin/root.html',
{'media_entries': media_entries})
+
+
+def simple_template_render(request):
+ """
+ A view for absolutely simple template rendering.
+ Just make sure 'template' is in the matchdict!
+ """
+ template_name = request.matchdict['template']
+ return render_to_response(
+ request, template_name, {})