From c00cb6ae05f548f7ae270a93ad44f57207380406 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Sun, 8 Feb 2015 20:03:02 +0100 Subject: Put views in packages --- app/controllers/Account.scala | 2 +- app/controllers/Application.scala | 6 +- app/controllers/Authentication.scala | 4 +- app/controllers/Profile.scala | 4 +- app/views/fragments/ebeMainActions.scala.html | 2 +- app/views/pages/account/accountSummary.scala.html | 89 +++++++++++++++++++++++ app/views/pages/accountSummary.scala.html | 89 ----------------------- app/views/pages/auth/loginForm.scala.html | 27 +++++++ app/views/pages/auth/signupForm.scala.html | 43 +++++++++++ app/views/pages/ebeHomepage.scala.html | 49 ------------- app/views/pages/index.scala.html | 3 - app/views/pages/loginForm.scala.html | 27 ------- app/views/pages/pepalHomepage.scala.html | 49 ------------- app/views/pages/privacy.scala.html | 15 ---- app/views/pages/sales/currentSales.scala.html | 41 +++++++++++ app/views/pages/signupForm.scala.html | 43 ----------- app/views/pages/static/ebeHomepage.scala.html | 49 +++++++++++++ app/views/pages/static/index.scala.html | 3 + app/views/pages/static/pepalHomepage.scala.html | 49 +++++++++++++ app/views/pages/static/privacy.scala.html | 15 ++++ app/views/pages/static/terms.scala.html | 16 ++++ app/views/pages/terms.scala.html | 16 ---- 22 files changed, 341 insertions(+), 300 deletions(-) create mode 100644 app/views/pages/account/accountSummary.scala.html delete mode 100644 app/views/pages/accountSummary.scala.html create mode 100644 app/views/pages/auth/loginForm.scala.html create mode 100644 app/views/pages/auth/signupForm.scala.html delete mode 100644 app/views/pages/ebeHomepage.scala.html delete mode 100644 app/views/pages/index.scala.html delete mode 100644 app/views/pages/loginForm.scala.html delete mode 100644 app/views/pages/pepalHomepage.scala.html delete mode 100644 app/views/pages/privacy.scala.html create mode 100644 app/views/pages/sales/currentSales.scala.html delete mode 100644 app/views/pages/signupForm.scala.html create mode 100644 app/views/pages/static/ebeHomepage.scala.html create mode 100644 app/views/pages/static/index.scala.html create mode 100644 app/views/pages/static/pepalHomepage.scala.html create mode 100644 app/views/pages/static/privacy.scala.html create mode 100644 app/views/pages/static/terms.scala.html delete mode 100644 app/views/pages/terms.scala.html 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 { val userUuid = request.account.get.userUuid val transactions = Tables.Transactions.filter(_.userUuid === userUuid).sortBy(_.transactionDate.desc).run - Ok(views.html.pages.accountSummary(transactions)) + Ok(views.html.pages.account.accountSummary(transactions)) } } } 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._ object Application extends Controller { def index = Auth { implicit request => - Ok(views.html.pages.ebeHomepage()) + Ok(views.html.pages.static.ebeHomepage()) } def terms = Auth { implicit request => - Ok(views.html.pages.terms()) + Ok(views.html.pages.static.terms()) } def privacy = Auth { implicit request => - Ok(views.html.pages.privacy()) + Ok(views.html.pages.static.privacy()) } } 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 { def login = Auth { implicit request => if (request.account.isEmpty) { - Ok(views.html.pages.loginForm(loginForm)) + Ok(views.html.pages.auth.loginForm(loginForm)) } else { Redirect(routes.Application.index()) } @@ -66,7 +66,7 @@ object Authentication extends Controller { DB.withSession { implicit session => loginForm.bindFromRequest.fold( formWithErrors => { - BadRequest(views.html.pages.loginForm(formWithErrors)) + BadRequest(views.html.pages.auth.loginForm(formWithErrors)) }, validForm => { 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 { if (request.account.nonEmpty) { Redirect(routes.Application.index()) } else { - Ok(views.html.pages.signupForm(signupForm)) + Ok(views.html.pages.auth.signupForm(signupForm)) } } @@ -109,7 +109,7 @@ object Profile extends Controller { DB.withSession { implicit session => signupForm.bindFromRequest.fold( formWithErrors => { - BadRequest(views.html.pages.signupForm(formWithErrors)) + BadRequest(views.html.pages.auth.signupForm(formWithErrors)) }, validForm => { 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 @@
- + Buy diff --git a/app/views/pages/account/accountSummary.scala.html b/app/views/pages/account/accountSummary.scala.html new file mode 100644 index 0000000..3a10d3d --- /dev/null +++ b/app/views/pages/account/accountSummary.scala.html @@ -0,0 +1,89 @@ +@(transactions: Seq[Tables.Transaction])(implicit request: AuthRequest[AnyContent], flash: Flash, token: play.filters.csrf.CSRF.Token) + +@templates.pepal("Account summary")(request.account) { + +
+ @fragments.pepalMainActions() +
+ +
+ +
+
+
+

My wallet

+ + + + + + + + + + + + + + + + + + + +
Account summary
Balance@request.account.get.balance €
Available funds@request.account.get.equity €
+ +
+ + +
+
+ +
+
+

Transaction history

+ + + + + + + + + + + + + @for(transaction <- transactions) { + + + + + + } + + + +
DateAmountLabel
@transaction.transactionDate@transaction.amount + €@transaction.label
+
+
+
+ +} diff --git a/app/views/pages/accountSummary.scala.html b/app/views/pages/accountSummary.scala.html deleted file mode 100644 index 3a10d3d..0000000 --- a/app/views/pages/accountSummary.scala.html +++ /dev/null @@ -1,89 +0,0 @@ -@(transactions: Seq[Tables.Transaction])(implicit request: AuthRequest[AnyContent], flash: Flash, token: play.filters.csrf.CSRF.Token) - -@templates.pepal("Account summary")(request.account) { - -
- @fragments.pepalMainActions() -
- -
- -
-
-
-

My wallet

- - - - - - - - - - - - - - - - - - - -
Account summary
Balance@request.account.get.balance €
Available funds@request.account.get.equity €
- -
- - -
-
- -
-
-

Transaction history

- - - - - - - - - - - - - @for(transaction <- transactions) { - - - - - - } - - - -
DateAmountLabel
@transaction.transactionDate@transaction.amount - €@transaction.label
-
-
-
- -} diff --git a/app/views/pages/auth/loginForm.scala.html b/app/views/pages/auth/loginForm.scala.html new file mode 100644 index 0000000..f359082 --- /dev/null +++ b/app/views/pages/auth/loginForm.scala.html @@ -0,0 +1,27 @@ +@(loginForm: Form[LoginData])(implicit flash: Flash, token: play.filters.csrf.CSRF.Token) + +@templates.ebe("Log in")() { + +
+
+ +

Log in

+ + @views.html.fragments.forms.globalErrors(loginForm) + + @helper.form(action = routes.Authentication.loginSubmit(), 'class -> "pure-form") { + + @helper.CSRF.formField + +
+ @views.html.fragments.forms.inputField(loginForm("username"), "text", "Username") + @views.html.fragments.forms.inputField(loginForm("password"), "password", "Password") +
+ + + } + +
+
+ +} diff --git a/app/views/pages/auth/signupForm.scala.html b/app/views/pages/auth/signupForm.scala.html new file mode 100644 index 0000000..b026167 --- /dev/null +++ b/app/views/pages/auth/signupForm.scala.html @@ -0,0 +1,43 @@ +@(signupForm: Form[SignupData])(implicit flash: Flash, token: play.filters.csrf.CSRF.Token) + +@templates.ebe("Sign up")() { + +
+
+ +

Sign up

+ + @views.html.fragments.forms.globalErrors(signupForm) + + @helper.form(action = routes.Profile.signupSubmit(), 'class -> "pure-form pure-form-stacked") { + + @helper.CSRF.formField + +
+ @views.html.fragments.forms.labeledField(signupForm("username"), "text", "Username") + @views.html.fragments.forms.labeledField(signupForm("password"), "password", "Password") + @views.html.fragments.forms.labeledField(signupForm("passwordCheck"), "password", "Password check") +
+ +
+ @views.html.fragments.forms.labeledField(signupForm("firstName"), "text", "First name") + @views.html.fragments.forms.labeledField(signupForm("lastName"), "text", "Last name") + @views.html.fragments.forms.labeledField(signupForm("birthdate"), "date", "Birthdate") +
+ +
+ @views.html.fragments.forms.labeledField(signupForm("email"), "email", "E-mail address") + @views.html.fragments.forms.labeledField(signupForm("phone"), "tel", "Phone number") + @views.html.fragments.forms.labeledField(signupForm("address"), "text", "Address") + @views.html.fragments.forms.labeledField(signupForm("postalCode"), "text", "Postal code") + @views.html.fragments.forms.labeledField(signupForm("country"), "text", "Country code") +
+ + + + } + +
+
+ +} diff --git a/app/views/pages/ebeHomepage.scala.html b/app/views/pages/ebeHomepage.scala.html deleted file mode 100644 index d4fe80a..0000000 --- a/app/views/pages/ebeHomepage.scala.html +++ /dev/null @@ -1,49 +0,0 @@ -@()(implicit request : AuthRequest[AnyContent], flash: Flash, token: play.filters.csrf.CSRF.Token) - -@templates.ebe("eBé")(request.account) { - -
- @fragments.ebeMainActions() -
- -
- -
-
-
-

Get started today

-

- With @fragments.branding.ebeLogo(), the leading online auction platform, buy or sell items in a few clicks! -

-
-
- -
-
-

Buy and sell with confidence

-

- @fragments.branding.ebeLogo() guarantees all transactions for both buyers and sellers. -

-
-
- -
-
-

24/7 customer support

-

- Any question? Just ask us! Our support team is committed to help you. -

-
-
- -
-
-

Secure transactions

-

- With @fragments.branding.ebeLogo(), you are not required to give any personal information to any buyer or seller. -

-
-
-
- -} diff --git a/app/views/pages/index.scala.html b/app/views/pages/index.scala.html deleted file mode 100644 index b6e0029..0000000 --- a/app/views/pages/index.scala.html +++ /dev/null @@ -1,3 +0,0 @@ -@(message: String) - -@message diff --git a/app/views/pages/loginForm.scala.html b/app/views/pages/loginForm.scala.html deleted file mode 100644 index f359082..0000000 --- a/app/views/pages/loginForm.scala.html +++ /dev/null @@ -1,27 +0,0 @@ -@(loginForm: Form[LoginData])(implicit flash: Flash, token: play.filters.csrf.CSRF.Token) - -@templates.ebe("Log in")() { - -
-
- -

Log in

- - @views.html.fragments.forms.globalErrors(loginForm) - - @helper.form(action = routes.Authentication.loginSubmit(), 'class -> "pure-form") { - - @helper.CSRF.formField - -
- @views.html.fragments.forms.inputField(loginForm("username"), "text", "Username") - @views.html.fragments.forms.inputField(loginForm("password"), "password", "Password") -
- - - } - -
-
- -} diff --git a/app/views/pages/pepalHomepage.scala.html b/app/views/pages/pepalHomepage.scala.html deleted file mode 100644 index 9f4b227..0000000 --- a/app/views/pages/pepalHomepage.scala.html +++ /dev/null @@ -1,49 +0,0 @@ -@()(implicit request : AuthRequest[AnyContent], flash: Flash, token: play.filters.csrf.CSRF.Token) - -@templates.pepal("PéPal")(request.account) { - -
- @fragments.pepalMainActions() -
- -
- -
-
-
-

Get started today

-

- With @fragments.branding.pepalLogo(), the leading online payment solution, buy or sell items on the web in a few clicks! -

-
-
- -
-
-

Send money to friends

-

- Sending money to your friends or your family has never been easier. -

-
-
- -
-
-

24/7 customer support

-

- Any question? Just ask us! Our support team is committed to help you. -

-
-
- -
-
-

Secure transactions

-

- With @fragments.branding.pepalLogo(), you are not required to give any personal information to any buyer or seller. -

-
-
-
- -} diff --git a/app/views/pages/privacy.scala.html b/app/views/pages/privacy.scala.html deleted file mode 100644 index dd6898a..0000000 --- a/app/views/pages/privacy.scala.html +++ /dev/null @@ -1,15 +0,0 @@ -@()(implicit request: AuthRequest[AnyContent], flash: Flash, token: play.filters.csrf.CSRF.Token) - -@templates.ebe("Privacy policy")(request.account) { - -
-
-

Privacy policy

-
    -
  • We read your passwords.
  • -
  • But we do not use Google Analytics or any third-party nasty thing.
  • -
-
-
- -} 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 @@ +@(sales: Seq[Views.Sale])(implicit request: AuthRequest[AnyContent], flash: Flash, token: play.filters.csrf.CSRF.Token) + +@templates.ebe("Sales")(request.account) { + +
+ @fragments.ebeMainActions() +
+ +
+ +
+
+
+

Current sales

+ + + + + + + + + + + + + @for(sale <- sales) { + + + + + + } + + +
End dateItemCurrent price
@sale.endDate@sale.itemName@if(sale.bestOffer.isDefined) {@sale.bestOffer} else {sale.initialPrice} €
+
+
+
+ +} diff --git a/app/views/pages/signupForm.scala.html b/app/views/pages/signupForm.scala.html deleted file mode 100644 index b026167..0000000 --- a/app/views/pages/signupForm.scala.html +++ /dev/null @@ -1,43 +0,0 @@ -@(signupForm: Form[SignupData])(implicit flash: Flash, token: play.filters.csrf.CSRF.Token) - -@templates.ebe("Sign up")() { - -
-
- -

Sign up

- - @views.html.fragments.forms.globalErrors(signupForm) - - @helper.form(action = routes.Profile.signupSubmit(), 'class -> "pure-form pure-form-stacked") { - - @helper.CSRF.formField - -
- @views.html.fragments.forms.labeledField(signupForm("username"), "text", "Username") - @views.html.fragments.forms.labeledField(signupForm("password"), "password", "Password") - @views.html.fragments.forms.labeledField(signupForm("passwordCheck"), "password", "Password check") -
- -
- @views.html.fragments.forms.labeledField(signupForm("firstName"), "text", "First name") - @views.html.fragments.forms.labeledField(signupForm("lastName"), "text", "Last name") - @views.html.fragments.forms.labeledField(signupForm("birthdate"), "date", "Birthdate") -
- -
- @views.html.fragments.forms.labeledField(signupForm("email"), "email", "E-mail address") - @views.html.fragments.forms.labeledField(signupForm("phone"), "tel", "Phone number") - @views.html.fragments.forms.labeledField(signupForm("address"), "text", "Address") - @views.html.fragments.forms.labeledField(signupForm("postalCode"), "text", "Postal code") - @views.html.fragments.forms.labeledField(signupForm("country"), "text", "Country code") -
- - - - } - -
-
- -} diff --git a/app/views/pages/static/ebeHomepage.scala.html b/app/views/pages/static/ebeHomepage.scala.html new file mode 100644 index 0000000..d4fe80a --- /dev/null +++ b/app/views/pages/static/ebeHomepage.scala.html @@ -0,0 +1,49 @@ +@()(implicit request : AuthRequest[AnyContent], flash: Flash, token: play.filters.csrf.CSRF.Token) + +@templates.ebe("eBé")(request.account) { + +
+ @fragments.ebeMainActions() +
+ +
+ +
+
+
+

Get started today

+

+ With @fragments.branding.ebeLogo(), the leading online auction platform, buy or sell items in a few clicks! +

+
+
+ +
+
+

Buy and sell with confidence

+

+ @fragments.branding.ebeLogo() guarantees all transactions for both buyers and sellers. +

+
+
+ +
+
+

24/7 customer support

+

+ Any question? Just ask us! Our support team is committed to help you. +

+
+
+ +
+
+

Secure transactions

+

+ With @fragments.branding.ebeLogo(), you are not required to give any personal information to any buyer or seller. +

+
+
+
+ +} diff --git a/app/views/pages/static/index.scala.html b/app/views/pages/static/index.scala.html new file mode 100644 index 0000000..b6e0029 --- /dev/null +++ b/app/views/pages/static/index.scala.html @@ -0,0 +1,3 @@ +@(message: String) + +@message diff --git a/app/views/pages/static/pepalHomepage.scala.html b/app/views/pages/static/pepalHomepage.scala.html new file mode 100644 index 0000000..9f4b227 --- /dev/null +++ b/app/views/pages/static/pepalHomepage.scala.html @@ -0,0 +1,49 @@ +@()(implicit request : AuthRequest[AnyContent], flash: Flash, token: play.filters.csrf.CSRF.Token) + +@templates.pepal("PéPal")(request.account) { + +
+ @fragments.pepalMainActions() +
+ +
+ +
+
+
+

Get started today

+

+ With @fragments.branding.pepalLogo(), the leading online payment solution, buy or sell items on the web in a few clicks! +

+
+
+ +
+
+

Send money to friends

+

+ Sending money to your friends or your family has never been easier. +

+
+
+ +
+
+

24/7 customer support

+

+ Any question? Just ask us! Our support team is committed to help you. +

+
+
+ +
+
+

Secure transactions

+

+ With @fragments.branding.pepalLogo(), you are not required to give any personal information to any buyer or seller. +

+
+
+
+ +} diff --git a/app/views/pages/static/privacy.scala.html b/app/views/pages/static/privacy.scala.html new file mode 100644 index 0000000..dd6898a --- /dev/null +++ b/app/views/pages/static/privacy.scala.html @@ -0,0 +1,15 @@ +@()(implicit request: AuthRequest[AnyContent], flash: Flash, token: play.filters.csrf.CSRF.Token) + +@templates.ebe("Privacy policy")(request.account) { + +
+
+

Privacy policy

+
    +
  • We read your passwords.
  • +
  • But we do not use Google Analytics or any third-party nasty thing.
  • +
+
+
+ +} diff --git a/app/views/pages/static/terms.scala.html b/app/views/pages/static/terms.scala.html new file mode 100644 index 0000000..3ccadc7 --- /dev/null +++ b/app/views/pages/static/terms.scala.html @@ -0,0 +1,16 @@ +@()(implicit request: AuthRequest[AnyContent], flash: Flash, token: play.filters.csrf.CSRF.Token) + +@templates.ebe("Terms of use")(request.account) { + +
+
+

Terms of use

+
    +
  • Do not use this application.
  • +
  • You should not be reading this.
  • +
  • Close this window now.
  • +
+
+
+ +} diff --git a/app/views/pages/terms.scala.html b/app/views/pages/terms.scala.html deleted file mode 100644 index 3ccadc7..0000000 --- a/app/views/pages/terms.scala.html +++ /dev/null @@ -1,16 +0,0 @@ -@()(implicit request: AuthRequest[AnyContent], flash: Flash, token: play.filters.csrf.CSRF.Token) - -@templates.ebe("Terms of use")(request.account) { - -
-
-

Terms of use

-
    -
  • Do not use this application.
  • -
  • You should not be reading this.
  • -
  • Close this window now.
  • -
-
-
- -} -- cgit v1.2.3