Move login and view to templates