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: overview page and a


From: gnunet
Subject: [GNUnet-SVN] [taler-codeless] branch master updated: overview page and add product functinality
Date: Sat, 02 Jun 2018 13:54:03 +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 abafd12  overview page and add product functinality
abafd12 is described below

commit abafd12b235e4c10c410e0bf3a981d969ab3fd94
Author: shivam kohli <address@hidden>
AuthorDate: Sat Jun 2 17:23:02 2018 +0530

    overview page and add product functinality
---
 codeless/urls.py                                   |  22 ++-
 inventory/migrations/0001_initial.py               |  61 +++++----
 inventory/models.py                                |  43 +++---
 inventory/views.py                                 |  66 ++++++++-
 templates/inventory/home.html                      | 148 ++++++++++++++++++++-
 templates/inventory/index.html                     |   9 +-
 templates/inventory/login.html                     |   8 +-
 templates/inventory/new_product.html               | 145 ++++++++++++++++++++
 templates/inventory/product.html                   |  77 +++++++++++
 templates/inventory/reset/base.html                |  24 ++++
 .../inventory/reset/password_reset_complete.html   |  12 ++
 .../inventory/reset/password_reset_confirm.html    |  21 +++
 templates/inventory/reset/password_reset_done.html |  17 +++
 .../inventory/reset/password_reset_email.html      |  12 ++
 templates/inventory/reset/password_reset_form.html |  14 ++
 .../inventory/reset/password_reset_subject.txt     |   1 +
 templates/inventory/signup.html                    |   6 +-
 17 files changed, 619 insertions(+), 67 deletions(-)

diff --git a/codeless/urls.py b/codeless/urls.py
index 2badc2e..8b25655 100644
--- a/codeless/urls.py
+++ b/codeless/urls.py
@@ -1,14 +1,32 @@
 from django.conf.urls import include, url
 from django.contrib import admin
+from django.contrib.auth import views as auth_views
 
 urlpatterns = [
     # Examples:
     # url(r'^$', 'codeless.views.home', name='home'),
     # url(r'^blog/', include('blog.urls')),
-    
+
     url(r'^admin/', include(admin.site.urls)),
     url(r'^signup/$', 'inventory.views.signup', name='signup'),
+    url(r'^new_product/$', 'inventory.views.new_product', name='new_product'),
+    url(r'^add_product/$', 'inventory.views.add_product', name='add_product'),
+    url(r'^home/product/(?P<uid>[\*\w\-]+)$',
+        'inventory.views.product', name='product'),
     url(r'^home/$', 'inventory.views.home', name='home'),
-    url(r'^login/$', 'inventory.views.login', name='login'),
+    url(r'^accounts/login/$', 'inventory.views.login', name='login'),
     url(r'^logout/$', 'inventory.views.logout', name='logout'),
+    url(r'^password_reset/$', auth_views.password_reset,
+        {'template_name': 'inventory/reset/password_reset_form.html'},
+        name='password_reset'),
+    url(r'^password_reset/done/$', auth_views.password_reset_done,
+        {'template_name': 'inventory/reset/password_reset_done.html'},
+        name='password_reset_done'),
+    
url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
+        auth_views.password_reset_confirm,
+        {'template_name': 'inventory/reset/password_reset_confirm.html'},
+        name='password_reset_confirm'),
+    url(r'^reset/done/$', auth_views.password_reset_complete,
+        {'template_name': 'inventory/reset/password_reset_complete.html'},
+        name='password_reset_complete'),
 ]
