Adjusted views and urls accordingly.

Made changes to order and inventory layout
to accommodate additional views.
parent 532f6515
......@@ -143,7 +143,7 @@ header {
.buttonpanel {
display: flex;
justify-content: space-around;
justify-content: center;
}
.order-button {
......@@ -207,7 +207,7 @@ a:hover {
justify-content: center;
}
#baseflavor {
#baseflavor, #ingredient-table {
display: flex;
justify-content: center;
}
......
......@@ -8,50 +8,15 @@
{% block content %}
<h1 class='view-title'>Inventory</h1>
<!-- SEARCH BOX -->
<div id="filter-area">
<select name="search-filter" id="search-filter">
<option selected="selected">Filter</option>
<option value="category">Category</option>
<option value="name_alphabetical">Name: A-to-Z</option>
</select>
</div>
<div class="inventory buttonpanel">
<button class="add ingredient"><a href="{% url 'addingredient' %}">Add Ingredient</a></button>
<button class="add BaseFlavor"><a href="{% url 'addBaseFlavor' %}">Add Base Flavor</a></button>
<button class="add show BaseFlavor"><a href="{% url 'showBaseFlavors' %}">Show Base Flavors</a></button>
<button class="add show BaseFlavor"><a href="{% url 'baseFlavors' %}">Base Flavors</a></button>
<button class="add show addOnIngredients"><a href="{% url 'addOnIngredients' %}">Ingredients</a></button>
</div>
<div id="order-table">
<table>
<!-- TABLE HEADER -->
<tr>
<th>Ingredient Name</th>
<th>Category</th>
<th>Quantity</th>
<th>Price per Serving</th>
<th>Replenished Stock?</th>
<th>Options</th>
</tr>
<div class="instructions help">
<!-- TABLE ROWS WITH INFO -->
{% for ingredient in inventory %}
<tr>
<td>{{ingredient.ingredient_name}}</td>
<td>{{ingredient.category}}</td>
<td>{{ingredient.quantity}}</td>
<td>{{ingredient.price_per_serving}}</td>
<td>{{ingredient.replenished_stock}}</td>
<td>
<button class="edit-value edit">Edit</button>
<button class="edit-value delete">Delete</button>
</td>
</tr>
{% endfor %}
</table>
</div>
{% endblock %}
......@@ -10,51 +10,16 @@
<div class="title-area">
<h1 class='view-title'>Order</h1>
<h3 class='view-subtitle'>Order Slip</h3>
</div>
<div class="order buttonpanel">
<!-- GETTING THE RESULTS AREA-->
<div class="getresults area">
<h4 class="title-area">Slips and Reciepts</h4>
<div class="get-results">
<button class="loadresults orderslip-button"><a href="{% url 'order' %}">Order Slip</a></button>
<button class="loadresults orderslip-button"><a href="{% url 'orderslip' %}">Order Slip</a></button>
<button class="loadresults receipt-button"><a href="{% url 'receipt' %}">Receipt</a></button>
</div>
</div>
<!-- FILLING IN FORMS AREA-->
<div class="addingforms area">
<h4 class="title-area">Adding in new customers, items and orders</h4>
<div class="add-forms">
<button class="add orderform-button"><a href="{% url 'addorder' %}">Add Order</a></button>
<button class="add itemform-button"><a href="{% url 'additem' %}">Add Item</a></button>
<button class="add customerform-button"><a href="{% url 'addcustomer' %}">Add Customer</a></button>
</div>
</div>
</div>
<!-- TABLE AREA-->
<div id="order-table">
<table>
<!-- TABLE HEADER -->
<tr>
<th>customer_name</th>
<th>date</th>
<th>item</th>
<th>Employee in charge</th>
</tr>
<!-- TABLE ROW WITH INFO -->
{% for order in orders%}
<tr>
<td>{{order.customer}}</td>
<td>{{order.order_date}}</td>
<td>{{order.item}}</td>
<td>{{order.employee}}</td>
</tr>
{%endfor%}
</table>
</div>
{% endblock %}
......@@ -25,6 +25,11 @@ urlpatterns = [
path('week_query', week_query, name='week_query'),
path('role_query', role_query, name='role_query'),
path('alphabetical_query', alphabetical_query, name='alphabetical_query'),
path('showBaseFlavors', showBaseFlavors, name='showBaseFlavors'),
# filtered views
path('baseFlavors', baseFlavors, name='baseFlavors'),
path('addOnIngredients', addOnIngredients, name='addOnIngredients'),
path('receipt', receipt, name='receipt'),
path('orderslip', orderSlip, name='orderslip'),
]
......@@ -9,20 +9,40 @@ from .models import *
def homepage(request):
return render(request, "blizzardblast/templates/index.html")
# ========================== ORDERS =====================================
def order(request):
return render(request, "blizzardblast/templates/order.html")
def orderSlip(request):
orders_context = Orders.objects.all()
return render(request, "blizzardblast/templates/order.html", {'orders': orders_context})
return render(request, "blizzardblast/templates/filtered_views/orderslip.html", {'orders': orders_context})
def receipt(request):
return render(request, "blizzardblast/templates/receipt.html")
return render(request, "blizzardblast/templates/filtered_views/receipt.html")
# ========================== INVENTORY =====================================
def inventory(request):
return render(request, "blizzardblast/templates/inventory.html")
# ADD ONS / INGREDIENTS
def addOnIngredients(request):
ingredients_context = Ingredient.objects.all()
contexts = {
'inventory' : ingredients_context
}
return render(request, "blizzardblast/templates/inventory.html", contexts)
return render(request, "blizzardblast/templates/filtered_views/addons_ingredient.html", contexts)
# BASE FLAVORS
def baseFlavors(request):
show_bfs = BaseFlavor.objects.all()
contexts = {
'show_bfs' : show_bfs
}
return render(request, "blizzardblast/templates/filtered_views/baseFlavors.html", contexts)
def schedule(request):
all_values = EmployeeRole.objects.all()
......@@ -72,12 +92,6 @@ def alphabetical_query(request):
'alphabetical': alphabetical_query
})
def showBaseFlavors(request):
show_bfs = BaseFlavor.objects.all()
contexts = {
'show_bfs' : show_bfs
}
return render(request, "blizzardblast/templates/showBaseFlavors.html", contexts)
# ========================== FORMS ==========================
def addorder(request):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment