]> git.mxchange.org Git - pizzaservice-war.git/blob - web/index.xhtml
Continued with cleanup: (please cherry-pick)
[pizzaservice-war.git] / web / index.xhtml
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html
3         lang="#{localizationController.language}" xml:lang="#{localizationController.language}"
4         xmlns="http://www.w3.org/1999/xhtml"
5         xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
6         xmlns:h="http://xmlns.jcp.org/jsf/html"
7         xmlns:f="http://xmlns.jcp.org/jsf/core"
8         >
9
10         <!--
11         TODO: Not used:
12         xmlns:basket="http://mxchange.org/jshop/tags/basket"
13         //-->
14
15         <ui:composition template="/WEB-INF/templates/guest/guest_base.tpl">
16                 <ui:define name="guest_title">#{msg.PAGE_TITLE_INDEX_WELCOME}</ui:define>
17
18                 <ui:define name="content_header">
19                         #{msg.CONTENT_TITLE_INDEX_WELCOME}
20                 </ui:define>
21
22                 <ui:define name="content">
23                         <div class="table">
24                                 <div class="table_header">
25                                         #{msg.FOLLOWING_PRODUCTS_ARE_AVAILABLE}
26                                 </div>
27                         </div>
28
29                         <h:dataTable id="table_show_available_products" var="product" value="#{productController.availableProducts}" styleClass="table" summary="#{msg.TABLE_SUMMARY_INDEX_PRODUCTS}">
30                                 <h:column>
31                                         <div id="main_item_container">
32                                                 <div class="item_title">
33                                                         #{product.productTitle}
34                                                 </div>
35
36                                                 <div class="item_content">
37                                                         <div class="table_left">
38                                                                 <div class="item_actions">
39                                                                         <ui:fragment rendered="#{!basketController.isProductAdded(product)}">
40                                                                                 <h:form id="add_item">
41                                                                                         <h:commandButton class="submit" id="add" value="#{msg.USER_ADD_ITEM_TO_BASKET}" action="#{basketController.addItem(product)}" title="#{msg.BUTTON_TITLE_ADD_ITEM_TO_BASKET}" />
42
43                                                                                         <h:inputText class="input" id="amount" size="3" maxlength="20" value="#{basketController.orderedAmount}" title="#{msg.INPUT_TITLE_ENTER_ITEM_AMOUNT}">
44                                                                                                 <!--
45                                                                                                 If the customer wants to order more, he need to call in.
46                                                                                                 //-->
47                                                                                                 <f:validator for="amount" validatorId="ItemAmountValidator" />
48                                                                                         </h:inputText>
49                                                                                 </h:form>
50                                                                         </ui:fragment>
51
52                                                                         <ui:fragment rendered="#{basketController.isProductAdded(product)}">
53                                                                                 <div class="item_amount">
54                                                                                         #{msg.ITEM_ORDER_AMOUNT}
55                                                                                         #{basketController.getItemAmount(product)}
56                                                                                 </div>
57
58                                                                                 <div class="item_basket_link">
59                                                                                         <h:link outcome="basket" title="#{msg.LINK_TO_BASKET_TITLE}" value="#{msg.LINK_CHANGE_IN_BASKET}" />
60                                                                                 </div>
61
62                                                                                 <div class="clear"></div>
63                                                                         </ui:fragment>
64                                                                 </div>
65                                                         </div>
66
67                                                         <div class="table_right">
68                                                                 <div class="item_price">
69                                                                         #{msg.SINGLE_PRODUCT_PRICE}
70                                                                         <h:outputText styleClass="price" value="#{product.productPrice}">
71                                                                                 <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" locale="de_DE" />
72                                                                         </h:outputText>
73                                                                 </div>
74
75                                                                 <div class="item_total_price">
76                                                                         #{msg.TOTAL_ITEM_PRICE}
77                                                                         <h:outputText styleClass="price" value="#{msg.ITEM_NOT_ORDERED}" rendered="#{!basketController.isProductAdded(product)}" />
78                                                                         <h:outputText styleClass="price" value="#{basketController.calculateCurrentItemPrice()}" rendered="#{basketController.isProductAdded(product)}">
79                                                                                 <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" locale="de_DE" />
80                                                                         </h:outputText>
81                                                                 </div>
82                                                         </div>
83
84                                                         <div class="clear"></div>
85                                                 </div>
86                                         </div>
87                                 </h:column>
88                         </h:dataTable>
89
90                         <div id="totals_container">
91                                 #{msg.TOTAL_ORDER_PRICE}
92                                 <h:outputText styleClass="price" id="total_sum" value="#{basketController.calculateTotalPrice()}">
93                                         <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" locale="de_DE" />
94                                 </h:outputText>
95                         </div>
96                 </ui:define>
97         </ui:composition>
98 </html>