diff --git a/inventory/migrations/0001_initial.py 
b/inventory/migrations/0001_initial.py
index cca4181..88a7471 100644
--- a/inventory/migrations/0001_initial.py
+++ b/inventory/migrations/0001_initial.py
@@ -15,63 +15,68 @@ class Migration(migrations.Migration):
         migrations.CreateModel(
             name='Merchant',
             fields=[
-                ('id', models.AutoField(verbose_name='ID', primary_key=True, 
serialize=False, auto_created=True)),
+                ('id', models.AutoField(verbose_name='ID', serialize=False, 
auto_created=True, primary_key=True)),
                 ('address', models.TextField()),
-                ('pay_url', models.URLField(max_length=250, default='NULL')),
+                ('pay_url', models.URLField(default=b'NULL', max_length=250)),
                 ('user', models.OneToOneField(to=settings.AUTH_USER_MODEL)),
             ],
         ),
         migrations.CreateModel(
             name='Order',
             fields=[
-                ('order_id', models.AutoField(primary_key=True, 
serialize=False)),
-                ('description', models.CharField(max_length=300, blank=True, 
null=True)),
+                ('order_id', models.AutoField(serialize=False, 
primary_key=True)),
+                ('description', models.CharField(max_length=300, null=True, 
blank=True)),
                 ('order_date', models.DateTimeField(auto_now=True)),
-                ('address', models.CharField(max_length=250, blank=True, 
null=True)),
-                ('fulfillment_url', models.URLField(default='NULL')),
-                ('merchant_id', models.ForeignKey(to='inventory.Merchant')),
+                ('address', models.CharField(max_length=250, null=True, 
blank=True)),
+                ('fulfillment_url', models.URLField(default=b'NULL')),
             ],
         ),
         migrations.CreateModel(
             name='PaymentButton',
             fields=[
-                ('id', models.AutoField(verbose_name='ID', primary_key=True, 
serialize=False, auto_created=True)),
-                ('text', models.CharField(max_length=100, blank=True, 
null=True)),
-                ('font_size', models.CharField(max_length=50, blank=True, 
null=True)),
-                ('color', models.CharField(max_length=50, blank=True, 
null=True)),
-                ('background_color', models.CharField(max_length=50, 
blank=True, null=True)),
-                ('border_radius', models.CharField(max_length=50, blank=True, 
null=True)),
+                ('id', models.AutoField(verbose_name='ID', serialize=False, 
auto_created=True, primary_key=True)),
+                ('text', models.CharField(max_length=100, null=True, 
blank=True)),
+                ('font_size', models.CharField(max_length=50, null=True, 
blank=True)),
+                ('color', models.CharField(max_length=50, null=True, 
blank=True)),
+                ('background_color', models.CharField(max_length=50, 
null=True, blank=True)),
+                ('border_radius', models.CharField(max_length=50, null=True, 
blank=True)),
             ],
         ),
         migrations.CreateModel(
             name='Product',
             fields=[
-                ('product_id', models.AutoField(primary_key=True, 
serialize=False)),
-                ('name', models.CharField(max_length=50, blank=True, 
null=True)),
-                ('description', models.CharField(max_length=300, blank=True, 
null=True)),
-                ('price', models.IntegerField(blank=True, null=True)),
+                ('product_id', models.AutoField(serialize=False, 
primary_key=True)),
+                ('name', models.CharField(max_length=50, null=True, 
blank=True)),
+                ('description', models.CharField(max_length=300, null=True, 
blank=True)),
+                ('price', models.CharField(max_length=50, null=True, 
blank=True)),
                 ('delivery_date', models.DateTimeField(auto_now=True)),
-                ('starting_inventory', models.IntegerField(blank=True, 
null=True)),
-                ('minimuma_required', models.IntegerField(blank=True, 
null=True)),
-                ('inventory_on_hand', models.IntegerField(blank=True, 
null=True)),
-                ('inventory_recieved', models.IntegerField(blank=True, 
null=True)),
-                ('inventory_shipped', models.IntegerField(blank=True, 
null=True)),
+                ('starting_inventory', models.IntegerField(null=True, 
blank=True)),
+                ('minimum_required', models.IntegerField(null=True, 
blank=True)),
+                ('inventory_on_hand', models.IntegerField(null=True, 
blank=True)),
+                ('inventory_recieved', models.IntegerField(null=True, 
blank=True)),
+                ('inventory_shipped', models.IntegerField(null=True, 
blank=True)),
+                ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, 
null=True)),
             ],
         ),
         migrations.CreateModel(
             name='Purchase',
             fields=[
-                ('purchase_id', models.AutoField(primary_key=True, 
serialize=False)),
-                ('description', models.CharField(max_length=300, blank=True, 
null=True)),
+                ('purchase_id', models.AutoField(serialize=False, 
primary_key=True)),
+                ('description', models.CharField(max_length=300, null=True, 
blank=True)),
                 ('purchase_date', models.DateTimeField(auto_now=True)),
-                ('product_recieved', models.IntegerField(blank=True, 
null=True)),
-                ('supplier', models.CharField(max_length=50, blank=True, 
null=True)),
-                ('product_id', models.ManyToManyField(null=True, 
to='inventory.Product')),
+                ('product_recieved', models.IntegerField(null=True, 
blank=True)),
+                ('supplier', models.CharField(max_length=50, null=True, 
blank=True)),
+                ('product_id', models.ManyToManyField(to='inventory.Product', 
null=True)),
             ],
         ),
         migrations.AddField(
             model_name='order',
             name='product_id',
-            field=models.ManyToManyField(null=True, to='inventory.Product'),
+            field=models.ManyToManyField(to='inventory.Product', null=True),
+        ),
+        migrations.AddField(
+            model_name='order',
+            name='user',
+            field=models.ForeignKey(to=settings.AUTH_USER_MODEL),
         ),
     ]
