File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ package controllers
2+
3+ import _root_ .play ._
4+ import _root_ .play .mvc ._
5+ import _root_ .play .modules .gae ._
6+
7+ object Application extends Controller with Defaults {
8+
9+ def index = Template
10+
11+ def login = GAE .login(" Application.index" )
12+
13+ def logout = GAE .logout(" Application.index" )
14+ }
Original file line number Diff line number Diff line change 1+ package controllers
2+
3+ import _root_ .play ._
4+ import _root_ .play .mvc ._
5+ import _root_ .play .modules .gae ._
6+
7+ trait Defaults extends Controller {
8+
9+ @ Before
10+ def check = {
11+ Option (GAE .getUser) match {
12+ case Some (user) => {
13+ renderArgs += " user" -> user
14+ }
15+ case None =>
16+ }
17+ }
18+ }
Original file line number Diff line number Diff line change 11#{extends 'main.html' /}
22#{set title:'Home' /}
33
4- #{welcome /}
4+ Welcome #{if user}${user.email}#{/if}#{else}Guest#{/else}!
5+
6+ #{if user}< a href ="@{Application.logout} "> Logout</ a > #{/if}#{else}< a href ="@{Application.login} "> Login</ a > #{/else}
Original file line number Diff line number Diff line change 44
55# Home page
66GET / Application.index
7+ GET /login Application.login
8+ GET /logout Application.logout
79
810# Map static resources from the /app/public folder to the /public path
911GET /public/ staticDir:public
You can’t perform that action at this time.
0 commit comments