back to patron list
parent
540d37d305
commit
749bd54faf
|
@ -25,6 +25,17 @@ object Plan extends LilaController {
|
|||
}
|
||||
}
|
||||
|
||||
def list = Open { implicit ctx =>
|
||||
ctx.me.fold(Redirect(routes.Plan.index).fuccess) { me =>
|
||||
import lila.plan.PlanApi.SyncResult._
|
||||
Env.plan.api.sync(me) flatMap {
|
||||
case ReloadUser => Redirect(routes.Plan.list).fuccess
|
||||
case Synced(Some(_), _) => indexFreeUser(me)
|
||||
case _ => Redirect(routes.Plan.index).fuccess
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private def indexAnon(implicit ctx: Context) = renderIndex(email = none, patron = none)
|
||||
|
||||
private def indexFreeUser(me: UserModel)(implicit ctx: Context) =
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
@trans.kidMode()
|
||||
</a>
|
||||
<div class="sep"></div>
|
||||
<a href="@routes.Plan.index">Patron</a>
|
||||
<a class="@active.active("security")" href="@routes.Account.security()">
|
||||
Security
|
||||
</a>
|
||||
|
|
|
@ -64,6 +64,12 @@ moreJs = jsTag("plan.js")) {
|
|||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td>
|
||||
<a href="@routes.Plan.list">View other lichess patrons</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
@ -144,6 +144,7 @@ POST /learn/reset controllers.Learn.reset
|
|||
GET /patron controllers.Plan.index
|
||||
POST /patron/charge controllers.Plan.charge
|
||||
GET /patron/thanks controllers.Plan.thanks
|
||||
GET /patron/list controllers.Plan.list
|
||||
POST /patron/switch controllers.Plan.switch
|
||||
POST /patron/cancel controllers.Plan.cancel
|
||||
POST /patron/webhook controllers.Plan.webhook
|
||||
|
|
Loading…
Reference in New Issue