]> git.mxchange.org Git - pizzaservice-war.git/blob - web/index.xhtml
Added missing init() method + renamed localInit() -> genericInit()
[pizzaservice-war.git] / web / index.xhtml
1 <html xmlns="http://www.w3.org/1999/xhtml"
2           xmlns:ui="http://java.sun.com/jsf/facelets"
3           xmlns:h="http://xmlns.jcp.org/jsf/html"
4           xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
5           xmlns:f="http://xmlns.jcp.org/jsf/core"
6           >
7
8         <!--
9         TODO: Not used:
10         xmlns:basket="http://mxchange.org/jshop/tags/basket"
11         //-->
12
13         <ui:composition template="/WEB-INF/templates/guest/guest_base.tpl">
14                 <ui:define name="title">Willkommen!</ui:define>
15
16                 <ui:define name="menu">
17                         <ui:include id="menu" class="guest_menu" src="/WEB-INF/templates/guest/guest_menu.tpl" />
18                 </ui:define>
19
20                 <ui:define name="content_header">
21                         Eingangsseite (dummy)
22                 </ui:define>
23
24                 <ui:define name="content">
25                         <!--
26                         TODO Not used!
27                         <h:panelGrid class="basket_item_table" columnClasses="table_data_column" headerClass="table_header_column">
28                                 <f:facet name="header">
29                                         Bestellen? Bestellmenge: Produkt: Einzelpreis:
30                                 </f:facet>
31                         </h:panelGrid>
32                         //-->
33
34                         <h:form acceptcharset="utf-8" id="add_item">
35                                 <table class="basket_item_table">
36                                         <thead>
37                                                 <tr>
38                                                         <th colspan="5" class="table_header">
39                                                                 Folgendes kann bestellt werden:
40                                                         </th>
41                                                 </tr>
42
43                                                 <tr>
44                                                         <th class="table_header_column">
45                                                                 Bestellen?
46                                                         </th>
47
48                                                         <th class="table_header_column">
49                                                                 Anzahl:
50                                                         </th>
51
52                                                         <th class="table_header_column">
53                                                                 Produkt:
54                                                         </th>
55
56                                                         <th class="table_header_column">
57                                                                 Einzelpreis:
58                                                         </th>
59
60                                                         <th class="table_header_column">
61                                                                 Zwischensumme:
62                                                         </th>
63                                                 </tr>
64                                         </thead>
65
66                                         <tbody>
67                                                 <ui:repeat var="product" value="#{controller.availableProducts}">
68                                                         <!-- Cache isAdded call to reduce calls //-->
69                                                         <c:set var="isAdded" value="#{basket.isAdded(product)}" />
70
71                                                         <ui:fragment rendered="#{isAdded == true}">
72                                                                 <tr>
73                                                                         <td class="table_data_column">
74                                                                                 <h:link outcome="basket" title="Zum Warenkorb" value="Warenkorb" />
75                                                                         </td>
76
77                                                                         <td class="table_data_column">
78                                                                                 #{basket.item.amount}
79                                                                         </td>
80
81                                                                         <td class="table_data_column">
82                                                                                 #{product.title}
83                                                                         </td>
84
85                                                                         <td class="table_data_column" align="right">
86                                                                                 <h:outputText class="price" value="#{product.price}">
87                                                                                         <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" />
88                                                                                 </h:outputText>
89                                                                         </td>
90
91                                                                         <td class="table_data_column" align="right">
92                                                                                 <h:outputText class="price" value="#{basket.item.calculateTotalPrice()}">
93                                                                                         <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" />
94                                                                                 </h:outputText>
95                                                                         </td>
96                                                                 </tr>
97                                                         </ui:fragment>
98
99                                                         <ui:fragment rendered="#{isAdded == false}">
100                                                                 <tr>
101                                                                         <td class="table_data_column">
102                                                                                 <h:commandButton class="submit" id="add" value="Hinzufügen" action="#{basket.addToBasket(product)}" />
103                                                                                 <h:inputHidden id="itemId" value="#{product.itemId}" />
104                                                                                 <h:inputHidden id="itemType" value="Product" />
105                                                                         </td>
106
107                                                                         <td class="table_data_column">
108                                                                                 <h:inputText class="input" id="amount" size="3" maxlength="20">
109                                                                                         <!--
110                                                                                         If the customer wants to order more, he need to call in.
111                                                                                         //-->
112                                                                                         <f:validateLongRange minimum="1" maximum="10" />
113                                                                                 </h:inputText>
114                                                                         </td>
115
116                                                                         <td class="table_data_column">
117                                                                                 #{product.title}
118                                                                         </td>
119
120                                                                         <td class="table_data_column" align="right">
121                                                                                 <h:outputText class="price" value="#{product.price}">
122                                                                                         <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" />
123                                                                                 </h:outputText>
124                                                                         </td>
125
126                                                                         <td class="table_data_column" align="right">
127                                                                                 -
128                                                                         </td>
129                                                                 </tr>
130                                                         </ui:fragment>
131                                                 </ui:repeat>
132                                         </tbody>
133                                 </table>
134                         </h:form>
135                 </ui:define>
136
137                 <ui:define name="footer">
138                         <ui:include id="footer" class="guest_footer" src="/WEB-INF/templates/guest/guest_footer.tpl" />
139                 </ui:define>
140         </ui:composition>
141 </html>