From: Roland Haeder Date: Wed, 12 Aug 2015 13:57:34 +0000 (+0200) Subject: Added new page 'products' for admin area + added CSS classes table_left/right X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=17718d22c33228fb5d21ed685fda12b87c22f7ea;p=pizzaservice-war.git Added new page 'products' for admin area + added CSS classes table_left/right Signed-off-by:Roland Häder --- diff --git a/src/java/org/mxchange/pizzaapplication/application/PizzaApplication.java b/src/java/org/mxchange/pizzaapplication/application/PizzaApplication.java index c4e98b41..3c31ab08 100644 --- a/src/java/org/mxchange/pizzaapplication/application/PizzaApplication.java +++ b/src/java/org/mxchange/pizzaapplication/application/PizzaApplication.java @@ -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); } diff --git a/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java b/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java index 09b73e05..8a8adac8 100644 --- a/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java +++ b/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java @@ -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. * diff --git a/web/admin/index.jsp b/web/admin/index.jsp index 773c1dab..b027fcb0 100644 --- a/web/admin/index.jsp +++ b/web/admin/index.jsp @@ -33,10 +33,11 @@
-

Administration:

+

Willkommen zur Administration:

+ Einiges kann hier eingestellt werden.
diff --git a/web/admin/products.jsp b/web/admin/products.jsp new file mode 100644 index 00000000..0999f8ec --- /dev/null +++ b/web/admin/products.jsp @@ -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"%> + + + + +<% + // Init application instance + PizzaApplication app = PizzaServiceApplication.getInstance(application); +%> + + + + + + <%=PizzaServiceApplication.MAIN_TITLE%> - Bestellung anzeigen + + + +
+

<%=PizzaServiceApplication.MAIN_TITLE%> - Bestellung anzeigen

+
+ + + +
+
+

Diese Produkte wurden eingestellt:

+
+ +
+
+
+ + + + + + + + + + + + <% + // "Walk" through all products and unmark them as ordered + for (final Product product : app.getUnmarkedProducts(session)) { + %> + + + + + + + <% + } + %> + + + + + +
+ Produktname: (Schlüssel) + + Produktbezeichnung: + + Einzelpreis: + + Verfügbarkeit: +
+ <%=product.getName()%> + + <%=product.getTitle()%> + + <%=product.getPrice()%> + + <%=app.getPrintableProduktAvailability(product)%> +
+
+
+ +
+
+
+
+ Neues Produkt hinzufügen: +
+ +
+ Bitte alle Felder ausfüllen: + +
+
+ Produktname: +
(z.B. italia)
+
+ +
+ +
+ +
+
+ +
+
+ Produktbezeichnung: +
(z.B. Pizza Italia)
+
+ +
+ +
+ +
+
+ +
+
+ Einzelpreis: +
(z.B. 50.0)
+
+ +
+ +
+ +
+
+
+ + +
+
+
+
+ Hinweise zum Hinzufügen von Produkten: +
    +
  • Bitte bei Produktnamen immer klein schreieben, es wird aber klein konvertiert.
  • +
  • Bitte dabei nur Zeichen von a bis z verwenden.
  • +
  • Der Produktname darf nur maximal einmal vorkommen!
  • +
  • Beim Preis keine Währungszeichen (wie € usw.) eingeben.
  • +
+
+
+
+ + diff --git a/web/preview.jsp b/web/preview.jsp index dbe8eb8e..13233c49 100644 --- a/web/preview.jsp +++ b/web/preview.jsp @@ -1,5 +1,5 @@ <%-- - Document : order + Document : preview Created on : 04.08.2015, 10:55:10 Author : Roland Haeder --%> diff --git a/web/static/admin/menu.jsp b/web/static/admin/menu.jsp index c890b6c6..8b331153 100644 --- a/web/static/admin/menu.jsp +++ b/web/static/admin/menu.jsp @@ -7,6 +7,10 @@