Skip to content

Commit

Permalink
feature/Wireframs Expenditures WIP 1
Browse files Browse the repository at this point in the history
  • Loading branch information
constantine2nd committed Oct 6, 2021
1 parent 41fa7d0 commit de4b75f
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 16 deletions.
13 changes: 8 additions & 5 deletions src/main/resources/i18n/lift-core.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ enter_label = Enter a label...
create_account_label = Create a bank account
bank_name = Bank name
account_label = Account label
income_description = Income description
income_amount = Income amount
payment_description = payment description
payment_amount = payment amount
income_description = Description
income_amount = Amount \u20ac
payment_description = Description
payment_amount = Amount \u20ac
income = Income
payment = Expenditure
payment = Expenditure
add_expenditure = Add expenditure
add_income = Add income
button.save = Save
12 changes: 7 additions & 5 deletions src/main/resources/i18n/lift-core_en_GB.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ enter_label = Enter a label...
create_account_label = Create a bank account
bank_name = Bank name
account_label = Account label
income_description = Income description
income_amount = Income amount
payment_description = payment description
payment_amount = payment amount
income_description = Description
income_amount = Amount \u20ac
payment_description = Description
payment_amount = Amount \u20ac
income = Income
payment = Expenditure
payment = Expenditure
add_expenditure = Add expenditure
button.save = Save
4 changes: 2 additions & 2 deletions src/main/scala/code/snippet/CreateExpenditure.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package code.snippet
import code.Constant._
import code.lib.ObpAPI.{createOutcome, getAccount}
import code.util.Helper.{MdcLoggable, getAccountTitle}
import net.liftweb.http.SHtml
import net.liftweb.http.{S, SHtml}
import net.liftweb.http.js.JE.Call
import net.liftweb.http.js.JsCmd
import net.liftweb.http.js.JsCmds.SetHtml
Expand Down Expand Up @@ -40,7 +40,7 @@ class CreateExpenditure(params: List[String]) extends MdcLoggable {
"@payment_description" #> SHtml.text("", s => outcomeDescription = s) &
"@payment_amount" #> SHtml.text("", s => outcomeAmount = s) &
// Replace the type=submit with Javascript that makes the ajax call.
"type=submit" #> SHtml.ajaxSubmit("Add payment", process)
"type=submit" #> SHtml.ajaxSubmit(S.?("button.save"), process)
).apply(xhtml)
}
}
4 changes: 2 additions & 2 deletions src/main/scala/code/snippet/CreateIncome.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package code.snippet
import code.Constant._
import code.lib.ObpAPI.{createIncome, getAccount}
import code.util.Helper.{MdcLoggable, getAccountTitle}
import net.liftweb.http.SHtml
import net.liftweb.http.{S, SHtml}
import net.liftweb.http.js.JE.Call
import net.liftweb.http.js.JsCmd
import net.liftweb.http.js.JsCmds.SetHtml
Expand Down Expand Up @@ -40,7 +40,7 @@ class CreateIncome(params: List[String]) extends MdcLoggable {
"@income_description" #> SHtml.text("", s => incomeDescription = s) &
"@income_amount" #> SHtml.text("", s => incomeAmount = s) &
// Replace the type=submit with Javascript that makes the ajax call.
"type=submit" #> SHtml.ajaxSubmit("Add income", process)
"type=submit" #> SHtml.ajaxSubmit(S.?("button.save"), process)
).apply(xhtml)
}
}
7 changes: 7 additions & 0 deletions src/main/scala/code/snippet/WebUI.scala
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ class WebUI extends MdcLoggable{
"#change-password-link a [href]" #> scala.xml.Unparsed(s"$host/user_mgt/change_password")
}

def homePage = {
val host = Props.get("base_url").getOrElse("unknown")
"#uk a [href]" #> scala.xml.Unparsed(s"$host/?locale=en_GB") &
"#it a [href]" #> scala.xml.Unparsed(s"$host/?locale=it_IT") &
"#ua a [href]" #> scala.xml.Unparsed(s"$host/?locale=uk_UA")
}

def setForgottenPasswordLink = {
val host = Props.get("api_portal_hostname").or(Props.get("api_hostname")).getOrElse("unknown")
"#reset-password-link a [href]" #> scala.xml.Unparsed(s"$host/user_mgt/lost_password")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ <h3 id="account-title" class="account-info__box-headline account-title">ACCOUNT<
</div>

<div class="create-income-section" data-lift="CreateExpenditure.addPayment">
<h4><span class="lift:Loc.payment">Payment</span></h4>
<h4><span class="lift:Loc.add_expenditure">Expenditure</span></h4>
<form data-lift="form.ajax">
<div>
<label for="payment_description">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ <h3 id="account-title" class="account-info__box-headline account-title">ACCOUNT<
</div>

<div class="create-income-section" data-lift="CreateIncome.addIncome">
<h4><span class="lift:Loc.income">Income</span></h4>
<h4><span class="lift:Loc.add_income">Add income...</span></h4>
<form data-lift="form.ajax">
<div>
<label for="income_description">
Expand Down
6 changes: 6 additions & 0 deletions src/main/webapp/templates-hidden/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@
<a href="#" class="footer-box__link"><img src="/media/images/logo-footer.png" alt="TESOBE Logo" class="footer-box__logo"></a>
</div>
</div>
<div class="footer-content-wrapper" data-lift="WebUI.homePage">
<a href="#" >Language </a>
<a id="uk" href="/" > UK </a>
<a id="it" href="/" >| IT </a>
<a id="ua" href="/" >| UA </a>
</div>
<div class="footer-links-box" data-lift="WebUI.hideTwitterLink">
<a href="http://twitter.com/#!/OpenBankProject" id="twitter_link" class="footer-link-box__link">Twitter</a>
<a href="https://github.com/OpenBankProject/Social-Finance" class="footer-link-box__link">Github</a>
Expand Down

0 comments on commit de4b75f

Please sign in to comment.