diff --git a/inventory/models.py b/inventory/models.py
index 4de9f1c..21ba7fa 100644
--- a/inventory/models.py
+++ b/inventory/models.py
@@ -7,6 +7,18 @@ from django.db.models.signals import post_save
 from django.dispatch import receiver
 
 
+class Merchant(models.Model):
+    """ Extending the default Django User Model.
+    This will hold a One-To-One relationship with the existing User Model.
+    """
+    user = models.OneToOneField(User, on_delete=models.CASCADE)
+    address = models.TextField()
+    pay_url = models.URLField(max_length=250, default='NULL')
+
+    def __str__(self):
+        return self.user.username
+
+
 class Product(models.Model):
     """ The details of the product is described in this table.
     This table tracks the inventory of the product.
@@ -14,31 +26,20 @@ class Product(models.Model):
     product_id = models.AutoField(primary_key=True)
     name = models.CharField(max_length=50, blank=True, null=True)
     description = models.CharField(max_length=300, blank=True, null=True)
-    price = models.IntegerField(blank=True, null=True)
+    price = models.CharField(max_length=50, blank=True, null=True)
     delivery_date = models.DateTimeField(auto_now=True)
     starting_inventory = models.IntegerField(blank=True, null=True)
-    minimuma_required = models.IntegerField(blank=True, null=True)
+    minimum_required = models.IntegerField(blank=True, null=True)
     # inventory_on_hand is updated by purchase and outgoing orders.
     inventory_on_hand = models.IntegerField(blank=True, null=True)
     inventory_recieved = models.IntegerField(blank=True, null=True)
     inventory_shipped = models.IntegerField(blank=True, null=True)
+    user = models.ForeignKey(User, on_delete=models.CASCADE, null=True)
 
     def __str__(self):
         return self.name
 
 
-class Merchant(models.Model):
-    """ Extending the default Django User Model.
-    This will hold a One-To-One relationship with the existing User Model.
-    """
-    user = models.OneToOneField(User, on_delete=models.CASCADE)
-    address = models.TextField()
-    pay_url = models.URLField(max_length=250, default='NULL')
-
-    def __str__(self):
-        return self.user.username
-
-
 @receiver(post_save, sender=User)
 def create_user_profile(sender, instance, created, **kwargs):
     """ Hooking the create_user_profile method to
@@ -48,12 +49,12 @@ def create_user_profile(sender, instance, created, 
**kwargs):
         Merchant.objects.create(user=instance)
 
 
address@hidden(post_save, sender=User)
-def save_user_profile(sender, instance, **kwargs):
-    """ Hooking the save_user_profile method to
-    the User model, whenever a save event occurs
-    """
-    instance.Merchant.save()
+# @receiver(post_save, sender=User)
+# def save_user_profile(sender, instance, **kwargs):
+#     """ Hooking the save_user_profile method to
+#     the User model, whenever a save event occurs
+#     """
+#     instance.Merchant.save()
 
 
 class Order(models.Model):
@@ -65,7 +66,7 @@ class Order(models.Model):
     description = 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_id = models.ForeignKey(Merchant, on_delete=models.CASCADE)
+    user = models.ForeignKey(User, on_delete=models.CASCADE)
     fulfillment_url = models.URLField(max_length=200, default='NULL')
 
     def __str__(self):
diff --git a/inventory/views.py b/inventory/views.py
index 80be28e..157bf35 100644
--- a/inventory/views.py
+++ b/inventory/views.py
@@ -2,7 +2,8 @@
 # -*- coding: utf-8 -*-
 
 from inventory.forms import SignUpForm, MerchantDetailForm, LoginForm
-from inventory.models import Merchant
+from inventory.models import Merchant, Product
+from django.contrib.auth.models import User
 from django.contrib.auth import authenticate
 from django.contrib.auth import login as auth_login
 from django.contrib.auth import logout as auth_logout
@@ -11,12 +12,69 @@ from django.contrib.auth.decorators import login_required
 from django.shortcuts import render, redirect
 from django.core.urlresolvers import resolve
 
-# Create your views here.
-
 
 @login_required
 def home(request):
-    return render(request, 'inventory/home.html')
+    user_instance = User.objects.get(username=request.user.username)
+    product = Product.objects.filter(user=user_instance)
+    context_dict = {}
+    array = []
+    for i in product:
+        data = {}
+        data['name'] = i.name
+        data['description'] = i.description
+        data['price'] = i.price
+        data['inventory_on_hand'] = i.starting_inventory
+        data['url'] = '/home/product/' + str(i.product_id)
+        array.append(data)
+    context_dict['data'] = array
+    return render(request, 'inventory/home.html', context_dict)
+
+
address@hidden
+def add_product(request):
+    name = request.POST.get('name')
+    product_instance = Product.objects.get_or_create(name=name)[0]
+    description = request.POST.get('description')
+    product_instance.description = description
+    price = request.POST.get('price')
+    product_instance.price = price
+    starting_inventory = request.POST.get('starting_inventory')
+    product_instance.starting_inventory = starting_inventory
+    minimum_required = request.POST.get('minimum_required')
+    product_instance.minimum_required = minimum_required
+    user_instance = User.objects.get(username=request.user.username)
+    product_instance.user = user_instance
+    product_instance.save()
+    product = Product.objects.filter(user=user_instance)
+    context_dict = {}
+    array = []
+    for i in product:
+        data = {}
+        data['name'] = i.name
+        data['description'] = i.description
+        data['price'] = i.price
+        data['inventory_on_hand'] = i.starting_inventory
+        data['url'] = '/home/product/' + str(i.product_id)
+        array.append(data)
+    context_dict['data'] = array
+    return render(request, 'inventory/home.html', context_dict)
+
+
address@hidden
+def product(request, uid):
+    product_instance = Product.objects.get_or_create(product_id=uid)[0]
+    context_dict = {}
+    context_dict['name'] = product_instance.name
+    context_dict['description'] = product_instance.description
+    context_dict['price'] = product_instance.price
+    context_dict['inventory_on_hand'] = product_instance.starting_inventory
+    return render(request, 'inventory/product.html', context_dict)
+
+
address@hidden
+def new_product(request):
+    return render(request, 'inventory/new_product.html')
 
 
 def signup(request):
diff --git a/templates/inventory/home.html b/templates/inventory/home.html
index 424bab3..ea5ddf8 100644
--- a/templates/inventory/home.html
+++ b/templates/inventory/home.html
@@ -2,10 +2,152 @@
 <html>
 <head>
        <title>Home</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;
+               }
+               .btn {
+                 background-color: white;
+                 border: 1px solid #cccccc;
+                 color: #696969;
+                 padding: 0.5rem;
+                 text-transform: lowercase;
+               }
+               .btnblock {
+                 display: block;
+                 width: 100%;
+               }
+               .cards {
+                 display: flex;
+                 flex-wrap: wrap;
+                 list-style: none;
+                 margin: 0;
+                 padding: 0;
+               }
+               .cards__item {
+                 /*display: flex;*/
+                 padding: 1rem;
+               }
+               @media (min-width: 40rem) {
+                 .cards__item {
+                   width: 50%;
+                 }
+               }
+               @media (min-width: 56rem) {
+                 .cards__item {
+                   width: 33.3333%;
+                 }
+               }
+               .card {
+                 background-color: white;
+                 border-radius: 0.25rem;
+                 box-shadow: 0 20px 40px -14px rgba(0, 0, 0, 0.25);
+                 display: flex;
+                 flex-direction: column;
+                 overflow: hidden;
+               }
+               .card__content {
+                 display: flex;
+                 flex: 1 1 auto;
+                 flex-direction: column;
+                 padding: 1rem;
+               }
+               .card__title {
+                 color: #696969;
+                 font-size: 1.25rem;
+                 font-weight: 300;
+                 letter-spacing: 2px;
+                 text-transform: uppercase;
+               }
+               .card__text {
+                 flex: 1 1 auto;
+                 font-size: 0.875rem;
+                 line-height: 1.5;
+                 margin-bottom: 1.25rem;
+               }
+               .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>
-<h1>Welcome!!!!</h1>
-<h4>You are successfully loged in</h4>
-<a href="/logout">logout</a></li> 
+
+<div class="sidenav">
+       <a href="/home">Home</a>
+    <a href="/logout">Logout</a></li>
+</div>
+
+<div class="main">
+       <center>
+               <h1>INVENTORY</h1>
+       </center>
+
+       <ul class="cards">
+               {% for item in data %}
+                 <li class="cards__item">
+                   <div class="card">
+                     <div class="card__content">
+                       <div class="card__title"><a href="{{ item.url }}">{{ 
item.name }}</a></div>
+                       <p class="card__text">{{ item.description }}</p><br>
+                       <p class="card__text"><b>Inventory on hand: </b>{{ 
item.inventory_on_hand }}</p>
+                       <!-- <button class="btn btnblock 
card__btn">Button</button> -->
+                     </div>
+                   </div>
+                 </li>
+               {% endfor %}
+       </ul>
+
+
+       <center><a href="/new_product">ADD PRODUCT</a></center>
+
+</div>
+
 </body>
 </html>
