Skip to content

Commit

Permalink
Added all the backend features
Browse files Browse the repository at this point in the history
  • Loading branch information
ArshadAman committed Jun 7, 2023
1 parent 480921d commit 38f9fb8
Show file tree
Hide file tree
Showing 335 changed files with 50,395 additions and 4,113 deletions.
Binary file modified masters/__pycache__/views.cpython-310.pyc
Binary file not shown.
3 changes: 2 additions & 1 deletion masters/templates/masters/all_orders.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
</head>

<body>
<div class="d-flex justify-content-center">
<h1 class="text-center mt-5">Master's Portal</h1>
<div class="d-flex justify-content-center flex-wrap">
{% for order in all_orders %}
{% if not order.order_status == "ORDER READY" %}
<a href="{% url 'view-perticular-order' id=order.id %}" style="text-decoration: none;">
Expand Down
106 changes: 96 additions & 10 deletions masters/templates/masters/login.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,103 @@
<!DOCTYPE html>
<html lang="en">
<html lang="en-us" >
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Masters</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">

<title>Log in | VERSUITALITY</title>

<!-- Font Awesome Icons -->
<link rel="stylesheet" href="/static/vendor/fontawesome-free/css/all.min.css">

<!-- Bootstrap and adminLTE -->
<link rel="stylesheet" href="/static/vendor/adminlte/css/adminlte.min.css">

<!-- Bootswatch theme -->

<link rel="stylesheet" href="/static/vendor/bootswatch/litera/bootstrap.min.css" id="jazzmin-theme" />




<!-- Custom fixes for django -->
<link rel="stylesheet" href="/static/jazzmin/css/main.css">


<!-- Custom CSS -->
<link rel="stylesheet" href="/static/css/styles.css">


<!-- favicons -->
<link rel="shortcut icon" href="/static/dashboard/vl.png" type="image/png">
<link rel="icon" href="/static/dashboard/vl.png" sizes="32x32" type="image/png">


<!-- Google Font: Source Sans Pro -->
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">




</head>
<body>
<body class="hold-transition jazzmin-login-page">

<div class="login-box">
<div class="login-logo">
<h1>
<picture>
<source
srcset="/static/dashboard/vl.png"
media="(prefers-color-scheme: dark)">
<img src="/static/dashboard/vl.png" alt="VERSUITALITY">
</picture>
</h1>
</div>

<div class="card">
<div class="card-body">

<p class="login-box-msg">Welcome to the VERSUITALITY</p>
<form action="" method="post">
{% csrf_token %}
<input type="text" name="username">
<input type="password" name="password" id="">
<input type="submit" value="Login">
<div class="input-group mb-3">
<input type="text" name="username" class="form-control" placeholder="Username" required>
<div class="input-group-append">
<div class="input-group-text">
<span class="fas fa-user"></span>
</div>
</div>
</div>
<div class="input-group mb-3">
<input type="password" name="password" class="form-control" placeholder="Password" required>
<div class="input-group-append">
<div class="input-group-text">
<span class="fas fa-lock"></span>
</div>
</div>
</div>

<div class="row">
<div class="col-12">
<button type="submit" class="btn btn-outline-primary btn-block">
Log in
</button>
</div>
</div>
</form>

</div>
</div>
</div>

<!-- jQuery -->
<script src="/static/admin/js/vendor/jquery/jquery.js"></script>
<!-- Bootstrap 4 -->
<script src="/static/vendor/bootstrap/js/bootstrap.min.js"></script>
<!-- AdminLTE App -->
<script src="/static/vendor/adminlte/js/adminlte.min.js"></script>



