]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
Added new page 'products' for admin area + added CSS classes table_left/right
authorRoland Haeder <roland@mxchange.org>
Wed, 12 Aug 2015 13:57:34 +0000 (15:57 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 12 Aug 2015 13:57:34 +0000 (15:57 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/java/org/mxchange/pizzaapplication/application/PizzaApplication.java
src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java
web/admin/index.jsp
web/admin/products.jsp [new file with mode: 0644]
web/preview.jsp
web/static/admin/menu.jsp
web/static/forms/login.jsp
web/style.css

index c4e98b41aa765d5078db130441381a010d042cb5..3c31ab0863248743b931928ecd05f45edecbe1c0 100644 (file)
@@ -206,4 +206,13 @@ public interface PizzaApplication extends Application {
         * @return Unmarked products
         */
        public Product[] getProducts ();
+
+       /**
+        * Checks if given Product instance is available and returns a printable
+        * (human-readable) string.
+        * 
+        * @param product Product instance to check
+        * @return Human-readable version of product availability
+        */
+       public String getPrintableProduktAvailability (final Product product);
 }
index 09b73e05bd612f87ad8473b4c1ca0d9331ade053..8a8adac8769b233946ed8f836a83839fd5e495d6 100644 (file)
@@ -456,6 +456,18 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P
                }
        }
 