\ No newline at end of file
diff --git a/templates/inventory/index.html b/templates/inventory/index.html
index ab79a2b..03764a1 100644
--- a/templates/inventory/index.html
+++ b/templates/inventory/index.html
@@ -3,17 +3,18 @@
 <head>
        <title>Login</title>
 </head>
-<body>
-<div style="background: linear-gradient(0deg, #F6F0E1 20%, rgba(200,200,200,0) 
100%); height: 100%"; >
+<body style="background: linear-gradient(0deg, #F6F0E1 100%, 
rgba(200,200,200,0) 100%); height: 100%"; >
+<div>
   <div>
     <div>
-      <p>Login</p>
+      <p>Logis
+      n</p>
     </div>
     
     <form method="post">
        <div>
         <span>Login</span>
-        <a href="/login">Log in</a>
+        <a href="/accounts/login">Log in</a>
       </div>
       <div>
         <span>New User?</span>
diff --git a/templates/inventory/login.html b/templates/inventory/login.html
index d407b3f..5c13efe 100644
--- a/templates/inventory/login.html
+++ b/templates/inventory/login.html
@@ -3,8 +3,8 @@
 <head>
        <title>Login</title>
 </head>
-<body>
-<div style="background: linear-gradient(0deg, #F6F0E1 20%, rgba(200,200,200,0) 
100%); height: 100%"; >
+<body style="background: linear-gradient(0deg, #F6F0E1 100%, 
rgba(200,200,200,0) 100%); height: 100%"; >
+<div>
   <div>
     <div>
       <p>Login</p>
@@ -36,6 +36,10 @@
         <span>New User?</span>
         <a href="/signup">Create Account</a>
       </div>
+      <div>
+        <span>Forget Password?</span>
+        <a href="/password_reset">RESET</a>
+      </div>
     </div>
         
       </fieldset>
