]> git.mxchange.org Git - pizzaservice-war.git/blob - web/basket.xhtml
Please cherry-pick:
[pizzaservice-war.git] / web / basket.xhtml
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <ui:composition template="/WEB-INF/templates/guest/guest_base.tpl"
3                                 xmlns="http://www.w3.org/1999/xhtml"
4                                 xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
5                                 xmlns:h="http://xmlns.jcp.org/jsf/html"
6                                 xmlns:f="http://xmlns.jcp.org/jsf/core">
7         <ui:define name="guest_title">
8                 <h:outputText value="#{msg.PAGE_TITLE_INDEX_SHOW_BASKET}" />
9         </ui:define>
10
11         <ui:define name="content_header">
12                 <h:outputText value="#{msg.CONTENT_TITLE_INDEX_SHOW_BASKET}" />
13         </ui:define>
14
15         <ui:define name="content">
16                 <h:dataTable id="table_show_basket" var="item" value="#{basketController.allItems()}" styleClass="table" summary="#{msg.TABLE_SUMMARY_SHOW_BASKET}" rendered="#{basketController.hasItems()}">
17                         <h:column>
18                                 <f:facet name="header">
19                                         <h:outputText value="#{msg.GUEST_ITEM_TITLE}" />
20                                 </f:facet>
21
22                                 <ui:fragment rendered="#{item.isProductType()}">
23                                         <h:outputText value="#{item.itemProduct.productTitle}" />
24                                 </ui:fragment>
25                         </h:column>
26
27                         <h:column>
28                                 <f:facet name="header">
29                                         <h:outputText value="#{msg.SINGLE_PRODUCT_PRICE}" />
30                                 </f:facet>
31
32                                 <div class="item_price">
33                                         <ui:fragment rendered="#{item.isProductType()}">
34                                                 <h:outputText styleClass="price" value="#{item.itemProduct.productPrice}">
35                                                         <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" locale="de_DE" />
36                                                 </h:outputText>
37                                         </ui:fragment>
38                                 </div>
39                         </h:column>
40
41                         <h:column>
42                                 <f:facet name="header">
43                                         <h:outputText value="#{msg.CHANGE_ITEM_AMOUNT}" />
44                                 </f:facet>
45
46                                 <h:form id="form_add_item">
47                                         <h:commandButton class="submit" id="add" value="#{msg.BUTTON_CHANGE_ITEM_AMOUNT}" action="#{basketController.doChangeItem(item)}" title="#{msg.BUTTON_TITLE_CHANGE_ITEM_AMOUNT}" />
48
49                                         <h:inputText class="input" id="amount" size="3" maxlength="20" value="#{item.orderedAmount}" title="#{msg.INPUT_TITLE_ENTER_ITEM_AMOUNT}">
50                                                 <!--
51                                                 If the customer wants to order more, he need to call in.
52                                                 //-->
53                                                 <f:validator for="amount" validatorId="ItemAmountValidator" />
54                                         </h:inputText>
55                                 </h:form>
56                         </h:column>
57
58                         <h:column>
59                                 <f:facet name="header">
60                                         <h:outputText value="#{msg.TOTAL_ITEM_PRICE}" />
61                                 </f:facet>
62
63                                 <div class="item_total_price">
64                                         <h:outputText styleClass="price" id="item_price" value="#{basketController.calculateItemPrice(item)}" rendered="#{item.isProductType()}">
65                                                 <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" locale="de_DE" />
66                                         </h:outputText>
67                                 </div>
68                         </h:column>
69                 </h:dataTable>
70
71                 <ui:include src="/WEB-INF/templates/basket/total_sum.tpl" />
72
73                 <div class="continue_checkout">
74                         <h:link class="checkout_link" id="checkout" value="#{msg.LINK_CONTINUE_TO_CHECKOUT}" outcome="checkout" />
75                 </div>
76         </ui:define>
77 </ui:composition>