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