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