diff --git a/templates/inventory/new_product.html 
b/templates/inventory/new_product.html
new file mode 100644
index 0000000..a8d4868
--- /dev/null
+++ b/templates/inventory/new_product.html
@@ -0,0 +1,145 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>Home</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>
+
+<div class="sidenav">
+    <a href="/home">Home</a>
+    <a href="/logout">Logout</a></li> 
+</div>
+
+<div class="main">
+    <center>
+        <h1>ADD A NEW PRODUCT</h1>
+    </center>
+
+    <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>
+
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/templates/inventory/product.html b/templates/inventory/product.html
new file mode 100644
index 0000000..18fb381
--- /dev/null
+++ b/templates/inventory/product.html
@@ -0,0 +1,77 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>Home</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>
+
+<div class="sidenav">
+    <a href="/home">Home</a>
+    <a href="/logout">Logout</a></li> 
+</div>
+
+<div class="main">
+    <center>
+        <h1 style="text-transform: uppercase;">{{ name }}</h1>
+    </center>
+
+    <h5 color="black">Description:</h5><h6>{{ description }}</h6><br>
+    <h5 color="black">Price:</h5><h6>{{ price }}</h6><br>
+    <h5 color="black">Inventory on Hand:</h5><h6>{{ inventory_on_hand 
}}</h6><br>
+
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/templates/inventory/reset/base.html 
b/templates/inventory/reset/base.html
new file mode 100644
index 0000000..21c7fc1
--- /dev/null
+++ b/templates/inventory/reset/base.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <meta charset="utf-8">
+  <title>{% block title %}RESET{% endblock %}</title>
+</head>
+<body>
+  <header>
+    <h1>Django Simple Login</h1>
+    {% if user.is_authenticated %}
+      Hi {{ user.username }}!
+      <a href="{% url 'logout' %}">logout</a>
+    {% else %}
+      <a href="{% url 'login' %}">login</a>
+    {% endif %}
+  </header>
+  <hr>
+  <main>
+    {% block content %}
+    {% endblock %}
+  </main>
+  <hr>
+</body>
+</html>
\ No newline at end of file
diff --git a/templates/inventory/reset/password_reset_complete.html 
b/templates/inventory/reset/password_reset_complete.html
new file mode 100644
index 0000000..5b4260b
--- /dev/null
+++ b/templates/inventory/reset/password_reset_complete.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<head>
+       <title></title>
+</head>
+<body>
+  <p>
+    Your password has been set. You may go ahead and login now.<br><br>
+    <a href="{% url 'login' %}">login</a> 
+  </p>
+</body>
+</html>
\ No newline at end of file
diff --git a/templates/inventory/reset/password_reset_confirm.html 
b/templates/inventory/reset/password_reset_confirm.html
new file mode 100644
index 0000000..84d1c68
--- /dev/null
+++ b/templates/inventory/reset/password_reset_confirm.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <title></title>
+</head>
+<body>
+  {% if validlink %}
+    <h3>Change password</h3>
+    <form method="post">
+      {% csrf_token %}
+      {{ form.as_p }}
+      <button type="submit">Change password</button>
+    </form>
+  {% else %}
+    <p>
+      The password reset link was invalid, possibly because it has already 
been used.
+      Please request a new password reset.
+    </p>
+  {% endif %}
+</body>
+</html>
\ No newline at end of file
diff --git a/templates/inventory/reset/password_reset_done.html 
b/templates/inventory/reset/password_reset_done.html
new file mode 100644
index 0000000..a679fa9
--- /dev/null
+++ b/templates/inventory/reset/password_reset_done.html
@@ -0,0 +1,17 @@
+
+<!DOCTYPE html>
+<html>
+<head>
+       <title></title>
+</head>
+<body>
+  <p>
+    We've emailed you instructions for setting your password, if an account 
exists with the email you entered.
+    You should receive them shortly.
+  </p>
+  <p>
+    If you don't receive an email, please make sure you've entered the address 
you registered with,
+    and check your spam folder.
+  </p>
+</body>
+</html>
\ No newline at end of file
diff --git a/templates/inventory/reset/password_reset_email.html 
b/templates/inventory/reset/password_reset_email.html
new file mode 100644
index 0000000..da2c169
--- /dev/null
+++ b/templates/inventory/reset/password_reset_email.html
@@ -0,0 +1,12 @@
+{% autoescape off %}
+To initiate the password reset process for your {{ user.get_username }} 
TestSite Account,
+click the link below:
+
+{{ protocol }}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid 
token=token %}
+
+If clicking the link above doesn't work, please copy and paste the URL in a 
new browser
+window instead.
+
+Sincerely,
+The TestSite Team
+{% endautoescape %}
\ No newline at end of file
diff --git a/templates/inventory/reset/password_reset_form.html 
b/templates/inventory/reset/password_reset_form.html
new file mode 100644
index 0000000..db929c4
--- /dev/null
+++ b/templates/inventory/reset/password_reset_form.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+       <title>RESET PASSWORD</title>
+</head>
+<body>
+  <h3>Forgot password</h3>
+  <form method="post">
+    {% csrf_token %}
+    {{ form.as_p }}
+    <button type="submit">Submit</button>
+  </form>
+</body>
+</html>
\ No newline at end of file
diff --git a/templates/inventory/reset/password_reset_subject.txt 
b/templates/inventory/reset/password_reset_subject.txt
new file mode 100644
index 0000000..0001c8b
--- /dev/null
+++ b/templates/inventory/reset/password_reset_subject.txt
@@ -0,0 +1 @@
+TestSite password reset
diff --git a/templates/inventory/signup.html b/templates/inventory/signup.html
index 5a0137f..3bec372 100644
--- a/templates/inventory/signup.html
+++ b/templates/inventory/signup.html
@@ -3,9 +3,9 @@
 <head>
   <title>Sign Up</title>
 </head>
-<body>
-<div <div style="background: linear-gradient(0deg, #F6F0E1 20%, 
rgba(200,200,200,0) 100%); height: 100%"; >
-    <h1>Sign up</h1> 
+<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">

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



reply via email to

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