]> git.mxchange.org Git - pizzaservice-war.git/blob - web/WEB-INF/templates/guest/guest_index.tpl
Don't cherry-pick:
[pizzaservice-war.git] / web / WEB-INF / templates / guest / guest_index.tpl
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <ui:composition
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         >
8
9         <div class="table">
10                 <div class="table_header">
11                         <h:outputText value="#{msg.FOLLOWING_PRODUCTS_ARE_AVAILABLE}" />
12                 </div>
13         </div>
14
15         <h:dataTable id="table_show_available_products" var="product" value="#{productController.availableProducts}" styleClass="table" summary="#{msg.TABLE_SUMMARY_INDEX_PRODUCTS}">
16                 <h:column>
17                         <div id="main_item_container">
18                                 <div class="item_title">
19                                         <h:outputText value="#{product.productTitle}" />
20                                 </div>
21
22                                 <div class="item_content">
23                                         <div class="table_left">
24                                                 <div class="item_actions">
25                                                         <ui:fragment rendered="#{!basketController.isProductAdded(product)}">
26                                                                 <h:form id="add_item">
27                                                                         <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}" />
28
29                                                                         <h:inputText class="input" id="amount" size="3" maxlength="20" value="#{basketController.orderedAmount}" title="#{msg.INPUT_TITLE_ENTER_ITEM_AMOUNT}">
30                                                                                 <!--
31                                                                                 If the customer wants to order more, he need to call in.
32                                                                                 //-->
33                                                                                 <f:validator for="amount" validatorId="ItemAmountValidator" />
34                                                                         </h:inputText>
35                                                                 </h:form>
36                                                         </ui:fragment>
37
38                                                         <ui:fragment rendered="#{basketController.isProductAdded(product)}">
39                                                                 <div class="item_amount">
40                                                                         <h:outputText value="#{msg.ITEM_ORDER_AMOUNT}" />
41                                                                         <h:outputText value="#{basketController.getItemAmount(product)}" />
42                                                                 </div>
43
44                                                                 <div class="item_basket_link">
45                                                                         <h:link outcome="basket" title="#{msg.LINK_TO_BASKET_TITLE}" value="#{msg.LINK_CHANGE_IN_BASKET}" />
46                                                                 </div>
47
48                                                                 <div class="clear"></div>
49                                                         </ui:fragment>
50                                                 </div>
51                                         </div>
52
53                                         <div class="table_right">
54                                                 <div class="item_price">
55                                                         <h:outputText value="#{msg.SINGLE_PRODUCT_PRICE}" />
56                                                         <h:outputText styleClass="price" value="#{product.productPrice}">
57                                                                 <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" locale="de_DE" />
58                                                         </h:outputText>
59                                                 </div>
60
61                                                 <div class="item_total_price">
62                                                         <h:outputText value="#{msg.TOTAL_ITEM_PRICE}" />
63                                                         <h:outputText styleClass="price" value="#{msg.ITEM_NOT_ORDERED}" rendered="#{!basketController.isProductAdded(product)}" />
64                                                         <h:outputText styleClass="price" value="#{basketController.calculateCurrentItemPrice()}" rendered="#{basketController.isProductAdded(product)}">
65                                                                 <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" locale="de_DE" />
66                                                         </h:outputText>
67                                                 </div>
68                                         </div>
69
70                                         <div class="clear"></div>
71                                 </div>
72                         </div>
73                 </h:column>
74         </h:dataTable>
75
76         <div id="totals_container">
77                 <h:outputText value="#{msg.TOTAL_ORDER_PRICE}" />
78                 <h:outputText styleClass="price" id="total_sum" value="#{basketController.calculateTotalPrice()}">
79                         <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" locale="de_DE" />
80                 </h:outputText>
81         </div>
82 </ui:composition>