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 (0eb98c3 -> 8fd1c57)


From: gnunet
Subject: [GNUnet-SVN] [taler-codeless] branch master updated (0eb98c3 -> 8fd1c57)
Date: Wed, 30 May 2018 00:18:29 +0200

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

dold pushed a change to branch master
in repository codeless.

 discard 0eb98c3  first commit
     new 03c15c0  basic login
     new 8fd1c57  updated .gitignore

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (0eb98c3)
            \
             N -- N -- N   refs/heads/master (8fd1c57)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .gitignore                                         |   8 ++
 codeless/__pycache__/__init__.cpython-36.pyc       | Bin 139 -> 0 bytes
 codeless/__pycache__/settings.cpython-36.pyc       | Bin 2049 -> 0 bytes
 codeless/__pycache__/urls.cpython-36.pyc           | Bin 297 -> 0 bytes
 codeless/__pycache__/wsgi.cpython-36.pyc           | Bin 544 -> 0 bytes
 codeless/settings.py                               |  37 ++++---
 codeless/urls.py                                   |   6 +-
 db.sqlite3                                         | Bin 192512 -> 0 bytes
 inventory/__pycache__/__init__.cpython-36.pyc      | Bin 140 -> 0 bytes
 inventory/__pycache__/admin.cpython-36.pyc         | Bin 394 -> 0 bytes
 inventory/__pycache__/models.cpython-36.pyc        | Bin 2895 -> 0 bytes
 inventory/admin.py                                 |  15 +--
 inventory/forms.py                                 |  39 ++++++++
 inventory/migrations/0001_initial.py               |  24 +++--
 .../__pycache__/0001_initial.cpython-36.pyc        | Bin 1952 -> 0 bytes
 .../migrations/__pycache__/__init__.cpython-36.pyc | Bin 151 -> 0 bytes
 inventory/models.py                                | 111 +++++++++++++--------
 inventory/views.py                                 |  71 ++++++++++++-
 templates/inventory/home.html                      |  11 ++
 templates/inventory/index.html                     |  32 ++++++
 templates/inventory/login.html                     |  49 +++++++++
 templates/inventory/signup.html                    |  45 +++++++++
 22 files changed, 370 insertions(+), 78 deletions(-)
 create mode 100644 .gitignore
 delete mode 100644 codeless/__pycache__/__init__.cpython-36.pyc
 delete mode 100644 codeless/__pycache__/settings.cpython-36.pyc
 delete mode 100644 codeless/__pycache__/urls.cpython-36.pyc
 delete mode 100644 codeless/__pycache__/wsgi.cpython-36.pyc
 delete mode 100644 db.sqlite3
 delete mode 100644 inventory/__pycache__/__init__.cpython-36.pyc
 delete mode 100644 inventory/__pycache__/admin.cpython-36.pyc
 delete mode 100644 inventory/__pycache__/models.cpython-36.pyc
 create mode 100644 inventory/forms.py
 delete mode 100644 inventory/migrations/__pycache__/0001_initial.cpython-36.pyc
 delete mode 100644 inventory/migrations/__pycache__/__init__.cpython-36.pyc
 create mode 100644 templates/inventory/home.html
 create mode 100644 templates/inventory/index.html
 create mode 100644 templates/inventory/login.html
 create mode 100644 templates/inventory/signup.html

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..8ad70e2
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,8 @@
+db.sqlite3
+codeless/__pycache__/*
+inventory/migrations/__pycache__/*
+*.pyc
+.DS_Store
+inventory/__pycache__/.DS_Store
+templates/.DS_Store
+inventory/migrations/.DS_Store
diff --git a/codeless/__pycache__/__init__.cpython-36.pyc 
b/codeless/__pycache__/__init__.cpython-36.pyc
deleted file mode 100644
index 60efddb..0000000
Binary files a/codeless/__pycache__/__init__.cpython-36.pyc and /dev/null differ
diff --git a/codeless/__pycache__/settings.cpython-36.pyc 
b/codeless/__pycache__/settings.cpython-36.pyc
deleted file mode 100644
index 703e644..0000000
Binary files a/codeless/__pycache__/settings.cpython-36.pyc and /dev/null differ
diff --git a/codeless/__pycache__/urls.cpython-36.pyc 
b/codeless/__pycache__/urls.cpython-36.pyc
deleted file mode 100644
index 16aa3ff..0000000
Binary files a/codeless/__pycache__/urls.cpython-36.pyc and /dev/null differ
diff --git a/codeless/__pycache__/wsgi.cpython-36.pyc 
b/codeless/__pycache__/wsgi.cpython-36.pyc
deleted file mode 100644
index d6f0239..0000000
Binary files a/codeless/__pycache__/wsgi.cpython-36.pyc and /dev/null differ
diff --git a/codeless/settings.py b/codeless/settings.py
index c2bd13f..9be921d 100644
--- a/codeless/settings.py
+++ b/codeless/settings.py
@@ -53,25 +53,32 @@ MIDDLEWARE_CLASSES = (
 
 ROOT_URLCONF = 'codeless.urls'
 
-TEMPLATES = [
-    {
-        'BACKEND': 'django.template.backends.django.DjangoTemplates',
-        'DIRS': [],
-        'APP_DIRS': True,
-        'OPTIONS': {
-            'context_processors': [
-                'django.template.context_processors.debug',
-                'django.template.context_processors.request',
-                'django.contrib.auth.context_processors.auth',
-                'django.contrib.messages.context_processors.messages',
-            ],
-        },
-    },
-]
+# TEMPLATES = [
+#     {
+#         'BACKEND': 'django.template.backends.django.DjangoTemplates',
+#         'DIRS': [],
+#         'APP_DIRS': True,
+#         'OPTIONS': {
+#             'context_processors': [
+#                 'django.template.context_processors.debug',
+#                 'django.template.context_processors.request',
+#                 'django.contrib.auth.context_processors.auth',
+#                 'django.contrib.messages.context_processors.messages',
+#             ],
+#         },
+#     },
+# ]
 
 WSGI_APPLICATION = 'codeless.wsgi.application'
 
 
+TEMPLATE_PATH = os.path.join(BASE_DIR, 'templates')
+
+TEMPLATE_DIRS = (
+    TEMPLATE_PATH,
+)
+
+
 # Database
 # https://docs.djangoproject.com/en/1.8/ref/settings/#databases
 
diff --git a/codeless/urls.py b/codeless/urls.py
index ebbaa31..2badc2e 100644
--- a/codeless/urls.py
+++ b/codeless/urls.py
@@ -5,6 +5,10 @@ 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'^home/$', 'inventory.views.home', name='home'),
+    url(r'^login/$', 'inventory.views.login', name='login'),
+    url(r'^logout/$', 'inventory.views.logout', name='logout'),
 ]
diff --git a/db.sqlite3 b/db.sqlite3
deleted file mode 100644
index d17ac95..0000000
Binary files a/db.sqlite3 and /dev/null differ
diff --git a/inventory/__pycache__/__init__.cpython-36.pyc 
b/inventory/__pycache__/__init__.cpython-36.pyc
deleted file mode 100644
index dc1f6ea..0000000
Binary files a/inventory/__pycache__/__init__.cpython-36.pyc and /dev/null 
differ
diff --git a/inventory/__pycache__/admin.cpython-36.pyc 
b/inventory/__pycache__/admin.cpython-36.pyc
deleted file mode 100644
index fa69c75..0000000
Binary files a/inventory/__pycache__/admin.cpython-36.pyc and /dev/null differ
diff --git a/inventory/__pycache__/models.cpython-36.pyc 
b/inventory/__pycache__/models.cpython-36.pyc
deleted file mode 100644
index bc511cd..0000000
Binary files a/inventory/__pycache__/models.cpython-36.pyc and /dev/null differ
diff --git a/inventory/admin.py b/inventory/admin.py
index e5d1df7..76bf7e8 100644
--- a/inventory/admin.py
+++ b/inventory/admin.py
@@ -1,10 +1,13 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
 from django.contrib import admin
-from inventory.models import product , merchant , order , purchase , 
payment_button
+from inventory.models import Product, Merchant, Order, Purchase, PaymentButton
 
 # Register your models here.
 
-admin.site.register(product)
-admin.site.register(merchant)
-admin.site.register(order)
-admin.site.register(purchase)
-admin.site.register(payment_button)
+admin.site.register(Product)
+admin.site.register(Merchant)
+admin.site.register(Order)
+admin.site.register(Purchase)
+admin.site.register(PaymentButton)
diff --git a/inventory/forms.py b/inventory/forms.py
new file mode 100644
index 0000000..2d32f5a
--- /dev/null
+++ b/inventory/forms.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+from django import forms
+from django.contrib.auth.forms import UserCreationForm
+from django.contrib.auth.models import User
+from inventory.models import Merchant
+
+
+class SignUpForm(UserCreationForm):
+    first_name = forms.CharField(max_length=30, required=False)
+    last_name = forms.CharField(max_length=30, required=False)
+    email = forms.EmailField(max_length=254)
+
+    class Meta:
+        model = User
+        fields = (
+            'username',
+            'first_name',
+            'last_name',
+            'email',
+            'password1',
+            'password2',
+            )
+
+
+class MerchantDetailForm(forms.ModelForm):
+    class Meta:
+        model = Merchant
+        fields = ("address",)
+
+
+class LoginForm(forms.ModelForm):
+    class Meta:
+        model = User
+        fields = (
+            "username", 
+            "password"
+            )
diff --git a/inventory/migrations/0001_initial.py 
b/inventory/migrations/0001_initial.py
index 604d207..cca4181 100644
--- a/inventory/migrations/0001_initial.py
+++ b/inventory/migrations/0001_initial.py
@@ -2,36 +2,38 @@
 from __future__ import unicode_literals
 
 from django.db import models, migrations
+from django.conf import settings
 
 
 class Migration(migrations.Migration):
 
     dependencies = [
+        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
     ]
 
     operations = [
         migrations.CreateModel(
-            name='merchant',
+            name='Merchant',
             fields=[
-                ('merchant_id', models.AutoField(primary_key=True, 
serialize=False)),
-                ('name', models.CharField(max_length=200, blank=True, 
null=True)),
-                ('address', models.CharField(max_length=200, blank=True, 
null=True)),
+                ('id', models.AutoField(verbose_name='ID', primary_key=True, 
serialize=False, auto_created=True)),
+                ('address', models.TextField()),
                 ('pay_url', models.URLField(max_length=250, default='NULL')),
+                ('user', models.OneToOneField(to=settings.AUTH_USER_MODEL)),
             ],
         ),
         migrations.CreateModel(
-            name='order',
+            name='Order',
             fields=[
                 ('order_id', models.AutoField(primary_key=True, 
serialize=False)),
                 ('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)),
                 ('fulfillment_url', models.URLField(default='NULL')),
-                ('merchant_id', models.ForeignKey(to='inventory.merchant')),
+                ('merchant_id', models.ForeignKey(to='inventory.Merchant')),
             ],
         ),
         migrations.CreateModel(
-            name='payment_button',
+            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)),
@@ -42,7 +44,7 @@ class Migration(migrations.Migration):
             ],
         ),
         migrations.CreateModel(
-            name='product',
+            name='Product',
             fields=[
                 ('product_id', models.AutoField(primary_key=True, 
serialize=False)),
                 ('name', models.CharField(max_length=50, blank=True, 
null=True)),
@@ -57,19 +59,19 @@ class Migration(migrations.Migration):
             ],
         ),
         migrations.CreateModel(
-            name='purchase',
+            name='Purchase',
             fields=[
                 ('purchase_id', models.AutoField(primary_key=True, 
serialize=False)),
                 ('description', models.CharField(max_length=300, blank=True, 
null=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_id', models.ManyToManyField(null=True, 
to='inventory.Product')),
             ],
         ),
         migrations.AddField(
             model_name='order',
             name='product_id',
-            field=models.ManyToManyField(null=True, to='inventory.product'),
+            field=models.ManyToManyField(null=True, to='inventory.Product'),
         ),
     ]
diff --git a/inventory/migrations/__pycache__/0001_initial.cpython-36.pyc 
b/inventory/migrations/__pycache__/0001_initial.cpython-36.pyc
deleted file mode 100644
index b3c4816..0000000
Binary files a/inventory/migrations/__pycache__/0001_initial.cpython-36.pyc and 
/dev/null differ
diff --git a/inventory/migrations/__pycache__/__init__.cpython-36.pyc 
b/inventory/migrations/__pycache__/__init__.cpython-36.pyc
deleted file mode 100644
index 4d9aa4e..0000000
Binary files a/inventory/migrations/__pycache__/__init__.cpython-36.pyc and 
/dev/null differ
diff --git a/inventory/models.py b/inventory/models.py
index 643a130..4de9f1c 100644
--- a/inventory/models.py
+++ b/inventory/models.py
@@ -1,76 +1,99 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
 from django.db import models
 from django.contrib.auth.models import User
-
-# Create your models here.
+from django.db.models.signals import post_save
+from django.dispatch import receiver
 
 
-class product(models.Model):
+class Product(models.Model):
+    """ The details of the product is described in this table.
+    This table tracks the inventory of the product.
+    """
     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)
+    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)
     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(blank=True, null=True)
+    minimuma_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)
 
     def __str__(self):
         return self.name
 
 
-class merchant(models.Model):
-    # user = models.OneToOneField(User, on_delete=models.CASCADE)
-    merchant_id = models.AutoField(primary_key=True)
-    name = models.CharField(max_length = 200 , blank = True , null = True)
-    address = models.CharField(max_length = 200 , blank = True , null = True)
-    pay_url = models.URLField(max_length = 250 , default = 'NULL')
+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.name
+        return self.user.username
+
 
address@hidden(post_save, sender=User)
+def create_user_profile(sender, instance, created, **kwargs):
+    """ Hooking the create_user_profile method to
+    the User model, whenever a save event occurs
+    """
+    if created:
+        Merchant.objects.create(user=instance)
 
-class order(models.Model):
+
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()
+
+
+class Order(models.Model):
+    """ Details of the order customer buys is updated in this table.
+    These details will be used to make request to the Merchant Backend API
+    """
     order_id = models.AutoField(primary_key=True)
-    product_id =models.ManyToManyField(product , null = True)
-    description = models.CharField(max_length = 300 , blank = True , null = 
True)
+    product_id = models.ManyToManyField(Product, null=True)
+    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) 
-    fulfillment_url = models.URLField(max_length = 200 , default = 'NULL')
+    address = models.CharField(max_length=250, blank=True, null=True)
+    merchant_id = models.ForeignKey(Merchant, on_delete=models.CASCADE)
+    fulfillment_url = models.URLField(max_length=200, default='NULL')
 
     def __str__(self):
         return self.description
 
 
-class purchase(models.Model):
+class Purchase(models.Model):
+    """ To keep a track of the purchases the merchant makes.
+    This table is essential to update the inverntory in hand.
+    """
     purchase_id = models.AutoField(primary_key=True)
-    product_id = models.ManyToManyField(product , null = True)
-    description = models.CharField(max_length = 300 , blank = True , null = 
True)
+    product_id = models.ManyToManyField(Product, null=True)
+    description = models.CharField(max_length=300, blank=True, null=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_recieved = models.IntegerField(blank=True, null=True)
+    supplier = models.CharField(max_length=50, blank=True, null=True)
 
     def __str__(self):
         return self.description
 
 
-class payment_button(models.Model):
-    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)
-
+class PaymentButton(models.Model):
+    """ Design pattern for the payment button are stored in this table. """
+    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)
 
     def __str__(self):
         return self.text
-
-
-
-
-
-
-
-
diff --git a/inventory/views.py b/inventory/views.py
index 91ea44a..80be28e 100644
--- a/inventory/views.py
+++ b/inventory/views.py
@@ -1,3 +1,72 @@
-from django.shortcuts import render
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+from inventory.forms import SignUpForm, MerchantDetailForm, LoginForm
+from inventory.models import Merchant
+from django.contrib.auth import authenticate
+from django.contrib.auth import login as auth_login
+from django.contrib.auth import logout as auth_logout
+from django.shortcuts import get_object_or_404
+from django.contrib.auth.decorators import login_required
+from django.shortcuts import render, redirect
+from django.core.urlresolvers import resolve
 
 # Create your views here.
+
+
address@hidden
+def home(request):
+    return render(request, 'inventory/home.html')
+
+
+def signup(request):
+    if request.method == 'POST':
+        form = SignUpForm(request.POST)
+        details_form = MerchantDetailForm(request.POST)
+        if form.is_valid():
+            form.save()
+            username = form.cleaned_data.get('username')
+            raw_password = form.cleaned_data.get('password1')
+            user = authenticate(username=username, password=raw_password)
+            auth_login(request, user)
+            instance = get_object_or_404(Merchant, user=user)
+            if details_form.is_valid():
+                instance.address = details_form.cleaned_data.get('address')
+                instance.save()
+            else:
+                print("somethings wrong with the form")
+            # Redirect to a success page.
+            return redirect('home')
+    else:
+        form = SignUpForm()
+        details_form = MerchantDetailForm()
+    dictionary = {'form': form, 'details_form': details_form}
+    return render(request, 'inventory/signup.html', dictionary)
+
+
+def login(request):
+    form = LoginForm()
+    context_dict = {}
+    context_dict['form'] = form
+    error_message = ""
+    if request.method == 'POST':
+        username = request.POST['username']
+        password = request.POST['password']
+        user = authenticate(username=username, password=password)
+        if user is not None:
+            auth_login(request, user)
+            current_url = resolve(request.path_info).url_name
+            print(current_url)
+            # Redirect to a success page.
+            return redirect('home')
+        else:
+            error_message = "You are not a registered user please sign up"
+            form = LoginForm()
+            context_dict['form'] = form
+            context_dict['error_message'] = error_message
+    return render(request, 'inventory/login.html', context_dict)
+
+
+def logout(request):
+    auth_logout(request)
+    return render(request, 'inventory/index.html')
diff --git a/templates/inventory/home.html b/templates/inventory/home.html
new file mode 100644
index 0000000..424bab3
--- /dev/null
+++ b/templates/inventory/home.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+       <title>Home</title>
+</head>
+<body>
+<h1>Welcome!!!!</h1>
+<h4>You are successfully loged in</h4>
+<a href="/logout">logout</a></li> 
+</body>
+</html>
\ No newline at end of file
diff --git a/templates/inventory/index.html b/templates/inventory/index.html
new file mode 100644
index 0000000..ab79a2b
--- /dev/null
+++ b/templates/inventory/index.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+       <title>Login</title>
+</head>
+<body>
+<div style="background: linear-gradient(0deg, #F6F0E1 20%, rgba(200,200,200,0) 
100%); height: 100%"; >
+  <div>
+    <div>
+      <p>Login</p>
+    </div>
+    
+    <form method="post">
+       <div>
+        <span>Login</span>
+        <a href="/login">Log in</a>
+      </div>
+      <div>
+        <span>New User?</span>
+        <a href="/signup">Create Account</a>
+      </div>
+    </div>
+        
+      </fieldset>
+    </form>
+    
+  </div>
+</div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/templates/inventory/login.html b/templates/inventory/login.html
new file mode 100644
index 0000000..d407b3f
--- /dev/null
+++ b/templates/inventory/login.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html>
+<head>
+       <title>Login</title>
+</head>
+<body>
+<div style="background: linear-gradient(0deg, #F6F0E1 20%, rgba(200,200,200,0) 
100%); height: 100%"; >
+  <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>
+
+        <div>
+      <div>
+        <span>New User?</span>
+        <a href="/signup">Create Account</a>
+      </div>
+    </div>
+        
+      </fieldset>
+    </form>
+    
+  </div>
+</div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/templates/inventory/signup.html b/templates/inventory/signup.html
new file mode 100644
index 0000000..5a0137f
--- /dev/null
+++ b/templates/inventory/signup.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+<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> 
+    {% 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 %}
+
+        {% 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>
+
+      <div>
+    {% endblock %}
+</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]