This repository has been archived by the owner on May 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UI for submit delivery details finished
- Loading branch information
Showing
6 changed files
with
175 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,66 @@ | ||
package controllers; | ||
|
||
import play.data.validation.Constraints; | ||
|
||
public class DeliveryDetailsForm { | ||
@Constraints.Required | ||
private String addressLine1; | ||
@Constraints.Required | ||
private String addressLine2; | ||
@Constraints.Required | ||
private String city; | ||
@Constraints.Required | ||
private String state; | ||
@Constraints.Required | ||
private int postalCode; | ||
@Constraints.Required | ||
private String country; | ||
|
||
public String getAddressLine1() { | ||
return addressLine1; | ||
} | ||
|
||
public void setAddressLine1(String addressLine1) { | ||
this.addressLine1 = addressLine1; | ||
} | ||
|
||
public String getAddressLine2() { | ||
return addressLine2; | ||
} | ||
|
||
public void setAddressLine2(String addressLine2) { | ||
this.addressLine2 = addressLine2; | ||
} | ||
|
||
public String getCity() { | ||
return city; | ||
} | ||
|
||
public void setCity(String city) { | ||
this.city = city; | ||
} | ||
|
||
public String getState() { | ||
return state; | ||
} | ||
|
||
public void setState(String state) { | ||
this.state = state; | ||
} | ||
|
||
public int getPostalCode() { | ||
return postalCode; | ||
} | ||
|
||
public void setPostalCode(int postalCode) { | ||
this.postalCode = postalCode; | ||
} | ||
|
||
public String getCountry() { | ||
return country; | ||
} | ||
|
||
public void setCountry(String country) { | ||
this.country = country; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,44 @@ | ||
@(showInlineInstruction: Boolean, deliveryForm: Form[DeliveryDetailsForm])(implicit nav: Nav) | ||
@import helper._ | ||
@import java.util.Optional | ||
@import java.util.UUID | ||
|
||
@(showInlineInstruction: Boolean, itemId: UUID, deliveryForm: Form[DeliveryDetailsForm], errorMessage: Optional[String])(implicit nav: Nav) | ||
|
||
@* TODO: Get transaction status to show or not read-only inputs *@ | ||
@main(message("deliveryDetails")) { | ||
|
||
<h2>@message("deliveryDetails")</h2> | ||
|
||
@foundationForm(deliveryForm, routes.ItemController.createItem()) { | ||
@if(showInlineInstruction == true) { | ||
<p>@message("instruction.deliveryDetails")</p> | ||
} | ||
|
||
@foundationForm(deliveryForm, routes.TransactionController.submitDeliveryDetails(itemId.toString)) { | ||
@if(errorMessage.isPresent) { | ||
<div class="alert callout"> | ||
<i class="fi-alert"></i> @errorMessage.get() | ||
</div> | ||
} | ||
|
||
<div class="column row"> | ||
@inputText(deliveryForm("addressLine1")) | ||
</div> | ||
<div class="column row"> | ||
@inputText(deliveryForm("addressLine2")) | ||
</div> | ||
<div class="column row"> | ||
@inputText(deliveryForm("city")) | ||
</div> | ||
<div class="column row"> | ||
@inputText(deliveryForm("state")) | ||
</div> | ||
<div class="column row"> | ||
@inputText(deliveryForm("postalCode"), 'type -> "number") | ||
</div> | ||
<div class="column row"> | ||
@inputText(deliveryForm("country")) | ||
</div> | ||
|
||
<input type="submit" class="button" value="@message("submitDeliveryDetails")"/> | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters