-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
{{end}}
diff --git a/static/images/wo-bisch-tracker-product.jpg b/static/images/wo-bisch-tracker-product.jpg
deleted file mode 100644
index 788af2c..0000000
Binary files a/static/images/wo-bisch-tracker-product.jpg and /dev/null differ
diff --git a/static/images/wo-bisch-tracker-product.png b/static/images/wo-bisch-tracker-product.png
new file mode 100644
index 0000000..ad99e68
Binary files /dev/null and b/static/images/wo-bisch-tracker-product.png differ
diff --git a/static/js/order.js b/static/js/order.js
new file mode 100644
index 0000000..b871a69
--- /dev/null
+++ b/static/js/order.js
@@ -0,0 +1,90 @@
+function validate(what, text) {
+ console.log('Validate '+what);
+ if (what == 'quantity') {
+ var re = /^[0-9]{1,2}$/;
+ } else if (what == 'email') {
+ var re = /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/;
+ } else if (what == 'delivery_address') {
+ var re = /^notpermitted$/;
+ } else if (what == 'billing_address') {
+ var re = /^notpermitted$/;
+ } else {
+ var re = /^notpermitted$/;
+ }
+ return re.test(text);
+}
+
+$(document).ready(function () {
+
+ console.log("I am ready!!!");
+ $("#quantity_exclamation").hide();
+ $("#email_exclamation").hide();
+
+ $("#modal-save").click(function() {
+ // Validation Code
+ var is_valid = true;
+ if (!validate('quantity',$('#quantity').val())) {
+ $('#quantity_errormsg').html('Ungültige Anzahl');
+ $("#quantity").addClass("is-danger");
+ $("#quantity_exclamation").show();
+ is_valid = false;
+ } else {
+ $('#quantity_errormsg').html('');
+ $("#quantity").removeClass("is-danger");
+ $("#quantity_exclamation").hide();
+ }
+
+ if (!validate('email',$('#email').val())) {
+ $('#email_errormsg').html('Ungültige E-Mail Adresse');
+ $("#email").addClass("is-danger");
+ $("#email_exclamation").show();
+ is_valid = false;
+ } else {
+ $('#email_errormsg').html('');
+ $("#email").removeClass("is-danger");
+ $("#email_exclamation").hide();
+ }
+
+ if (!(is_valid)) {
+ return;
+ }
+
+ $.ajax({
+ url: "order_tracker",
+ type: "post", //send it through post method
+ dataType: "json",
+ data: {
+ quantity: $('#quantity').val(),
+ email: $('#email').val(),
+ delivery_address: $("#delivery_address").val(),
+ billing_address: $("#billing_address").val()
+ },
+ success: function(response) {
+ console.log('order success');
+ if (response.rc == 0) {
+ console.log('response.rc == 0');
+ }
+ },
+ error: function(xhr) {
+ console.log('order error');
+ //Do Something to handle error
+ }
+ });
+
+ console.log("order");
+ $("#modal").removeClass("is-active");
+
+ });
+
+ $("#modal-close").click(function () {
+ $("#modal").removeClass("is-active");
+ });
+
+ function callback() {
+ console.log("Callback Funktion wird aufgerufen");
+ $('#quantity').focus().select();
+ }
+
+ setTimeout(callback, 10);
+});
+