]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
Continued with project:
authorRoland Haeder <roland@mxchange.org>
Wed, 2 Sep 2015 07:51:07 +0000 (09:51 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 2 Sep 2015 07:51:07 +0000 (09:51 +0200)
- converted single tables per row into one table with header and body
- added column for showing total price for item (price * amount)
- added mime-type for tpl extension
- renamed CSS id to make it more clear
- updated jshop.jar

NOTE: Please note that this change won't fully work as the product instance needs to be set in item instance now (see jshop.jar, method calculateTotalPrice())
Signed-off-by:Roland Häder <roland@mxchange.org>

lib/jshop.jar
web/WEB-INF/templates/base.tpl
web/WEB-INF/web.xml
web/index.xhtml
web/resources/css/cssLayout.css

index 7040946feab7661900cc9e1bd2142b172f8b7f66..c1ba5b8538395604c0abf9702302f1818be99371 100644 (file)
Binary files a/lib/jshop.jar and b/lib/jshop.jar differ
index 07d3cf5009448f8b960c6e6984b5b08d6627f825..bfaffe8aababbc0f16a29630b5f2b9e09f493fff 100644 (file)
@@ -23,7 +23,7 @@
                        </ui:insert>
                </div>
 
-               <div id="left_content">
+               <div id="menu_content">
                        <div id="left">
                                <ui:insert name="menu">Default menu</ui:insert>
                        </div>
index da05191b4f2913161c5e5a07f5e1b57bcebfbfa9..185adda9e1f81d6ff8dd8ce267bd4bfa31aa5d2f 100644 (file)
         <servlet-name>Faces Servlet</servlet-name>
         <url-pattern>/faces/*</url-pattern>
     </servlet-mapping>
+       <mime-mapping>
+               <extension>tpl</extension>
+               <mime-type>text/plain</mime-type>
+       </mime-mapping>
     <session-config>
         <session-timeout>
             30
index 958400dfec02c81d0a9b3fbc7f9a4a8f5c6277a6..84ab50586d334d8a2e00b595466c0599f8b415c4 100644 (file)
                        </h:panelGrid>
                        //-->
 
-                       <table class="table">
-                               <thead>
-                                       <tr>
-                                               <th colspan="4" class="table_header">
-                                                       Folgendes kann bestellt werden:
-                                               </th>
-                                       </tr>
-                               </thead>
-
-                               <tbody>
-                                       <tr>
-                                               <th class="table_header_column">
-                                                       Bestellen?
-                                               </th>
-                                               <th class="table_header_column">
-                                                       Anzahl:
-                                               </th>
-                                               <th class="table_header_column">
-                                                       Produkt:
-                                               </th>
-                                               <th class="table_header_column">
-                                                       Einzelpreis:
-                                               </th>
-                                       </tr>
-                               </tbody>
-                       </table>
-
-                       <ui:repeat var="product" value="#{controller.availableProducts}">
-                               <c:set var="isAdded" value="#{controller.basket.isAdded(product)}" />
-
-                               <ui:fragment rendered="#{isAdded == true}">
-                                       <table class="table">
-                                               <tbody>
-                                                       <tr>
-                                                               <td class="table_data_column">
-                                                                       <a href="#{basePath}/basket.jsp" title="Zum Warenkorb">Warenkorb</a>
-                                                               </td>
-
-                                                               <td class="table_data_column">
-                                                                       #{controller.basket.item.amount}
-                                                               </td>
-
-                                                               <td class="table_data_column">
-                                                                       #{product.title}
-                                                               </td>
-
-                                                               <td class="table_data_column" align="right">
-                                                                       <h:outputText class="price" value="#{product.price}">
-                                                                               <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" />
-                                                                       </h:outputText>
-                                                               </td>
-                                                       </tr>
-                                               </tbody>
-                                       </table>
-                               </ui:fragment>
-                               <ui:fragment rendered="#{isAdded == false}">
-                                       <h:form acceptcharset="utf-8" id="add_item">
-                                               <table class="table">
-                                                       <tbody>
+                       <h:form acceptcharset="utf-8" id="add_item">
+                               <table class="basket_item_table">
+                                       <thead>
+                                               <tr>
+                                                       <th colspan="4" class="table_header">
+                                                               Folgendes kann bestellt werden:
+                                                       </th>
+                                               </tr>
+
+                                               <tr>
+                                                       <th class="table_header_column">
+                                                               Bestellen?
+                                                       </th>
+
+                                                       <th class="table_header_column">
+                                                               Anzahl:
+                                                       </th>
+
+                                                       <th class="table_header_column">
+                                                               Produkt:
+                                                       </th>
+
+                                                       <th class="table_header_column">
+                                                               Einzelpreis:
+                                                       </th>
+
+                                                       <th class="table_header_column">
+                                                               Zwischensumme:
+                                                       </th>
+                                               </tr>
+                                       </thead>
+
+                                       <tbody>
+                                               <ui:repeat var="product" value="#{controller.availableProducts}">
+                                                       <c:set var="isAdded" value="#{controller.basket.isAdded(product)}" />
+
+                                                       <ui:fragment rendered="#{isAdded == true}">
+                                                               <tr>
+                                                                       <td class="table_data_column">
+                                                                               <a href="#{basePath}/basket.jsp" title="Zum Warenkorb">Warenkorb</a>
+                                                                       </td>
+
+                                                                       <td class="table_data_column">
+                                                                               #{controller.basket.item.amount}
+                                                                       </td>
+
+                                                                       <td class="table_data_column">
+                                                                               #{product.title}
+                                                                       </td>
+
+                                                                       <td class="table_data_column" align="right">
+                                                                               <h:outputText class="price" value="#{product.price}">
+                                                                                       <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" />
+                                                                               </h:outputText>
+                                                                       </td>
+
+                                                                       <td class="table_data_column" align="right">
+                                                                               <h:outputText class="price" value="#{controller.basket.item.calculateTotalPrice()}">
+                                                                                       <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" />
+                                                                               </h:outputText>
+                                                                       </td>
+                                                               </tr>
+                                                       </ui:fragment>
+                                                       <ui:fragment rendered="#{isAdded == false}">
                                                                <tr>
                                                                        <td class="table_data_column">
                                                                                <h:commandButton class="submit" id="add" value="Hinzufügen" action="#{controller.basket.addToBasket(product)}" />
                                                                                        <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" />
                                                                                </h:outputText>
                                                                        </td>
+
+                                                                       <td class="table_data_column">
+                                                                               -
+                                                                       </td>
                                                                </tr>
-                                                       </tbody>
-                                               </table>
-                                       </h:form>
-                               </ui:fragment>
-                       </ui:repeat>
+                                                       </ui:fragment>
+                                               </ui:repeat>
+                                       </tbody>
+                               </table>
+                       </h:form>
                </ui:define>
 
                <ui:define name="footer">
index 3d3b2cb117ee8d19c68aaaacf6a45be8f348f154..bbc4cead2cd7aa626396e2761e60f0051aa4892c 100644 (file)
@@ -72,6 +72,10 @@ table, .table {
        width: 500px;
 }
 
+.basket_item_table {
+       width: 600px;
+}
+
 .table_row {
        width: 100%;
 }