diff options
author | Pacien TRAN-GIRARD | 2015-02-08 20:03:02 +0100 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2015-02-08 20:03:02 +0100 |
commit | c00cb6ae05f548f7ae270a93ad44f57207380406 (patch) | |
tree | d4fff3d2ec28fcfb5be4e0eed2621f8ac1462b74 /app | |
parent | 00443f9d168dc4fc272dee84c9ab8641062bf259 (diff) | |
download | minibay-c00cb6ae05f548f7ae270a93ad44f57207380406.tar.gz |
Put views in packages
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/Account.scala | 2 | ||||
-rw-r--r-- | app/controllers/Application.scala | 6 | ||||
-rw-r--r-- | app/controllers/Authentication.scala | 4 | ||||
-rw-r--r-- | app/controllers/Profile.scala | 4 | ||||
-rw-r--r-- | app/views/fragments/ebeMainActions.scala.html | 2 | ||||
-rw-r--r-- | app/views/pages/account/accountSummary.scala.html (renamed from app/views/pages/accountSummary.scala.html) | 0 | ||||
-rw-r--r-- | app/views/pages/auth/loginForm.scala.html (renamed from app/views/pages/loginForm.scala.html) | 0 | ||||
-rw-r--r-- | app/views/pages/auth/signupForm.scala.html (renamed from app/views/pages/signupForm.scala.html) | 0 | ||||
-rw-r--r-- | app/views/pages/sales/currentSales.scala.html | 41 | ||||
-rw-r--r-- | app/views/pages/static/ebeHomepage.scala.html (renamed from app/views/pages/ebeHomepage.scala.html) | 0 | ||||
-rw-r--r-- | app/views/pages/static/index.scala.html (renamed from app/views/pages/index.scala.html) | 0 | ||||
-rw-r--r-- | app/views/pages/static/pepalHomepage.scala.html (renamed from app/views/pages/pepalHomepage.scala.html) | 0 | ||||
-rw-r--r-- | app/views/pages/static/privacy.scala.html (renamed from app/views/pages/privacy.scala.html) | 0 | ||||
-rw-r--r-- | app/views/pages/static/terms.scala.html (renamed from app/views/pages/terms.scala.html) | 0 |
14 files changed, 50 insertions, 9 deletions
diff --git a/app/controllers/Account.scala b/app/controllers/Account.scala index 7557ef1..625ab2d 100644 --- a/app/controllers/Account.scala +++ b/app/controllers/Account.scala | |||
@@ -26,7 +26,7 @@ object Account extends Controller { | |||
26 | val userUuid = request.account.get.userUuid | 26 | val userUuid = request.account.get.userUuid |
27 | val transactions = Tables.Transactions.filter(_.userUuid === userUuid).sortBy(_.transactionDate.desc).run | 27 | val transactions = Tables.Transactions.filter(_.userUuid === userUuid).sortBy(_.transactionDate.desc).run |
28 | 28 | ||
29 | Ok(views.html.pages.accountSummary(transactions)) | 29 | Ok(views.html.pages.account.accountSummary(transactions)) |
30 | } | 30 | } |
31 | } | 31 | } |
32 | } | 32 | } |
diff --git a/app/controllers/Application.scala b/app/controllers/Application.scala index deb96d8..8f0b662 100644 --- a/app/controllers/Application.scala +++ b/app/controllers/Application.scala | |||
@@ -17,15 +17,15 @@ import models._ | |||
17 | object Application extends Controller { | 17 | object Application extends Controller { |
18 | 18 | ||
19 | def index = Auth { implicit request => | 19 | def index = Auth { implicit request => |
20 | Ok(views.html.pages.ebeHomepage()) | 20 | Ok(views.html.pages.static.ebeHomepage()) |
21 | } | 21 | } |
22 | 22 | ||
23 | def terms = Auth { implicit request => | 23 | def terms = Auth { implicit request => |
24 | Ok(views.html.pages.terms()) | 24 | Ok(views.html.pages.static.terms()) |
25 | } | 25 | } |
26 | 26 | ||
27 | def privacy = Auth { implicit request => | 27 | def privacy = Auth { implicit request => |
28 | Ok(views.html.pages.privacy()) | 28 | Ok(views.html.pages.static.privacy()) |
29 | } | 29 | } |
30 | 30 | ||
31 | } | 31 | } |
diff --git a/app/controllers/Authentication.scala b/app/controllers/Authentication.scala index f9772e2..b7ee724 100644 --- a/app/controllers/Authentication.scala +++ b/app/controllers/Authentication.scala | |||
@@ -56,7 +56,7 @@ object Authentication extends Controller { | |||
56 | 56 | ||
57 | def login = Auth { implicit request => | 57 | def login = Auth { implicit request => |
58 | if (request.account.isEmpty) { | 58 | if (request.account.isEmpty) { |
59 | Ok(views.html.pages.loginForm(loginForm)) | 59 | Ok(views.html.pages.auth.loginForm(loginForm)) |
60 | } else { | 60 | } else { |
61 | Redirect(routes.Application.index()) | 61 | Redirect(routes.Application.index()) |
62 | } | 62 | } |
@@ -66,7 +66,7 @@ object Authentication extends Controller { | |||
66 | DB.withSession { implicit session => | 66 | DB.withSession { implicit session => |
67 | loginForm.bindFromRequest.fold( | 67 | loginForm.bindFromRequest.fold( |
68 | formWithErrors => { | 68 | formWithErrors => { |
69 | BadRequest(views.html.pages.loginForm(formWithErrors)) | 69 | BadRequest(views.html.pages.auth.loginForm(formWithErrors)) |
70 | }, | 70 | }, |
71 | validForm => { | 71 | validForm => { |
72 | val userUuid: String = Tables.Users.filter(_.username === validForm.username).map(_.uuid).first.run | 72 | val userUuid: String = Tables.Users.filter(_.username === validForm.username).map(_.uuid).first.run |
diff --git a/app/controllers/Profile.scala b/app/controllers/Profile.scala index a41b3e9..8181106 100644 --- a/app/controllers/Profile.scala +++ b/app/controllers/Profile.scala | |||
@@ -98,7 +98,7 @@ object Profile extends Controller { | |||
98 | if (request.account.nonEmpty) { | 98 | if (request.account.nonEmpty) { |
99 | Redirect(routes.Application.index()) | 99 | Redirect(routes.Application.index()) |
100 | } else { | 100 | } else { |
101 | Ok(views.html.pages.signupForm(signupForm)) | 101 | Ok(views.html.pages.auth.signupForm(signupForm)) |
102 | } | 102 | } |
103 | } | 103 | } |
104 | 104 | ||
@@ -109,7 +109,7 @@ object Profile extends Controller { | |||
109 | DB.withSession { implicit session => | 109 | DB.withSession { implicit session => |
110 | signupForm.bindFromRequest.fold( | 110 | signupForm.bindFromRequest.fold( |
111 | formWithErrors => { | 111 | formWithErrors => { |
112 | BadRequest(views.html.pages.signupForm(formWithErrors)) | 112 | BadRequest(views.html.pages.auth.signupForm(formWithErrors)) |
113 | }, | 113 | }, |
114 | validForm => { | 114 | validForm => { |
115 | 115 | ||
diff --git a/app/views/fragments/ebeMainActions.scala.html b/app/views/fragments/ebeMainActions.scala.html index 46faeb6..0043321 100644 --- a/app/views/fragments/ebeMainActions.scala.html +++ b/app/views/fragments/ebeMainActions.scala.html | |||
@@ -6,7 +6,7 @@ | |||
6 | </div> | 6 | </div> |
7 | 7 | ||
8 | <div class="pure-u-1 pure-u-lg-1-2"> | 8 | <div class="pure-u-1 pure-u-lg-1-2"> |
9 | <a class="pure-button green-bg" href="#"> | 9 | <a class="pure-button green-bg" href="@routes.Sale.sales()"> |
10 | <i class="fa fa-dropbox fa-5x"></i> | 10 | <i class="fa fa-dropbox fa-5x"></i> |
11 | <span>Buy</span> | 11 | <span>Buy</span> |
12 | </a> | 12 | </a> |
diff --git a/app/views/pages/accountSummary.scala.html b/app/views/pages/account/accountSummary.scala.html index 3a10d3d..3a10d3d 100644 --- a/app/views/pages/accountSummary.scala.html +++ b/app/views/pages/account/accountSummary.scala.html | |||
diff --git a/app/views/pages/loginForm.scala.html b/app/views/pages/auth/loginForm.scala.html index f359082..f359082 100644 --- a/app/views/pages/loginForm.scala.html +++ b/app/views/pages/auth/loginForm.scala.html | |||
diff --git a/app/views/pages/signupForm.scala.html b/app/views/pages/auth/signupForm.scala.html index b026167..b026167 100644 --- a/app/views/pages/signupForm.scala.html +++ b/app/views/pages/auth/signupForm.scala.html | |||
diff --git a/app/views/pages/sales/currentSales.scala.html b/app/views/pages/sales/currentSales.scala.html new file mode 100644 index 0000000..30cea78 --- /dev/null +++ b/app/views/pages/sales/currentSales.scala.html | |||
@@ -0,0 +1,41 @@ | |||
1 | @(sales: Seq[Views.Sale])(implicit request: AuthRequest[AnyContent], flash: Flash, token: play.filters.csrf.CSRF.Token) | ||
2 | |||
3 | @templates.ebe("Sales")(request.account) { | ||
4 | |||
5 | <div class="action-buttons pure-g"> | ||
6 | @fragments.ebeMainActions() | ||
7 | </div> | ||
8 | |||
9 | <br> | ||
10 | |||
11 | <div class="pure-g"> | ||
12 | <div class="pure-u-1 pure-u-lg-1-1"> | ||
13 | <div class="l-box"> | ||
14 | <h2>Current sales</h2> | ||
15 | |||
16 | <table class="pure-table pure-table-horizontal"> | ||
17 | |||
18 | <thead> | ||
19 | <tr> | ||
20 | <td>End date</td> | ||
21 | <td>Item</td> | ||
22 | <td>Current price</td> | ||
23 | </tr> | ||
24 | </thead> | ||
25 | |||
26 | <tbody> | ||
27 | @for(sale <- sales) { | ||
28 | <tr> | ||
29 | <td>@sale.endDate</td> | ||
30 | <td><a href="@routes.Sale.item(sale.itemUuid.get)">@sale.itemName</a></td> | ||
31 | <td>@if(sale.bestOffer.isDefined) {@sale.bestOffer} else {sale.initialPrice} €</td> | ||
32 | </tr> | ||
33 | } | ||
34 | </tbody> | ||
35 | |||
36 | </table> | ||
37 | </div> | ||
38 | </div> | ||
39 | </div> | ||
40 | |||
41 | } | ||
diff --git a/app/views/pages/ebeHomepage.scala.html b/app/views/pages/static/ebeHomepage.scala.html index d4fe80a..d4fe80a 100644 --- a/app/views/pages/ebeHomepage.scala.html +++ b/app/views/pages/static/ebeHomepage.scala.html | |||
diff --git a/app/views/pages/index.scala.html b/app/views/pages/static/index.scala.html index b6e0029..b6e0029 100644 --- a/app/views/pages/index.scala.html +++ b/app/views/pages/static/index.scala.html | |||
diff --git a/app/views/pages/pepalHomepage.scala.html b/app/views/pages/static/pepalHomepage.scala.html index 9f4b227..9f4b227 100644 --- a/app/views/pages/pepalHomepage.scala.html +++ b/app/views/pages/static/pepalHomepage.scala.html | |||
diff --git a/app/views/pages/privacy.scala.html b/app/views/pages/static/privacy.scala.html index dd6898a..dd6898a 100644 --- a/app/views/pages/privacy.scala.html +++ b/app/views/pages/static/privacy.scala.html | |||
diff --git a/app/views/pages/terms.scala.html b/app/views/pages/static/terms.scala.html index 3ccadc7..3ccadc7 100644 --- a/app/views/pages/terms.scala.html +++ b/app/views/pages/static/terms.scala.html | |||