Skip to content

Commit

Permalink
CreditCard working
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuelLR committed Feb 17, 2016
1 parent 66221c1 commit 5ef9b3c
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public ModelAndView display(){

result = new ModelAndView("creditCard/display");
result.addObject("creditCard", creditCard);
result.addObject("idCustomer", customer.getId());
result.addObject("customer", "true");

return result;
}
Expand Down Expand Up @@ -113,16 +113,13 @@ protected ModelAndView createEditModelAndView(CreditCard creditCard) {

protected ModelAndView createEditModelAndView(CreditCard creditCard, String message) {
ModelAndView result;
Customer custo;

custo = customerService.findByPrincipal();

result = new ModelAndView("creditCard/edit");
result.addObject("creditCard", creditCard);
result.addObject("message", message);
result.addObject("idCustomer", custo.getId());
result.addObject("urlAction", "creditCard/consumer/edit.do");
result.addObject("urlReturn", "creditCard/consumer/display.do");
result.addObject("customer", "true");
result.addObject("urlAction", "creditCard/customer/edit.do");
result.addObject("urlReturn", "creditCard/customer/display.do");

return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

<div>
<form:label path="${path}">
<spring:message code="${code}" />
<spring:message code="${code}" />: &nbsp;
</form:label>
<form:input path="${path}" readonly="${readonly}" />
<form:errors path="${path}" cssClass="error" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</jstl:if>

<!-- Action links -->
<jstl:if test="${idCustomer != null}">
<jstl:if test="${customer != null}">
<div>
<b><a href="creditCard/customer/edit.do">
<spring:message code="creditCard.edit" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@taglib prefix="security" uri="http://www.springframework.org/security/tags"%>
<%@taglib prefix="display" uri="http://displaytag.sf.net"%>
<%@ taglib prefix="acme" tagdir="/WEB-INF/tags" %>


<!-- Form -->
<form:form action="${urlAction}" modelAttribute="creditCard">
Expand All @@ -15,23 +17,18 @@
<!-- Editable Attributes -->

<acme:textbox code="creditCard.holderName" path="holderName" />
<br />
<acme:textbox code="creditCard.brandName" path="brandName" />
<br />
<acme:textbox code="creditCard.number" path="number" />
<br />
<acme:textbox code="creditCard.expirationMonth" path="expirationMonth" />
<br />
<acme:textbox code="creditCard.expirationYear" path="expirationYear" />
<br />
<acme:textbox code="creditCard.cvvCode" path="cvvCode" />
<br />
<br />

<!-- Action buttons -->
<input type="submit" name="save"
value="<spring:message code="creditCard.save"/>"/>
&nbsp;
<jstl:if test="${idCustomer != null}">
<jstl:if test="${customer != null}">
<input type="submit" name="delete"
value="<spring:message code="creditCard.delete"/>"/>
&nbsp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,17 @@
</security:authorize>

<security:authorize access="isAuthenticated()">
<li><a href="j_spring_security_logout"><spring:message code="master.page.logout" />(<security:authentication property="principal.username" />)</a></li>
<!-- <li><a href="j_spring_security_logout"><spring:message code="master.page.logout" />(<security:authentication property="principal.username" />)</a></li> -->
<li><a class="fNiv"><security:authentication property="principal.username" /></a>
<ul>
<li class="arrow"></li>
<li><a href="j_spring_security_logout"><spring:message code="master.page.logout" /></a></li>

<security:authorize access="hasRole('CUSTOMER')">
<li><a href="customer/customer/display.do"><spring:message code="master.page.customer.info" /></a></li>
</security:authorize>
</ul>
</li>
</security:authorize>
</ul>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ master.page.manage.service = Service
master.page.list = List
master.page.list.consumers = Consumers
master.page.list.orders = Orders
master.page.customer.info = Profile info

master.page.messages = Message Boxs
master.page.logout = Logout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ master.page.manage.service = Servicio
master.page.list = Listar
master.page.list.consumers = Consumidores
master.page.list.orders = Pedidos
master.page.customer.info = Información de perfil

master.page.messages = Mensajes
master.page.logout = Salir
Expand Down

0 comments on commit 5ef9b3c

Please sign in to comment.