]> git.mxchange.org Git - pizzaservice-war.git/blob - index.xhtml
895fa1137460d47c4841c72045ddec5c3be46ec9
[pizzaservice-war.git] / 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 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:c="http://xmlns.jcp.org/jsp/jstl/core"
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="title">#{msg.PAGE_TITLE_INDEX_WELCOME}</ui:define>
17
18                 <ui:define name="menu">
19                         <ui:include id="menu" class="guest_menu" src="/WEB-INF/templates/guest/guest_menu.tpl" />
20                 </ui:define>
21
22                 <ui:define name="content_header">
23                         #{msg.SUB_TITLE_INDEX_WELCOME}
24                 </ui:define>
25
26                 <ui:define name="content">
27                         <div class="table">
28                                 <div class="table_header">
29                                         #{msg.FOLLOWING_PRODUCTS_ARE_AVAILABLE}
30                                 </div>
31                         </div>
32
33                         <h:dataTable value="#{controller.availableProducts}" var="product" class="table">
34                                 <h:column>
35                                         <div id="main_item_container">
36                                                 <div class="item_title">
37                                                         #{product.productTitle}
38                                                 </div>
39
40                                                 <div class="item_content">
41                                                         <div class="table_left">
42                                                                 <div class="item_actions">
43                                                                         <ui:fragment rendered="#{!basketController.isProductAdded(product)}">
44                                                                                 <h:form acceptcharset="utf-8" id="add_item">
45                                                                                         <h:commandButton class="submit" id="add" value="#{msg.ADMIN_ADD_ITEM_TO_BASKET}" action="#{basketController.addItem(product)}" title="#{msg.BUTTON_TITLE_ADD_ITEM_TO_BASKET}" />
46
47                                                                                         <h:inputText class="input" id="amount" size="3" maxlength="20" value="#{basketController.orderedAmount}" 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                                                                         </ui:fragment>
55
56                                                                         <ui:fragment rendered="#{basketController.isProductAdded(product)}">
57                                                                                 <div class="item_amount">
58                                                                                         Anzahl:
59                                                                                         #{basketController.getItemAmount(product)}
60                                                                                 </div>
61
62                                                                                 <div class="item_basket_link">
63                                                                                         <h:link outcome="basket" title="#{msg.LINK_TO_BASKET_TITLE}" value="#{msg.LINK_CHANGE_IN_BASKET}" />
64                                                                                 </div>
65
66                                                                                 <div class="clear"></div>
67                                                                         </ui:fragment>
68                                                                 </div>
69                                                         </div>
70
71                                                         <div class="table_right">
72                                                                 <div class="item_price">
73                                                                         #{msg.SINGLE_ITEM_PRICE}
74                                                                         <h:outputText class="price" value="#{product.price}">
75                                                                                 <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" locale="de_DE" />
76                                                                         </h:outputText>
77                                                                 </div>
78
79                                                                 <div class="item_total_price">
80                                                                         #{msg.TOTAL_ITEM_PRICE}
81                                                                         <h:outputText class="price" value="#{msg.ITEM_NOT_ORDERED}" rendered="#{!basketController.isProductAdded(product)}" />
82                                                                         <h:outputText class="price" value="#{basketController.calculateCurrentItemPrice()}" rendered="#{basketController.isProductAdded(product)}">
83                                                                                 <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" locale="de_DE" />
84                                                                         </h:outputText>
85                                                                 </div>
86                                                         </div>
87
88                                                         <div class="clear"></div>
89                                                 </div>
90                                         </div>
91                                 </h:column>
92                         </h:dataTable>
93
94                         <div id="totals_container">
95                                 #{msg.TOTAL_ORDER_PRICE}
96                                 <h:outputText class="price" id="total_sum" value="#{basketController.calculateTotalPrice()}">
97                                         <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" locale="de_DE" />
98                                 </h:outputText>
99                         </div>
100                 </ui:define>
101
102                 <ui:define name="footer">
103                         <ui:include id="footer" class="guest_footer" src="/WEB-INF/templates/guest/guest_footer.tpl" />
104                 </ui:define>
105         </ui:composition>
106 </html>