</body>
</html>
</html>
47 changes: 40 additions & 7 deletions masters/templates/masters/single_order.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,26 +109,59 @@ <h4 class="mx-3">Delivery Date: {{order.order_due_date}}</h4>
<td class="text-center">{{order.measurement.Kurta_Shirt_Additional_Information}}</td>
<td class="text-center">{{order.measurement.Trouser_Additional_Information}}</td>
</tr>
<tr>
<td class="text-center">{{order.measurement.jacket_order_quantity}} Pcs</td>
<td class="text-center">{{order.measurement.kurta_order_quantity}} Pcs</td>
<td class="text-center">{{order.measurement.trouser_order_quantity}} Pcs</td>
</tr>
<tr>
<td class="text-center"><img src="/images/{{order.measurement.Blazer_sample_cloth_image}}" alt="" width="100%" height="200px"></td>
<td class="text-center"><img src="/images/{{order.measurement.Kurta_sample_cloth_image}}" alt="" width="100%" height="200px"></td>
<td class="text-center"><img src="/images/{{order.measurement.Trouser_sample_cloth_image}}" alt="" width="100%" height="200px"></td>
</tr>
</table>
<form action="" method="POST">
<form action="" method="POST" class="d-flex flex-column align-items-center justify-content-center">
{% csrf_token %}
<input type="radio" name="status" id="cutting" value="cutting" {% if order.order_status == "CUTTING STARTED" %} checked {% endif %}>
<label for="cutting">Cutting</label>
<input type="radio" name="status" id="stitching" value="stitching" {% if order.order_status == "STITCHING STARTED" %} checked {% endif %}>
<label for="stitching">Stitching</label>
<input type="radio" name="status" id="finished" value="finished" {% if order.order_status == "ORDER READY" %} checked {% endif %}>
<label for="finished">Order Ready</label>
<div>
<input type="radio" name="status" id="cutting" value="cutting" {% if order.order_status == "CUTTING STARTED" %} checked {% endif %}>
<label for="cutting">Cutting</label>
</div>
<div>
<input type="radio" name="status" id="stitching" value="stitching" {% if order.order_status == "STITCHING STARTED" %} checked {% endif %}>
<label for="stitching">Stitching</label>
</div>
<div>
<input type="radio" name="status" id="finished" value="finished" {% if order.order_status == "ORDER READY" %} checked {% endif %}>
<label for="finished">Order Ready</label>
</div>

<div class="d-flex align-items-center">
<button class="btn btn-dark btn-sm mx-2" type="button" onclick="decrease()">-</button><input type="number" name="number" id="number" value={{order.number_of_order_done}} class="text-center"><button class="btn btn-dark btn-sm mx-2" onclick="increase()" type="button">+</button>
</div>

<div class="my-3">
<button type="submit" class="btn btn-success">Update Status</button>
</div>
</form>

</div>

<script>
function increase(){
let val = Number(document.getElementById("number").value);
val++;
document.getElementById("number").value = val;
}
function decrease(){
let val = Number(document.getElementById("number").value);
if(val<=0){
document.getElementById("number").value = 0;
}
else{
val--;
document.getElementById("number").value = val;
}
}
</script>
</body>
</html>
7 changes: 6 additions & 1 deletion masters/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from order.models import Order
from django.http import HttpResponse
from django.contrib.auth import authenticate, logout, login
from django.contrib.auth.decorators import login_required
from django.contrib.auth.decorators import login_required, user_passes_test

# Create your views here.

Expand All @@ -18,15 +18,18 @@ def master_login(request):
return render(request, 'masters/login.html')

@login_required(login_url="master-login")
@user_passes_test(lambda user: user.username == 'master', login_url="login-quality")
def view_orders(request):
all_orders = Order.objects.all().order_by('order_priorty')
return render(request, 'masters/all_orders.html', context={"all_orders":all_orders})

@login_required(login_url="master-login")
@user_passes_test(lambda user: user.username == 'master', login_url="login-quality")
def view_perticular_order(request, id):
order = Order.objects.get(id = id)
if request.method == "POST":
data = request.POST["status"]
number_of_order = request.POST["number"]
if data == "cutting".lower():
order.order_status = "CUTTING STARTED"
order.save()
Expand All @@ -36,6 +39,8 @@ def view_perticular_order(request, id):
elif data == "finished".lower():
order.order_status = "ORDER READY"
order.save()
order.number_of_order_done = number_of_order
order.save()
return render(request, 'masters/single_order.html', context={"order":order})

@login_required(login_url="master-login")
Expand Down
Binary file modified oms/__pycache__/settings.cpython-310.pyc
Binary file not shown.
Binary file modified oms/__pycache__/urls.cpython-310.pyc
Binary file not shown.
Loading

0 comments on commit 38f9fb8

Please sign in to comment.