post-signup screen
This commit is contained in:
parent
017d25eaa5
commit
e164f19bbb
|
@ -111,7 +111,7 @@ object Auth extends LilaController {
|
|||
.map(_ -> email).flatMap {
|
||||
case (user, email) => env.emailConfirm.send(user, email) >> {
|
||||
if (env.emailConfirm.effective) Redirect(routes.Auth.checkYourEmail(user.username)).fuccess
|
||||
else saveAuthAndRedirect(user)
|
||||
else redirectNewUser(user)
|
||||
}
|
||||
}
|
||||
}),
|
||||
|
@ -137,11 +137,11 @@ object Auth extends LilaController {
|
|||
|
||||
def signupConfirmEmail(token: String) = Open { implicit ctx =>
|
||||
Env.security.emailConfirm.confirm(token) flatMap {
|
||||
_.fold(notFound)(saveAuthAndRedirect)
|
||||
_.fold(notFound)(redirectNewUser)
|
||||
}
|
||||
}
|
||||
|
||||
private def saveAuthAndRedirect(user: UserModel)(implicit ctx: Context) = {
|
||||
private def redirectNewUser(user: UserModel)(implicit ctx: Context) = {
|
||||
implicit val req = ctx.req
|
||||
api.saveAuthentication(user.id, ctx.mobileApiVersion) map { sessionId =>
|
||||
Redirect(routes.User.show(user.username)) withCookies LilaCookie.session("sessionId", sessionId)
|
||||
|
|
32
app/views/user/newPlayer.scala.html
Normal file
32
app/views/user/newPlayer.scala.html
Normal file
|
@ -0,0 +1,32 @@
|
|||
@(u: User)(implicit ctx: Context)
|
||||
|
||||
<div class="new_player">
|
||||
<h2>Welcome to lichess.org!</h2>
|
||||
<p>
|
||||
This is your profile page.
|
||||
@if(u.profile.isEmpty) {
|
||||
Would you like to <a href="@routes.Account.profile">improve it</a>?
|
||||
}
|
||||
</p>
|
||||
<p>
|
||||
@if(u.kid) {
|
||||
Kid mode is enabled.
|
||||
} else {
|
||||
Will a child use this account? You might want to enable <a href="@routes.Account.kid">Kid mode</a>.
|
||||
}
|
||||
</p>
|
||||
<p>
|
||||
What now? Here are a few suggestions:
|
||||
</p>
|
||||
<ul>
|
||||
<li><a href="@routes.Learn.index">Learn chess rules by playing</a></li>
|
||||
<li><a href="@routes.Puzzle.home">Improve with chess tactics puzzles</a></li>
|
||||
<li><a href="@routes.Lobby.home#ai">Play the artificial intelligence</a></li>
|
||||
<li><a href="@routes.Lobby.home#hook">Play opponents from around the world</a></li>
|
||||
<li><a href="@routes.User.list">Follow your friends on lichess</a></li>
|
||||
<li><a href="@routes.Tournament.home(1)">Play in tournaments</a></li>
|
||||
<li>Learn from <a href="@routes.Study.allDefault(1)">studies</a> and <a href="@routes.Video.index">videos</a></li>
|
||||
<li><a href="@routes.Pref.form("game-display")">Configure lichess to your liking</a></li>
|
||||
<li>Explore the site and have fun :)</li>
|
||||
</ul>
|
||||
</div>
|
|
@ -133,6 +133,10 @@ description = describeUser(u)).some) {
|
|||
<div class="rating_history">
|
||||
@base.spinner()
|
||||
</div>
|
||||
}.getOrElse {
|
||||
@if(ctx.is(u)) {
|
||||
@newPlayer(u)
|
||||
}
|
||||
}
|
||||
<div class="user-infos scroll-shadow-hard">
|
||||
@if(ctx.me.fold(true)(u !=)) {
|
||||
|
|
|
@ -18,6 +18,8 @@ case class Profile(
|
|||
|
||||
def nonEmptyBio = ne(bio)
|
||||
|
||||
def isEmpty = List(country, location, bio, firstName, lastName).forall(_.isEmpty)
|
||||
|
||||
private def ne(str: Option[String]) = str filter (_.nonEmpty)
|
||||
}
|
||||
|
||||
|
|
|
@ -568,3 +568,19 @@ div.user_show .search_status {
|
|||
padding: 10px 25px;
|
||||
border-bottom: 1px solid #e4e4e4;
|
||||
}
|
||||
div.user_show .new_player {
|
||||
padding: 20px;
|
||||
}
|
||||
div.user_show .new_player h2 {
|
||||
font-size: 1.4em;
|
||||
}
|
||||
div.user_show .new_player p {
|
||||
margin: 1em 0;
|
||||
}
|
||||
div.user_show .new_player li {
|
||||
list-style: disc inside;
|
||||
line-height: 1.5em;
|
||||
}
|
||||
div.user_show .new_player a {
|
||||
color: #3893E8;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue