gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-codeless] branch master updated: improvement in comp


From: gnunet
Subject: [GNUnet-SVN] [taler-codeless] branch master updated: improvement in complete architecture
Date: Fri, 20 Jul 2018 03:13:07 +0200

This is an automated email from the git hooks/post-receive script.

shivam-kohli pushed a commit to branch master
in repository codeless.

The following commit(s) were added to refs/heads/master by this push:
     new 94be0d7  improvement in complete architecture
94be0d7 is described below

commit 94be0d7216ec3c5f253b895681b11e7b0678211a
Author: shivam kohli <address@hidden>
AuthorDate: Fri Jul 20 06:42:51 2018 +0530

    improvement in complete architecture
---
 codeless/urls.py                                   |   3 +
 inventory/forms.py                                 |  11 ++
 inventory/migrations/0001_initial.py               |   5 +-
 inventory/migrations/0002_auto_20180709_1228.py    |  19 ---
 inventory/models.py                                |   2 +
 inventory/views.py                                 | 143 +++++++++++++++--
 .../{new_product.html => digital_inventory.html}   |  17 --
 templates/inventory/fulfillment.html               |  93 ++++++++++-
 templates/inventory/home.html                      |   3 +-
 templates/inventory/index.html                     |  91 ++++++++---
 templates/inventory/login.html                     | 171 +++++++++++++++------
 templates/inventory/new_product.html               |  67 ++++++--
 templates/inventory/order.html                     |  13 ++
 templates/inventory/shipment_details.html          |   2 +-
 templates/inventory/signup.html                    | 165 +++++++++++++++-----
 15 files changed, 634 insertions(+), 171 deletions(-)

diff --git a/codeless/urls.py b/codeless/urls.py
index 61b621d..10b6aa3 100644
--- a/codeless/urls.py
+++ b/codeless/urls.py
@@ -17,9 +17,12 @@ urlpatterns = [
     url(r'^pay/$', 'inventory.views.pay', name='pay'),
     url(r'^signup/$', 'inventory.views.signup', name='signup'),
     url(r'^new_product/$', 'inventory.views.new_product', name='new_product'),
+    url(r'^digital_inventory/$', 'inventory.views.digital_inventory', 
name='digital_inventory'),
     url(r'^add_product/$', 'inventory.views.add_product', name='add_product'),
     url(r'^update_stock/(?P<uid>[\*\w\-]+)$',
         'inventory.views.update_stock', name='update_stock'),
+    url(r'^update_status/(?P<uid>[\*\w\-]+)$',
+        'inventory.views.update_status', name='update_status'),
     url(r'^home/product/(?P<uid>[\*\w\-]+)$',
         'inventory.views.product', name='product'),
     url(r'^home/$', 'inventory.views.home', name='home'),
diff --git a/inventory/forms.py b/inventory/forms.py
index dd77769..b4b35e6 100644
--- a/inventory/forms.py
+++ b/inventory/forms.py
@@ -42,6 +42,12 @@ class SignUpForm(UserCreationForm):
             'password2',
             )
 
+    def __init__(self, *args, **kwargs):
+        super(SignUpForm, self).__init__(*args, **kwargs)
+
+        for fieldname in ['username', 'password1', 'password2']:
+            self.fields[fieldname].help_text = None
+
 
 class MerchantDetailForm(forms.ModelForm):
     class Meta:
@@ -56,6 +62,11 @@ class LoginForm(forms.ModelForm):
             "username", 
             "password"
             )
+    def __init__(self, *args, **kwargs):
+        super(LoginForm, self).__init__(*args, **kwargs)
+
+        for fieldname in ['username', 'password']:
+            self.fields[fieldname].help_text = None
 
 
 class DocumentForm(forms.ModelForm):
diff --git a/inventory/migrations/0001_initial.py 
b/inventory/migrations/0001_initial.py
index f42be67..79e4971 100644
--- a/inventory/migrations/0001_initial.py
+++ b/inventory/migrations/0001_initial.py
@@ -24,11 +24,12 @@ class Migration(migrations.Migration):
         migrations.CreateModel(
             name='Order',
             fields=[
-                ('id', models.AutoField(verbose_name='ID', primary_key=True, 
serialize=False, auto_created=True)),
                 ('order_id', models.CharField(max_length=300, blank=True, 
null=True)),
+                ('uid', models.AutoField(primary_key=True, serialize=False)),
                 ('summary', models.CharField(max_length=300, blank=True, 
null=True)),
                 ('order_date', models.DateTimeField(auto_now=True)),
                 ('address', models.CharField(max_length=250, blank=True, 
null=True)),
+                ('status', models.CharField(max_length=50, blank=True, 
null=True)),
                 ('merchant', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
             ],
         ),
@@ -79,6 +80,6 @@ class Migration(migrations.Migration):
         migrations.AddField(
             model_name='order',
             name='product_id',
-            field=models.ManyToManyField(null=True, to='inventory.Product'),
+            field=models.ManyToManyField(blank=True, to='inventory.Product'),
         ),
     ]
diff --git a/inventory/migrations/0002_auto_20180709_1228.py 
b/inventory/migrations/0002_auto_20180709_1228.py
deleted file mode 100644
index ffcccd9..0000000
--- a/inventory/migrations/0002_auto_20180709_1228.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('inventory', '0001_initial'),
-    ]
-
-    operations = [
-        migrations.AlterField(
-            model_name='order',
-            name='product_id',
-            field=models.ManyToManyField(blank=True, to='inventory.Product'),
-        ),
-    ]
diff --git a/inventory/models.py b/inventory/models.py
index 09d3606..9fc1539 100644
--- a/inventory/models.py
+++ b/inventory/models.py
@@ -82,11 +82,13 @@ class Order(models.Model):
     These details will be used to make request to the Merchant Backend API
     """
     order_id = models.CharField(max_length=300, blank=True, null=True)
+    uid = models.AutoField(primary_key=True)
     product_id = models.ManyToManyField(Product, blank=True)
     summary = models.CharField(max_length=300, blank=True, null=True)
     order_date = models.DateTimeField(auto_now=True)
     address = models.CharField(max_length=250, blank=True, null=True)
     merchant = models.ForeignKey(User, on_delete=models.CASCADE)
+    status = models.CharField(max_length=50, blank=True, null=True)
 
     def __str__(self):
         return self.summary
diff --git a/inventory/views.py b/inventory/views.py
index 1896f4c..e8b4686 100644
--- a/inventory/views.py
+++ b/inventory/views.py
@@ -42,6 +42,65 @@ from django.http import JsonResponse
 BACKEND_URL = "https://backend.demo.taler.net/";
 
 
+def mime_content_type(filename):
+    """Get mime type
+    """
+    mime_types = dict(
+        txt='text/plain',
+        htm='text/html',
+        html='text/html',
+        php='text/html',
+        css='text/css',
+        js='application/javascript',
+        json='application/json',
+        xml='application/xml',
+        swf='application/x-shockwave-flash',
+        flv='video/x-flv',
+        # images
+        png='image/png',
+        jpe='image/jpeg',
+        jpeg='image/jpeg',
+        jpg='image/jpeg',
+        gif='image/gif',
+        bmp='image/bmp',
+        ico='image/vnd.microsoft.icon',
+        tiff='image/tiff',
+        tif='image/tiff',
+        svg='image/svg+xml',
+        svgz='image/svg+xml',
+        # archives
+        zip='application/zip',
+        rar='application/x-rar-compressed',
+        exe='application/x-msdownload',
+        msi='application/x-msdownload',
+        cab='application/vnd.ms-cab-compressed',
+        # audio/video
+        mp3='audio/mpeg',
+        ogg='audio/ogg',
+        qt='video/quicktime',
+        mov='video/quicktime',
+        # adobe
+        pdf='application/pdf',
+        psd='image/vnd.adobe.photoshop',
+        ai='application/postscript',
+        eps='application/postscript',
+        ps='application/postscript',
+        # ms office
+        doc='application/msword',
+        rtf='application/rtf',
+        xls='application/vnd.ms-excel',
+        ppt='application/vnd.ms-powerpoint',
+        # open office
+        odt='application/vnd.oasis.opendocument.text',
+        ods='application/vnd.oasis.opendocument.spreadsheet',
+    )
+    ext = filename.split('.')[-1].lower()
+    if ext in mime_types:
+        return mime_types[ext]
+    else:
+        return 'application/octet-stream'
+
+
 def fulfillment(request):
     """ This function is responsible for redirecting to a
     page after successfully payment is done.
@@ -57,11 +116,48 @@ def fulfillment(request):
         if product[item].document:
             filename = product[item].document.file.name.split('/')[-1]
             file = product[item].document.file
-            response = HttpResponse(file, content_type='application/pdf')
+            mime = mime_content_type(filename)
+            response = HttpResponse(file, content_type=mime)
             response['Content-Disposition'] = 'inline; filename=%s' % filename
             return response
         else:
-            return render(request, 'inventory/fulfillment.html')
+            context_dict = {}
+            context_dict['name'] = product[item].name
+            context_dict['price'] = product[item].price
+            context_dict['delivery_date'] = order_instance.order_date
+            context_dict['address'] = order_instance.address
+            if order_instance.status=='order_processing':
+                context_dict['order_processing'] = 'True'
+                context_dict['pre_production'] = 'False'
+                context_dict['in_production'] = 'False'
+                context_dict['shipped'] = 'False'
+                context_dict['delivered'] = 'False'
+            elif order_instance.status=='pre_production':
+                context_dict['order_processing'] = 'True'
+                context_dict['pre_production'] = 'True'
+                context_dict['in_production'] = 'False'
+                context_dict['shipped'] = 'False'
+                context_dict['delivered'] = 'False'
+            elif order_instance.status=='in_production':
+                context_dict['order_processing'] = 'True'
+                context_dict['pre_production'] = 'True'
+                context_dict['in_production'] = 'True'
+                context_dict['shipped'] = 'False'
+                context_dict['delivered'] = 'False'
+            elif order_instance.status=='shipped':
+                context_dict['order_processing'] = 'True'
+                context_dict['pre_production'] = 'True'
+                context_dict['in_production'] = 'True'
+                context_dict['shipped'] = 'True'
+                context_dict['delivered'] = 'False'
+            else:
+                context_dict['order_processing'] = 'True'
+                context_dict['pre_production'] = 'True'
+                context_dict['in_production'] = 'True'
+                context_dict['shipped'] = 'True'
+                context_dict['delivered'] = 'True'
+            print(context_dict)
+            return render(request, 'inventory/fulfillment.html', context_dict)
 
 
 def shipment(request):
