]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
Don't cherry-pick:
authorRoland Häder <roland@mxchange.org>
Wed, 19 Apr 2017 15:19:14 +0000 (17:19 +0200)
committerRoland Häder <roland@mxchange.org>
Wed, 19 Apr 2017 15:19:14 +0000 (17:19 +0200)
- rewrote index.xhtml (guest) to more common way, even when in this project
  registration in index page is not wanted. This has the benefit that (almost)
  all JSF pages remain generic and therefor they can be cherry-picked from
  project to project.
- Now only guest_index.tpl holds the different content

Signed-off-by: Roland Häder <roland@mxchange.org>
web/WEB-INF/templates/guest/guest_index.tpl [new file with mode: 0644]
web/index.xhtml

diff --git a/web/WEB-INF/templates/guest/guest_index.tpl b/web/WEB-INF/templates/guest/guest_index.tpl
new file mode 100644 (file)
index 0000000..d4d0dde
--- /dev/null
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ui:composition
+       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"
+       >
+
+       <div class="table">
+               <div class="table_header">
+                       <h:outputText value="#{msg.FOLLOWING_PRODUCTS_ARE_AVAILABLE}" />
+               </div>
+       </div>
+
+       <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">
+                                       <h:outputText value="#{product.productTitle}" />
+                               </div>
+
+                               <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: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>
+
+                                                       <ui:fragment rendered="#{basketController.isProductAdded(product)}">
+                                                               <div class="item_amount">
+                                                                       <h:outputText value="#{msg.ITEM_ORDER_AMOUNT}" />
+                                                                       <h:outputText value="#{basketController.getItemAmount(product)}" />
+                                                               </div>
+
+                                                               <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">
+                                                       <h:outputText value="#{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">
+                                                       <h:outputText value="#{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>
+
+       <div id="totals_container">
+               <h:outputText value="#{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:composition>
index 044fe92a5de2bda3e00b23c0996c934cfec1c36b..f0f2f839ff610f530d429bb97ff8a1c81abfa12b 100644 (file)
                </ui:define>
 
                <ui:define name="content">
-                       <!-- @TODO Port this to "register-in-index-way" //-->
-                       <div class="table">
-                               <div class="table_header">
-                                       #{msg.FOLLOWING_PRODUCTS_ARE_AVAILABLE}
-                               </div>
-                       </div>
-
-                       <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">
-                                                       <h:outputText value="#{product.productTitle}" />
-                                               </div>
-
-                                               <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: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>
-
-                                                                       <ui:fragment rendered="#{basketController.isProductAdded(product)}">
-                                                                               <div class="item_amount">
-                                                                                       <h:outputText value="#{msg.ITEM_ORDER_AMOUNT}" />
-                                                                                       <h:outputText value="#{basketController.getItemAmount(product)}" />
-                                                                               </div>
-
-                                                                               <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">
-                                                                       <h:outputText value="#{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">
-                                                                       <h:outputText value="#{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>
-
-                       <div id="totals_container">
-                               <h:outputText value="#{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>
-
-                       <!--
-                       @TODO Make this working:
                        <ui:fragment rendered="#{featureController.isFeatureEnabled('user_registration_in_index')}">
                                <div class="registration_form">
                                        <ui:fragment rendered="#{featureController.isFeatureEnabled('user_register_multiple_page')}">
                        <ui:fragment rendered="#{not featureController.isFeatureEnabled('user_registration_in_index')}">
                                <ui:include src="/WEB-INF/templates/guest/guest_index.tpl" />
                        </ui:fragment>
-                       //-->
                </ui:define>
        </ui:composition>
 </html>