-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:h="http://xmlns.jcp.org/jsf/html"
- xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
- xmlns:f="http://xmlns.jcp.org/jsf/core"
- >
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
+ lang="#{localizationController.language}" xml:lang="#{localizationController.language}"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
+ xmlns:h="http://xmlns.jcp.org/jsf/html"
+ xmlns:f="http://xmlns.jcp.org/jsf/core"
+ >
<!--
TODO: Not used:
//-->
<ui:composition template="/WEB-INF/templates/guest/guest_base.tpl">
- <ui:define name="title">Willkommen!</ui:define>
-
- <ui:define name="menu">
- <ui:include id="menu" class="guest_menu" src="/WEB-INF/templates/guest/guest_menu.tpl" />
- </ui:define>
+ <ui:define name="guest_title">#{msg.PAGE_TITLE_INDEX_WELCOME}</ui:define>
<ui:define name="content_header">
- Willkommen zum Pizza-Service
+ #{msg.CONTENT_TITLE_INDEX_WELCOME}
</ui:define>
<ui:define name="content">
- <h:form acceptcharset="utf-8" id="add_item">
- <div class="table">
- <div class="table_header">
- Folgendes kann bestellt werden:
- </div>
+ <div class="table">
+ <div class="table_header">
+ #{msg.FOLLOWING_PRODUCTS_ARE_AVAILABLE}
</div>
+ </div>
- <h:dataTable value="#{controller.availableProducts}" var="product" headerClass="table_header_column" class="table">
- <h:column>
- <f:facet name="header"><h:outputText value="Bestellen?" /></f:facet>
- <h:commandButton class="submit" id="add" value="Hinzufügen" action="#{basketController.addItem(product)}" title="#{msg.BUTTON_TITLE_ADD_ITEM_TO_BASKET}" rendered="#{basketController.amount == null || basketController.amount == 0}" />
- <h:link outcome="basket" title="Zum Warenkorb" value="Warenkorb" rendered="#{basketController.amount > 0}" />
- </h:column>
+ <h:dataTable id="table_show_available_products" var="product" value="#{productController.availableProducts}" styleClass="table" summary="#{msg.TABLE_SUMMARY_INDEX_PRODUCTS}">
+ <h:column>
+ <div id="main_item_container">
+ <div class="item_title">
+ #{product.productTitle}
+ </div>
- <h:column>
- <f:facet name="header"><h:outputText value="Anzahl:" /></f:facet>
- <h:inputText class="input" id="amount" size="3" maxlength="20" value="#{basketController.amount}" title="#{msg.INPUT_TITLE_ENTER_ITEM_AMOUNT}">
- <!--
- If the customer wants to order more, he need to call in.
- //-->
- <f:validator for="amount" validatorId="ItemAmountValidator" />
- </h:inputText>
- </h:column>
+ <div class="item_content">
+ <div class="table_left">
+ <div class="item_actions">
+ <ui:fragment rendered="#{!basketController.isProductAdded(product)}">
+ <h:form id="add_item">
+ <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}" />
- <h:column>
- <f:facet name="header"><h:outputText value="Produkt:" /></f:facet>
- <h:outputText class="price" value="#{product.title}">
- <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" locale="de_DE" />
- </h:outputText>
- </h:column>
+ <h:inputText class="input" id="amount" size="3" maxlength="20" value="#{basketController.orderedAmount}" title="#{msg.INPUT_TITLE_ENTER_ITEM_AMOUNT}">
+ <!--
+ If the customer wants to order more, he need to call in.
+ //-->
+ <f:validator for="amount" validatorId="ItemAmountValidator" />
+ </h:inputText>
+ </h:form>
+ </ui:fragment>
- <h:column>
- <f:facet name="header"><h:outputText value="Einzelpreis:" /></f:facet>
- <h:outputText class="price" value="#{product.price}">
- <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" locale="de_DE" />
- </h:outputText>
- </h:column>
+ <ui:fragment rendered="#{basketController.isProductAdded(product)}">
+ <div class="item_amount">
+ #{msg.ITEM_ORDER_AMOUNT}
+ #{basketController.getItemAmount(product)}
+ </div>
- <h:column>
- <f:facet name="header"><h:outputText value="Zwischensumme:" /></f:facet>
- <h:outputText value="-" rendered="#{basketController.amount == null || basketController.amount == 0}" />
- <h:outputText value="#{basketController.calculateItemPrice}" rendered="#{basketController.amount > 0}" />
- </h:column>
- </h:dataTable>
- </h:form>
- </ui:define>
+ <div class="item_basket_link">
+ <h:link outcome="basket" title="#{msg.LINK_TO_BASKET_TITLE}" value="#{msg.LINK_CHANGE_IN_BASKET}" />
+ </div>
+
+ <div class="clear"></div>
+ </ui:fragment>
+ </div>
+ </div>
+
+ <div class="table_right">
+ <div class="item_price">
+ #{msg.SINGLE_PRODUCT_PRICE}
+ <h:outputText styleClass="price" value="#{product.productPrice}">
+ <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" locale="de_DE" />
+ </h:outputText>
+ </div>
+
+ <div class="item_total_price">
+ #{msg.TOTAL_ITEM_PRICE}
+ <h:outputText styleClass="price" value="#{msg.ITEM_NOT_ORDERED}" rendered="#{!basketController.isProductAdded(product)}" />
+ <h:outputText styleClass="price" value="#{basketController.calculateCurrentItemPrice()}" rendered="#{basketController.isProductAdded(product)}">
+ <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" locale="de_DE" />
+ </h:outputText>
+ </div>
+ </div>
+
+ <div class="clear"></div>
+ </div>
+ </div>
+ </h:column>
+ </h:dataTable>
- <ui:define name="footer">
- <ui:include id="footer" class="guest_footer" src="/WEB-INF/templates/guest/guest_footer.tpl" />
+ <div id="totals_container">
+ #{msg.TOTAL_ORDER_PRICE}
+ <h:outputText styleClass="price" id="total_sum" value="#{basketController.calculateTotalPrice()}">
+ <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" locale="de_DE" />
+ </h:outputText>
+ </div>
</ui:define>
</ui:composition>
</html>