@@ -99,6 +195,7 @@ def order(request):
         data['summary'] = i.summary
         data['order_date'] = i.order_date
         data['address'] = i.address
+        data['url'] = "/update_status/"+str(i.uid)
         array.append(data)
     context_dict['data'] = array
     return render(request, 'inventory/order.html', context_dict)
@@ -127,7 +224,9 @@ def pay(request):
         order_instance = Order.objects.create(
             order_id=contract_terms["order_id"],
             summary=contract_terms["summary"],
-            merchant=User.objects.get(username=merchant)
+            merchant=User.objects.get(username=merchant),
+            status="order_processing",
+            address=contract_terms["extra"]["address"]
             )
         order_instance.save()
         for i in contract_terms['products']:
@@ -152,7 +251,7 @@ def payment(request):
     price = request.GET.get('price')
     merchant = request.GET.get('merchant')
     # name_user = request.GET.get('name_user')
-    # address_user = request.GET.get('address_user')
+    address_user = request.GET.get('address_user')
     summary = name+' purchased from '+merchant
     user = User.objects.get(username=merchant)
     primary_key = user.pk
@@ -161,6 +260,7 @@ def payment(request):
     # Creating an Order for a Payment
     order = dict(order=dict(amount="KUDOS:"+price,
         summary=summary,
+        extra=dict(address=address_user),
         products=[
             dict(
                 description=name,
@@ -181,6 +281,7 @@ def payment(request):
     )
     order_resp = backend_post("order", order)
     try:
+        print(order_resp)
         order_id = order_resp["order_id"]
     except Exception as e:
         return HttpResponse("Please refresh and try again")
@@ -204,7 +305,8 @@ def payment(request):
 def backend_get(endpoint, params):
     headers = {"Authorization": "ApiKey sandbox"}
     try:
-        resp = requests.get(urljoin(BACKEND_URL, endpoint),
+        resp_url = urljoin(BACKEND_URL, endpoint)
+        resp = requests.get(resp_url,
             params=params,
             headers=headers)
     except requests.ConnectionError:
@@ -223,6 +325,7 @@ def backend_post(endpoint, json):
         resp = requests.post(resp_url,
             json=json,
             headers=headers)
+        print(resp)
     except requests.ConnectionError:
         return HttpResponse("Could not establish connection to backend")
     try:
@@ -234,9 +337,12 @@ def backend_post(endpoint, json):
 
 def update_inventory(name, quantity):
     product_instance = Product.objects.get(name=name)
-    inventory_on_hand = product_instance.inventory_on_hand - quantity
-    product_instance.inventory_on_hand = inventory_on_hand
-    product_instance.save()
+    if product_instance.document:
+        pass
+    else:
+        inventory_on_hand = product_instance.inventory_on_hand - quantity
+        product_instance.inventory_on_hand = inventory_on_hand
+        product_instance.save()
 
 
 @login_required
@@ -277,6 +383,15 @@ def update_stock(request, uid):
 
 
 @login_required
+def update_status(request, uid):
+    order_instance = Order.objects.get(uid=uid)
+    order_instance.status = request.POST.get('status')
+    print(request.POST.get('status'))
+    order_instance.save()
+    return redirect('order')
+
+
address@hidden
 def add_product(request):
     """ When a merchant is required to add a new product in his
     inventory this function is invoked.
@@ -327,12 +442,20 @@ def product(request, uid):
     base_url = request.build_absolute_uri().rsplit('/', 3)[0]
     merchant = request.user.username
     parameters = "name="+item.name+'&price='+item.price+'&merchant='+merchant
-    context_dict['href'] = base_url+"/shipment?"+parameters
+    if item.document:
+        context_dict['href'] = base_url+"/payment?"+parameters
+    else:
+        context_dict['href'] = base_url+"/shipment?"+parameters
     return render(request, 'inventory/product.html', context_dict)
 
 
 @login_required
 def new_product(request):
+    return render(request, 'inventory/new_product.html')
+
+
address@hidden
+def digital_inventory(request):
     if request.method == 'POST':
         form = DocumentForm(request.POST, request.FILES)
         if form.is_valid():
@@ -352,7 +475,7 @@ def new_product(request):
             return redirect('home')
     else:
         form = DocumentForm()
-    return render(request, 'inventory/new_product.html', {
+    return render(request, 'inventory/digital_inventory.html', {
         'form': form
     })
 
diff --git a/templates/inventory/new_product.html 
b/templates/inventory/digital_inventory.html
similarity index 83%
copy from templates/inventory/new_product.html
copy to templates/inventory/digital_inventory.html
index 5e81f4e..da015a0 100644
--- a/templates/inventory/new_product.html
+++ b/templates/inventory/digital_inventory.html
@@ -145,22 +145,6 @@ with the Taler Codeless Merchant.  If not, see 
<https://www.gnu.org/licenses/>.
 
     <section id="contact">
         <div class="container">
-            <form name="add_product_form" action="/add_product/" method="post" 
enctype="multipart/form-data">
-
-                {% csrf_token %}
-                <input type="text" name="name" id="name" placeholder="Name" 
required>
-                <textarea type="text" name="description" id="description" 
placeholder="Description" required></textarea>
-                <input type="text" name="price" id="price" placeholder="Price" 
required>
-                <input type="number" name="starting_inventory" 
id="starting_inventory" placeholder="Starting Inventory" required>
-                <input type="number" name="minimum_required" 
id="minimum_required" placeholder="Minimum Quantity Required" required>
-                <button name="add_product" type="submit" class="submit">Add 
Product</button>
-              
-            </form>
-        </div>
-    </section>
-
-    <section id="contact">
-        <div class="container">
           <form method="post" enctype="multipart/form-data">
           <form method="post" enctype="multipart/form-data">
           <h1>FOR DIGITAL INVENTORY</h1>
@@ -172,6 +156,5 @@ with the Taler Codeless Merchant.  If not, see 
<https://www.gnu.org/licenses/>.
     </section>
 
 </div>
-
 </body>
 </html>
\ No newline at end of file
diff --git a/templates/inventory/fulfillment.html 
b/templates/inventory/fulfillment.html
index 4e5c608..14d9e46 100644
--- a/templates/inventory/fulfillment.html
+++ b/templates/inventory/fulfillment.html
@@ -21,9 +21,98 @@ with the Taler Codeless Merchant.  If not, see 
<https://www.gnu.org/licenses/>.
 <html>
 <head>
        <title></title>
+       <style type="text/css">
+               ol.progtrckr {
+           margin: 0;
+           padding: 0;
+           list-style-type none;
+       }
+
+       ol.progtrckr li {
+           display: inline-block;
+           text-align: center;
+           line-height: 3.5em;
+       }
+
+       ol.progtrckr[data-progtrckr-steps="2"] li { width: 49%; }
+       ol.progtrckr[data-progtrckr-steps="3"] li { width: 33%; }
+       ol.progtrckr[data-progtrckr-steps="4"] li { width: 24%; }
+       ol.progtrckr[data-progtrckr-steps="5"] li { width: 19%; }
+       ol.progtrckr[data-progtrckr-steps="6"] li { width: 16%; }
+       ol.progtrckr[data-progtrckr-steps="7"] li { width: 14%; }
+       ol.progtrckr[data-progtrckr-steps="8"] li { width: 12%; }
+       ol.progtrckr[data-progtrckr-steps="9"] li { width: 11%; }
+
+       ol.progtrckr li.progtrckr-done {
+           color: black;
+           border-bottom: 4px solid yellowgreen;
+       }
+       ol.progtrckr li.progtrckr-todo {
+           color: silver; 
+           border-bottom: 4px solid silver;
+       }
+
+       ol.progtrckr li:after {
+           content: "\00a0\00a0";
+       }
+       ol.progtrckr li:before {
+           position: relative;
+           bottom: -2.5em;
+           float: left;
+           left: 50%;
+           line-height: 1em;
+       }
+       ol.progtrckr li.progtrckr-done:before {
+           content: "\2713";
+           color: white;
+           background-color: yellowgreen;
+           height: 2.2em;
+           width: 2.2em;
+           line-height: 2.2em;
+           border: none;
+           border-radius: 2.2em;
+       }
+       ol.progtrckr li.progtrckr-todo:before {
+           content: "\039F";
+           color: silver;
+           background-color: white;
+           font-size: 2.2em;
+           bottom: -1.2em;
+       }
+
+       </style>
 </head>
 <body>
-Thank you for purchasing.
-</form>
+Thank you for purchasing {{  name }} of price {{  price }}. The Product was 
successfully placed on {{  delivery_date }} Your product will be delivered to 
you on the address {{  address }}
+</br></br></br></br></br></br></br>
+<h1>SHIPMENT TRACKING</h1>
+<ol class="progtrckr" data-progtrckr-steps="5">
+    <li class="progtrckr-done">Order Processing</li>
+
+    {% if  pre_production == 'True' %}
+           <li class="progtrckr-done">Pre-Production</li>
+    {% else %}
+           <li class="progtrckr-todo">Pre-Production</li>
+       {% endif %}
+
+       {% if  in_production == 'True' %}
+           <li class="progtrckr-done">In Production</li>
+    {% else %}
+           <li class="progtrckr-todo">In Production</li>
+       {% endif %}
+
+       {% if  shipped == 'True' %}
+           <li class="progtrckr-done">Shipped</li>
+    {% else %}
+           <li class="progtrckr-todo">Shipped</li>
+       {% endif %}
+
+       {% if  delivered == 'True' %}
+           <li class="progtrckr-done">Delivered</li>
+    {% else %}
+           <li class="progtrckr-todo">Delivered</li>
+       {% endif %}
+
+</ol>
 </body>
 </html>
\ No newline at end of file
diff --git a/templates/inventory/home.html b/templates/inventory/home.html
index 0d222af..14bcd47 100644
--- a/templates/inventory/home.html
+++ b/templates/inventory/home.html
@@ -165,7 +165,8 @@ with the Taler Codeless Merchant.  If not, see 
<https://www.gnu.org/licenses/>.
        </ul>
 
 
-       <center><a href="/new_product">ADD PRODUCT</a></center>
+       <center><a href="/new_product">ADD PRODUCT</a></center></br>
+       <center><a href="/digital_inventory">ADD DIGITAL INVENTORY</a></center>
 
 </div>
 
diff --git a/templates/inventory/index.html b/templates/inventory/index.html
index f24f4d1..c5009d3 100644
--- a/templates/inventory/index.html
+++ b/templates/inventory/index.html
@@ -20,32 +20,75 @@ with the Taler Codeless Merchant.  If not, see 
<https://www.gnu.org/licenses/>.
  -->
 <html>
 <head>
-       <title>Login</title>
+  <title>Sign Up</title>
+  <style type="text/css">
+        *,
+        *::before,
+        *::after {
+          box-sizing: border-box;
+        }
+        html {
+          background-color: #f0f0f0;
+        }
+        body {
+          color: #999999;
+          font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, 
sans-serif;
+          font-style: normal;
+          font-weight: 400;
+          letter-spacing: 0;
+          padding: 1rem;
+          text-rendering: optimizeLegibility;
+          -webkit-font-smoothing: antialiased;
+          -moz-osx-font-smoothing: grayscale;
+          -moz-font-feature-settings: "liga" on;
+        }
+        .sidenav {
+          height: 100%;
+          width: 160px;
+          position: fixed;
+          z-index: 1;
+          top: 0;
+          left: 0;
+          background-color: #111;
+          overflow-x: hidden;
+          padding-top: 20px;
+        }
+
+        .sidenav a {
+          padding: 6px 8px 6px 16px;
+          text-decoration: none;
+          font-size: 25px;
+          color: #818181;
+          display: block;
+        }
+
+        .sidenav a:hover {
+          color: #f1f1f1;
+        }
+        .main {
+          margin-left: 160px;
+          font-size: 28px;
+          padding: 0px 10px;
+        }
+        @media screen and (max-height: 450px) {
+          .sidenav {padding-top: 15px;}
+          .sidenav a {font-size: 18px;}
+        }
+    </style>
 </head>
-<body style="background: linear-gradient(0deg, #F6F0E1 100%, 
rgba(200,200,200,0) 100%); height: 100%"; >
-<div>
-  <div>
-    <div>
-      <p>Logis
-      n</p>
-    </div>
-    
-    <form method="post">
-       <div>
-        <span>Login</span>
-        <a href="/accounts/login">Log in</a>
-      </div>
-      <div>
-        <span>New User?</span>
-        <a href="/signup">Create Account</a>
-      </div>
-    </div>
-        
-      </fieldset>
-    </form>
-    
-  </div>
+<body>
+<div class="sidenav">
+    <a href="/accounts/login">LOGIN</a>
+    <a href="/signup">REGISTER</a></li>
+    <a href="/password_reset">FORGET PASSWORD</a></li>
 </div>
+
+<div class="main">
+    <center>
+        <h1>LOGGED OUT</h1>
+    </center>
+    <h4>SUCCESSFULLY LOGGED OUT</h4>
+          
 </div>
 
 </body>
diff --git a/templates/inventory/login.html b/templates/inventory/login.html
index 2f2b9e8..ac447ea 100644
--- a/templates/inventory/login.html
+++ b/templates/inventory/login.html
@@ -20,53 +20,138 @@ with the Taler Codeless Merchant.  If not, see 
<https://www.gnu.org/licenses/>.
  -->
 <html>
 <head>
-       <title>Login</title>
+  <title>Sign Up</title>
+  <style type="text/css">
+        *,
+        *::before,
+        *::after {
+          box-sizing: border-box;
+        }
+        html {
+          background-color: #f0f0f0;
+        }
+        body {
+          color: #999999;
+          font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, 
sans-serif;
+          font-style: normal;
+          font-weight: 400;
+          letter-spacing: 0;
+          padding: 1rem;
+          text-rendering: optimizeLegibility;
+          -webkit-font-smoothing: antialiased;
+          -moz-osx-font-smoothing: grayscale;
+          -moz-font-feature-settings: "liga" on;
+        }
+        .sidenav {
+          height: 100%;
+          width: 160px;
+          position: fixed;
+          z-index: 1;
+          top: 0;
+          left: 0;
+          background-color: #111;
+          overflow-x: hidden;
+          padding-top: 20px;
+        }
+
+        .sidenav a {
+          padding: 6px 8px 6px 16px;
+          text-decoration: none;
+          font-size: 25px;
+          color: #818181;
+          display: block;
+        }
+
+        .sidenav a:hover {
+          color: #f1f1f1;
+        }
+        .main {
+          margin-left: 160px;
+          font-size: 28px;
+          padding: 0px 10px;
+        }
+        @media screen and (max-height: 450px) {
+          .sidenav {padding-top: 15px;}
+          .sidenav a {font-size: 18px;}
+        }
+        #contact {width:100%; height:100%; margin 0 auto; background: #DDD; }
+
+        .container {width:960px; height:auto; margin: 0 auto; padding: 50px 0;}
+
+        #contact .container form input,
+        #contact .container form textarea {
+          width:97.4%;
+          height:30px;
+          padding:5px 10px;
+          font-size: 12px;
+          color:#999;
+          letter-spacing:1px;
+          background: #FFF;
+          border:2px solid #FFF;
+          margin-bottom:25px;
+          -webkit-transition:all .1s ease-in-out;
+          -moz-transition:all .1s ease-in-out;
+          -ms-transition:all .1s ease-in-out;
+          -o-transition:all .1s ease-in-out;
+          transition:all .1s ease-in-out;}
+
+        #contact .container form input:focus,
+        #contact .container form textarea:focus {
+          border:2px solid #dd4545;
+          color:#999;}
+
+        #contact .container form textarea {
+          height:150px;}
+
+        #contact .container form .submit {
+          width:100%;
+          padding:5px 10px;
+          font-size: 12px;
+          letter-spacing:1px;
+          background:#dd4545;
+          height:40px;
+          text-transform:uppercase;
+          letter-spacing:1px;
+          color:#FFF;
+          border:2px solid #b43838;
+          -webkit-transition:all .1s ease-in-out;
+          -moz-transition:all .1s ease-in-out;
+          -ms-transition:all .1s ease-in-out;
+          -o-transition:all .1s ease-in-out;
+          transition:all .1s ease-in-out;}
+
+        #contact .container form .submit:hover {
+          color:#FFF;
+          border:2px solid #dd4545;
+          background: #b43838;
+          cursor:pointer;}
+
+        #contact .container form .required {
+          color:#b43838;}
+    </style>
 </head>
-<body style="background: linear-gradient(0deg, #F6F0E1 100%, 
rgba(200,200,200,0) 100%); height: 100%"; >
-<div>
-  <div>
-    <div>
-      <p>Login</p>
-    </div>
-    
-    <form method="post">
-      {% csrf_token %}
-    
-      <fieldset>
-        {% for field in form %}
-        <div>
-          <p>
-        {{ field.label_tag }}<br>
-        {{ field }}
-        {% if field.help_text %}
-          <small style="color: grey">{{ field.help_text }}</small>
-        {% endif %}
-        </div>
-        
-        {% endfor %}
-        
-      </fieldset>
-      <fieldset>
-        {{error_message}}
-        <button type="submit">Log in</button>
+<body>
+<div class="sidenav">
+    <a href="/accounts/login">LOGIN</a>
+    <a href="/signup">REGISTER</a></li>
+    <a href="/password_reset">FORGET PASSWORD</a></li>
+</div>
 
-        <div>
-      <div>
-        <span>New User?</span>
-        <a href="/signup">Create Account</a>
-      </div>
-      <div>
-        <span>Forget Password?</span>
-        <a href="/password_reset">RESET</a>
+<div class="main">
+    <center>
+        <h1>LOGIN</h1>
+    </center>
+    <section id="contact">
+        <div class="container">
+          <form method="post" enctype="multipart/form-data">
+          <form method="post" enctype="multipart/form-data">
+          {% csrf_token %}
+          {{ form.as_p }}
+          <button name="add_product" type="submit" 
class="submit">LOGIN</button>
+          </form>
       </div>
-    </div>
-        
-      </fieldset>
-    </form>
-    
-  </div>
+    </section>
 </div>
 </div>
-
 </body>
 </html>
\ No newline at end of file
diff --git a/templates/inventory/new_product.html 
b/templates/inventory/new_product.html
index 5e81f4e..a7d4cfb 100644
--- a/templates/inventory/new_product.html
+++ b/templates/inventory/new_product.html
@@ -129,6 +129,45 @@ with the Taler Codeless Merchant.  If not, see 
<https://www.gnu.org/licenses/>.
         #contact .container form .required {
           color:#b43838;}
     </style>
+    <style>
+      .tooltip {
+          position: relative;
+          display: inline-block;
+      }
+
+      .tooltip .tooltiptext {
+          visibility: hidden;
+          width: 300px;
+          background-color: #555;
+          color: #fff;
+          text-align: center;
+          border-radius: 6px;
+          padding: 5px 0;
+          position: absolute;
+          z-index: 1;
+          bottom: 125%;
+          left: 50%;
+          margin-left: -60px;
+          opacity: 0;
+          transition: opacity 0.3s;
+      }
+
+      .tooltip .tooltiptext::after {
+          content: "";
+          position: absolute;
+          top: 100%;
+          left: 50%;
+          margin-left: -5px;
+          border-width: 5px;
+          border-style: solid;
+          border-color: #555 transparent transparent transparent;
+      }
+
+      .tooltip:hover .tooltiptext {
+          visibility: visible;
+          opacity: 1;
+      }
+    </style>
 </head>
 <body>
 
@@ -148,30 +187,26 @@ with the Taler Codeless Merchant.  If not, see 
<https://www.gnu.org/licenses/>.
             <form name="add_product_form" action="/add_product/" method="post" 
enctype="multipart/form-data">
 
                 {% csrf_token %}
+                <label for="name" class="tooltip">Name<font size="1"><span 
class="tooltiptext">Enter the name of the product</span></font></label>
                 <input type="text" name="name" id="name" placeholder="Name" 
required>
-                <textarea type="text" name="description" id="description" 
placeholder="Description" required></textarea>
+
+                <label for="description" class="tooltip">Description<font 
size="1"><span class="tooltiptext">Describe the product in one or two 
lines</span></font></label>
+                <input type="text" name="description" id="description" 
placeholder="Description" required></input>
+
+                <label for="price" class="tooltip">Price<font size="1"><span 
class="tooltiptext">Enter the price of the product. Remeber to write price in 
English texts. For Example 100 or 99.95</span></font></label>
                 <input type="text" name="price" id="price" placeholder="Price" 
required>
+
+                <label for="starting_inventory" class="tooltip">Starting 
Inventory<font size="1"><span class="tooltiptext">Enter the number of Inventory 
initially available for the given product</span></font></label>
                 <input type="number" name="starting_inventory" 
id="starting_inventory" placeholder="Starting Inventory" required>
-                <input type="number" name="minimum_required" 
id="minimum_required" placeholder="Minimum Quantity Required" required>
+
+                <label for="minimum_required" class="tooltip">Minimum 
Inventory Required<font size="1"><span class="tooltiptext">Enter the minimum 
number of inventory that is required for the given product(notifications will 
be send if inventory is below this llimit)</span></font></label>
+                <input type="number" name="minimum_required" 
id="minimum_required" placeholder="Minimum Inventory Required" required>
+
                 <button name="add_product" type="submit" class="submit">Add 
Product</button>
               
             </form>
         </div>
     </section>
-
-    <section id="contact">
-        <div class="container">
-          <form method="post" enctype="multipart/form-data">
-          <form method="post" enctype="multipart/form-data">
-          <h1>FOR DIGITAL INVENTORY</h1>
-          {% csrf_token %}
-          {{ form.as_p }}
-          <button name="add_product" type="submit" class="submit">Add 
Product</button>
-          </form>
-      </div>
-    </section>
-
 </div>
-
 </body>
 </html>
\ No newline at end of file
diff --git a/templates/inventory/order.html b/templates/inventory/order.html
index 763003d..97ae43f 100644
--- a/templates/inventory/order.html
+++ b/templates/inventory/order.html
@@ -160,6 +160,19 @@ with the Taler Codeless Merchant.  If not, see 
<https://www.gnu.org/licenses/>.
                         <li class="card__text">{{ i.name }}</li>
                     {% endfor %}
                 </ol>
+                <p>Update order status</p>
+                <form action="{{ item.url }}" method="post">
+                <!-- <form action="home"> -->
+                {% csrf_token %}
+                <select name="status">
+                  <option value="order_processing">Order Processing</option>
+                  <option value="pre_production">Pre-Production</option>
+                  <option value="in_production">In Production</option>
+                  <option value="shipped">Shipped</option>
+                  <option value="delivered">Delivered</option>
+                </select>
+                <button name="update_status" type="submit" 
class="submit">Update</button>
+              </form>
               </div>
             </div>
           </li>
diff --git a/templates/inventory/shipment_details.html 
b/templates/inventory/shipment_details.html
index 7aee562..1dcce10 100644
--- a/templates/inventory/shipment_details.html
+++ b/templates/inventory/shipment_details.html
@@ -89,7 +89,7 @@ with the Taler Codeless Merchant.  If not, see 
<https://www.gnu.org/licenses/>.
         <div class="container">
             <form name="add_product_form" action="/payment" method="get" 
enctype="multipart/form-data">
                 <input type="text" name="name_user" id="name_user" 
placeholder="Enter name" required>
-                <input type="text" name="address_user" id="address_user" 
placeholder="Address(For Digital Inventory leave blank)">
+                <input type="text" name="address_user" id="address_user" 
placeholder="Address" required>
                 <input type="hidden" name="name" value="{{ name }}">
                 <input type="hidden" name="price" value="{{ price }}">
                 <input type="hidden" name="merchant" value="{{ merchant }}">
diff --git a/templates/inventory/signup.html b/templates/inventory/signup.html
index 7a7dd71..25f2811 100644
--- a/templates/inventory/signup.html
+++ b/templates/inventory/signup.html
@@ -21,44 +21,137 @@ with the Taler Codeless Merchant.  If not, see 
<https://www.gnu.org/licenses/>.
 <html>
 <head>
   <title>Sign Up</title>
-</head>
-<body style="background: linear-gradient(0deg, #F6F0E1 100%, 
rgba(200,200,200,0) 100%); height: 100%"; >
-<div>
-  <h1>Sign up</h1> 
-    {% block content %}
-      
-      <form method="post" enctype="multipart/form-data">
-        {% csrf_token %}
-        {% for field in form %}
-          <p>
-            {{ field.label_tag }}<br>
-            {{ field }}
-            {% if field.help_text %}
-              <small style="color: grey">{{ field.help_text }}</small>
-            {% endif %}
-            {% for error in field.errors %}
-              <p style="color: red">{{ error }}</p>
-            {% endfor %}
-          </p>
-        {% endfor %}
+  <style type="text/css">
+        *,
+        *::before,
+        *::after {
+          box-sizing: border-box;
+        }
+        html {
+          background-color: #f0f0f0;
+        }
+        body {
+          color: #999999;
+          font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, 
sans-serif;
+          font-style: normal;
+          font-weight: 400;
+          letter-spacing: 0;
+          padding: 1rem;
+          text-rendering: optimizeLegibility;
+          -webkit-font-smoothing: antialiased;
+          -moz-osx-font-smoothing: grayscale;
+          -moz-font-feature-settings: "liga" on;
+        }
+        .sidenav {
+          height: 100%;
+          width: 160px;
+          position: fixed;
+          z-index: 1;
+          top: 0;
+          left: 0;
+          background-color: #111;
+          overflow-x: hidden;
+          padding-top: 20px;
+        }
+
+        .sidenav a {
+          padding: 6px 8px 6px 16px;
+          text-decoration: none;
+          font-size: 25px;
+          color: #818181;
+          display: block;
+        }
+
+        .sidenav a:hover {
+          color: #f1f1f1;
+        }
+        .main {
+          margin-left: 160px;
+          font-size: 28px;
+          padding: 0px 10px;
+        }
+        @media screen and (max-height: 450px) {
+          .sidenav {padding-top: 15px;}
+          .sidenav a {font-size: 18px;}
+        }
+        #contact {width:100%; height:100%; margin 0 auto; background: #DDD; }
+
+        .container {width:960px; height:auto; margin: 0 auto; padding: 50px 0;}
+
+        #contact .container form input,
+        #contact .container form textarea {
+          width:97.4%;
+          height:30px;
+          padding:5px 10px;
+          font-size: 12px;
+          color:#999;
+          letter-spacing:1px;
+          background: #FFF;
+          border:2px solid #FFF;
+          margin-bottom:25px;
+          -webkit-transition:all .1s ease-in-out;
+          -moz-transition:all .1s ease-in-out;
+          -ms-transition:all .1s ease-in-out;
+          -o-transition:all .1s ease-in-out;
+          transition:all .1s ease-in-out;}
+
+        #contact .container form input:focus,
+        #contact .container form textarea:focus {
+          border:2px solid #dd4545;
+          color:#999;}
 
-        {% for field in details_form %}
-          <p>
-            {{ field.label_tag }}<br>
-            {{ field }}
-            {% if field.help_text %}
-              <small style="color: grey">{{ field.help_text }}</small>
-            {% endif %}
-            {% for error in field.errors %}
-              <p style="color: red">{{ error }}</p>
-            {% endfor %}
-          </p>
-        {% endfor %}
-        <button type="submit">Sign up</button>
-      </form>
+        #contact .container form textarea {
+          height:150px;}
 
-      <div>
-    {% endblock %}
+        #contact .container form .submit {
+          width:100%;
+          padding:5px 10px;
+          font-size: 12px;
+          letter-spacing:1px;
+          background:#dd4545;
+          height:40px;
+          text-transform:uppercase;
+          letter-spacing:1px;
+          color:#FFF;
+          border:2px solid #b43838;
+          -webkit-transition:all .1s ease-in-out;
+          -moz-transition:all .1s ease-in-out;
+          -ms-transition:all .1s ease-in-out;
+          -o-transition:all .1s ease-in-out;
+          transition:all .1s ease-in-out;}
+
+        #contact .container form .submit:hover {
+          color:#FFF;
+          border:2px solid #dd4545;
+          background: #b43838;
+          cursor:pointer;}
+
+        #contact .container form .required {
+          color:#b43838;}
+    </style>
+</head>
+<body>
+<div class="sidenav">
+    <a href="/accounts/login">LOGIN</a>
+    <a href="/signup">REGISTER</a></li>
+    <a href="/password_reset">FORGET PASSWORD</a></li>
+</div>
+
+<div class="main">
+    <center>
+        <h1>SIGNUP</h1>
+    </center>
+    <section id="contact">
+        <div class="container">
+          <form method="post" enctype="multipart/form-data">
+          <form method="post" enctype="multipart/form-data">
+          {% csrf_token %}
+          {{ form.as_p }}
+          <button name="add_product" type="submit" class="submit">Sign 
up</button>
+          </form>
+      </div>
+    </section>
+</div>
 </div>
 </body>
 </html>
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]