aboutsummaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorPacien TRAN-GIRARD2015-02-08 17:06:58 +0100
committerPacien TRAN-GIRARD2015-02-08 17:06:58 +0100
commitf90cd0da3eda7c1723ce4de439f64334c81db712 (patch)
tree700f4b04acf04f3cd39df94b3add1086a47f18a2 /app/controllers
parenta022850963552096dab032fb57c16d3b1d3ac51a (diff)
downloadminibay-f90cd0da3eda7c1723ce4de439f64334c81db712.tar.gz
Implement account summary page
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/Account.scala17
1 files changed, 16 insertions, 1 deletions
diff --git a/app/controllers/Account.scala b/app/controllers/Account.scala
index ff1d44d..7557ef1 100644
--- a/app/controllers/Account.scala
+++ b/app/controllers/Account.scala
@@ -14,6 +14,21 @@ import scala.concurrent.Future
14import models._ 14import models._
15 15
16 16
17object Account { 17object Account extends Controller {
18
19 def summary = Auth { implicit request =>
20 if (request.account.isEmpty) {
21 Redirect(routes.Authentication.login())
22 .flashing("error" -> "Authentication required")
23 } else {
24
25 DB.withSession { implicit session =>
26 val userUuid = request.account.get.userUuid
27 val transactions = Tables.Transactions.filter(_.userUuid === userUuid).sortBy(_.transactionDate.desc).run
28
29 Ok(views.html.pages.accountSummary(transactions))
30 }
31 }
32 }
18 33
19} 34}