+       /**
+        * Checks if given Product instance is available and returns a printable
+        * (human-readable) string.
+        * 
+        * @param product Product instance to check
+        * @return Human-readable version of product availability
+        */
+       @Override
+       public String getPrintableProduktAvailability (final Product product) {
+               throw new UnsupportedOperationException(MessageFormat.format("Not supported yet: product={0}", product));
+       }
+
        /**
         * Some getter for printable value from session or an empty string for null.
         *
index 773c1dab8400caeee1f33b6b4107af781788a7fb..b027fcb0f9607be5b50a37fc323aee7ced1ab193 100644 (file)
 
                <div id="content_outer">
                        <div id="content_title">
-                               <h2>Administration:</h2>
+                               <h2>Willkommen zur Administration:</h2>
                        </div>
 
                        <div id="content">
+                               Einiges kann hier eingestellt werden.
                        </div>
                </div>
        </body>
diff --git a/web/admin/products.jsp b/web/admin/products.jsp
new file mode 100644 (file)
index 0000000..0999f8e
--- /dev/null
@@ -0,0 +1,169 @@
+<%-- 
+       Document   : products
+       Created on : 04.08.2015, 10:55:10
+       Author     : Roland Haeder
+--%>
+
+<%--<%@page errorPage="errorHandler.jsp" %>--%>
+<%@page import="java.util.Iterator"%>
+<%@page import="java.util.Map"%>
+<%@page import="org.mxchange.jcore.contact.Gender"%>
+<%@page import="org.mxchange.pizzaapplication.product.Product"%>
+<%@page import="org.mxchange.pizzaapplication.application.PizzaApplication"%>
+<%@page import="org.mxchange.pizzaapplication.application.PizzaServiceApplication"%>
+<%@page import="org.mxchange.pizzaapplication.beans.CustomerBean" %>
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+
+<jsp:useBean id="customer" scope="session" class="org.mxchange.pizzaapplication.customer.bean.PizzaServiceCustomerBean" type="CustomerBean" />
+<jsp:setProperty name="customer" property="*" />
+
+<%
+       // Init application instance
+       PizzaApplication app = PizzaServiceApplication.getInstance(application);
+%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
+       <head>
+               <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+               <link rel="stylesheet" href="<%=request.getContextPath()%>/style.css" type="text/css"/>
+               <title><%=PizzaServiceApplication.MAIN_TITLE%> - Bestellung anzeigen</title>
+       </head>
+
+       <body>
+               <div id="title">
+                       <h1><%=PizzaServiceApplication.MAIN_TITLE%> - Bestellung anzeigen</h1>
+               </div>
+
+               <jsp:include page="/static/admin/menu.jsp" flush="true" />
+
+               <div id="content_outer">
+                       <div id="content_title">
+                               <h2>Diese Produkte wurden eingestellt:</h2>
+                       </div>
+
+                       <div id="content">
+                               <div class="para">
+                                       <form action="<%=request.getContextPath()%>/form_handler/admin/do_products.jsp" accept-charset="utf-8" id="form" method="post">
+                                       <table class="table">
+                                               <thead class="table_header">
+                                                       <tr>
+                                                               <th class="table_header_column">
+                                                                       Produktname: (Schlüssel)
+                                                               </th>
+                                                               <th class="table_header_column">
+                                                                       Produktbezeichnung:
+                                                               </th>
+                                                               <th class="table_header_column">
+                                                                       Einzelpreis:
+                                                               </th>
+                                                               <th class="table_header_column">
+                                                                       Verfügbarkeit:
+                                                               </th>
+                                                       </tr>
+                                               </thead>
+
+                                               <tbody class="table_body">
+                                                       <%
+                                                       // "Walk" through all products and unmark them as ordered
+                                                       for (final Product product : app.getUnmarkedProducts(session)) {
+                                                               %>
+                                                               <tr>
+                                                                       <td>
+                                                                               <%=product.getName()%>
+                                                                       </td>
+                                                                       <td>
+                                                                               <%=product.getTitle()%>
+                                                                       </td>
+                                                                       <td>
+                                                                               <%=product.getPrice()%>
+                                                                       </td>
+                                                                       <td>
+                                                                               <%=app.getPrintableProduktAvailability(product)%>
+                                                                       </td>
+                                                               </tr>
+                                                               <%
+                                                       }
+                                                       %>
+
+                                                       <tr>
+                                                               <td colspan="3" class="table_footer">
+                                                                       <input type="reset" value="Formular zurücksetzen" />
+                                                                       <input type="submit" name="edit" value="Ändern" />
+                                                                       <input type="submit" name="delete" value="Löschen" />
+                                                               </td>
+                                                       </tr>
+                                               </tbody>
+                                       </table>
+                                       </form>
+                               </div>
+
+                               <div class="para">
+                                       <form action="<%=request.getContextPath()%>/form_handler/admin/do_products.jsp" accept-charset="utf-8" id="add" method="post">
+                                       <div class="table">
+                                               <div class="table_header">
+                                                       Neues Produkt hinzufügen:
+                                               </div>
+
+                                               <fieldset id="product_data">
+                                                       <legend>Bitte alle Felder ausfüllen:</legend>
+
+                                                       <div class="data_row">
+                                                               <div class="table_left">
+                                                                       Produktname:
+                                                                       <div class="tiny">(z.B. <em>italia</em>)</div>
+                                                               </div>
+
+                                                               <div class="table_right">
+                                                                       <input type="text" name="name" size="10" maxlength="255" />
+                                                               </div>
+
+                                                               <div class="clear"></div>
+                                                       </div>
+
+                                                       <div class="data_row">
+                                                               <div class="table_left">
+                                                                       Produktbezeichnung:
+                                                                       <div class="tiny">(z.B. <em>Pizza Italia</em>)</div>
+                                                               </div>
+
+                                                               <div class="table_right">
+                                                                       <input type="text" name="title" size="10" maxlength="255" />
+                                                               </div>
+
+                                                               <div class="clear"></div>
+                                                       </div>
+
+                                                       <div class="data_row">
+                                                               <div class="table_left">
+                                                                       Einzelpreis:
+                                                                       <div class="tiny">(z.B. <em>50.0</em>)</div>
+                                                               </div>
+
+                                                               <div class="table_right">
+                                                                       <input type="text" name="price" size="10" maxlength="255" />
+                                                               </div>
+
+                                                               <div class="clear"></div>
+                                                       </div>
+                                               </fieldset>
+
+                                               <div class="table_footer">
+                                                       <input type="reset" value="Formular zurücksetzen" />
+                                                       <input type="submit" name="add" value="Hinzufügen" />
+                                               </div>
+                                       </div>
+                                       </form>
+                               </div>
+                               <div class="para">
+                                       Hinweise zum Hinzufügen von Produkten:
+                                       <ul>
+                                               <li>Bitte bei Produktnamen immer klein schreieben, es wird aber klein konvertiert.</li>
+                                               <li>Bitte dabei nur Zeichen von <em>a</em> bis <em>z</em> verwenden.</li>
+                                               <li>Der Produktname darf nur maximal einmal vorkommen!</li>
+                                               <li>Beim Preis keine Währungszeichen (wie &euro; usw.) eingeben.</li>
+                                       </ul>
+                               </div>
+                       </div>
+               </div>
+       </body>
+</html>
index dbe8eb8ef73bed6392bfb728188c6a465e95271f..13233c493948efe76970b5952a3b55f536ae93cb 100644 (file)
@@ -1,5 +1,5 @@
 <%-- 
-       Document   : order
+       Document   : preview
        Created on : 04.08.2015, 10:55:10
        Author     : Roland Haeder
 --%>
index c890b6c65381f3b115fcec75d4121748d0daad03..8b33115359657eaa0a7c092866a89eedc7274d75 100644 (file)
@@ -7,6 +7,10 @@
 <div id="menu">
        <ul>
                <li><a href="<%=request.getContextPath()%>/admin/index.jsp" title="Eingangsseite">Home</a></li>
+               <li><a href="<%=request.getContextPath()%>/admin/products.jsp" title="Produkte">Produkte</a></li>
+       </ul>
+
+       <ul>
                <li><a href="<%=request.getContextPath()%>/admin/logout.jsp" title="Ausloggen">Ausloggen</a></li>
                <li><a href="<%=request.getContextPath()%>/" title="Zur Webseite, aber eingeloggt bleiben">Webseite aufrufen</a></li>
        </ul>
index 2276d934041e049a464d2f6d58dc2266831eaf4a..5d795c1a75b36c8acdd78259a58c2f29b4551b7c 100644 (file)
                                <legend title="Bitte Daten eingeben:">Bitte Daten eingeben:</legend>
 
                                <div class="table_row">
-                                       <div class="data_left">
+                                       <div class="table_left">
                                                Kundennummer:
                                        </div>
-                                       <div class="data_right">
+                                       <div class="table_right">
                                                <input type="text" name="id" size="10" maxlength="20" />
                                        </div>
                                </div>
                                <div class="clear"></div>
 
                                <div class="table_row">
-                                       <div class="data_left">
+                                       <div class="table_left">
                                                Passwort:
                                        </div>
-                                       <div class="data_right">
+                                       <div class="table_right">
                                                <input type="password" name="password" size="10" maxlength="255" />
                                        </div>
                                </div>
index c8580af0674272eadf13f296c63682b12e41aaf5..d76b2ab829d7021f3ecdc6929b46163d2b41c0d6 100644 (file)
@@ -1,4 +1,4 @@
-/*
+/**
 div {
        border: 1px solid #ff0000;
 }
@@ -18,6 +18,16 @@ div {
        float: right;
 }
 
+.table_left {
+       width: 250px;
+       float: left;
+}
+
+.table_right {
+       width: 150px;
+       float: right;
+}
+
 .clear {
        clear: both;
 }
@@ -34,3 +44,7 @@ table, .table {
 .table_row {
        width: 300px;
 }
+
+.para {
+       padding: 5px 5px 5px 5px;
+}