]> git.mxchange.org Git - pizzaservice-war.git/blob - web/basket.xhtml
a878d5634fa871d2151630c0ff95a2c3c27567ff
[pizzaservice-war.git] / web / basket.xhtml
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml"
4           xmlns:ui="http://java.sun.com/jsf/facelets"
5           xmlns:h="http://xmlns.jcp.org/jsf/html"
6           xmlns:f="http://xmlns.jcp.org/jsf/core"
7           >
8
9         <ui:composition template="/WEB-INF/templates/guest/guest_base.tpl">
10                 <ui:define name="guest_title">#{msg.PAGE_TITLE_INDEX_SHOW_BASKET}</ui:define>
11
12                 <ui:define name="menu">
13                         <ui:include id="menu" class="guest_menu" src="/WEB-INF/templates/guest/guest_menu.tpl" />
14                 </ui:define>
15
16                 <ui:define name="content_header">
17                         #{msg.SUB_TITLE_INDEX_SHOW_BASKET}
18                 </ui:define>
19
20                 <ui:define name="content">
21                         <h:dataTable var="item" value="#{basketController.allItems()}" headerClass="table_header_column" class="table" rendered="#{basketController.hasItems()}">
22                                 <h:column>
23                                         <f:facet name="header">#{msg.GUEST_ITEM_TITLE}</f:facet>
24
25                                         <ui:fragment rendered="#{item.isProductType()}">
26                                                 #{item.product.title}
27                                         </ui:fragment>
28                                 </h:column>
29
30                                 <h:column>
31                                         <f:facet name="header">#{msg.SINGLE_ITEM_PRICE}</f:facet>
32
33                                         <div class="item_price">
34                                                 <ui:fragment rendered="#{item.isProductType()}">
35                                                         <h:outputText class="price" value="#{item.product.price}">
36                                                                 <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" locale="de_DE" />
37                                                         </h:outputText>
38                                                 </ui:fragment>
39                                         </div>
40                                 </h:column>
41
42                                 <h:column>
43                                         <f:facet name="header">#{msg.CHANGE_ITEM_AMOUNT}</f:facet>
44
45                                         <h:form acceptcharset="utf-8" id="add_item">
46                                                 <h:commandButton class="submit" id="add" value="#{msg.BUTTON_CHANGE_ITEM_AMOUNT}" action="#{basketController.changeItem(item)}" title="#{msg.BUTTON_TITLE_CHANGE_ITEM_AMOUNT}" />
47
48                                                 <h:inputText class="input" id="amount" size="3" maxlength="20" value="#{item.amount}" title="#{msg.INPUT_TITLE_ENTER_ITEM_AMOUNT}">
49                                                         <!--
50                                                         If the customer wants to order more, he need to call in.
51                                                         //-->
52                                                         <f:validator for="amount" validatorId="ItemAmountValidator" />
53                                                 </h:inputText>
54                                         </h:form>
55                                 </h:column>
56
57                                 <h:column>
58                                         <f:facet name="header">#{msg.TOTAL_ITEM_PRICE}</f:facet>
59
60                                         <div class="item_total_price">
61                                                 <h:outputText class="price" id="item_price" value="#{basketController.calculateItemPrice(item)}" rendered="#{item.isProductType()}">
62                                                         <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" locale="de_DE" />
63                                                 </h:outputText>
64                                         </div>
65                                 </h:column>
66                         </h:dataTable>
67
68                         <div class="totals_container">
69                                 #{msg.TOTAL_ORDER_PRICE}
70                                 <h:outputText class="price" id="total_sum" value="#{basketController.calculateTotalPrice()}">
71                                         <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" locale="de_DE" />
72                                 </h:outputText>
73                         </div>
74
75                         <h:outputText class="empty_basket" value="#{msg.NO_ITEMS_ADDED_TO_BASKET}" rendered="#{basketController.isEmpty()}" />
76                 </ui:define>
77
78                 <ui:define name="footer">
79                         <ui:include id="footer" class="guest_footer" src="/WEB-INF/templates/guest/guest_footer.tpl" />
80                 </ui:define>
81         </ui:composition>
82 </html>