Skip to content

Commit

Permalink
Added food type status to menu
Browse files Browse the repository at this point in the history
-Foods are now placed under their food_type so that they are sorted by
category
  • Loading branch information
Wilson authored and Wilson committed Dec 7, 2021
1 parent 073b0ab commit 79c2128
Show file tree
Hide file tree
Showing 16 changed files with 139 additions and 88 deletions.
Binary file modified DormDash/__pycache__/settings.cpython-310.pyc
Binary file not shown.
16 changes: 14 additions & 2 deletions DormDashApp/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 3.2.8 on 2021-11-30 03:04
# Generated by Django 3.2.8 on 2021-12-07 02:51

import django.contrib.auth.models
import django.contrib.auth.validators
Expand All @@ -16,6 +16,18 @@ class Migration(migrations.Migration):
]

operations = [
migrations.CreateModel(
name='menuItem',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.TextField()),
('food_pic', models.ImageField(upload_to='images/')),
('restaurant_name', models.TextField(default='none')),
('price', models.DecimalField(decimal_places=2, default=0.0, max_digits=6)),
('description', models.TextField(default='Other', max_length=144)),
('food_type', models.TextField(choices=[('A', 'Appetizer'), ('E', 'Entree'), ('D', 'Dessert'), ('S', 'Side'), ('D', 'Drink')], max_length=1)),
],
),
migrations.CreateModel(
name='Order',
fields=[
Expand Down Expand Up @@ -68,7 +80,7 @@ class Migration(migrations.Migration):
fields=[
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='DormDashApp.user')),
('phone_number', models.CharField(max_length=15)),
('email', models.CharField(max_length=15)),
('email', models.CharField(max_length=30)),
],
),
migrations.CreateModel(
Expand Down
18 changes: 18 additions & 0 deletions DormDashApp/migrations/0002_alter_menuitem_food_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.8 on 2021-12-07 03:05

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('DormDashApp', '0001_initial'),
]

operations = [
migrations.AlterField(
model_name='menuitem',
name='food_type',
field=models.TextField(choices=[('A', 'Appetizer'), ('E', 'Entree'), ('D', 'Dessert'), ('S', 'Side'), ('R', 'Drink')], max_length=1),
),
]
21 changes: 0 additions & 21 deletions DormDashApp/migrations/0002_menuitem.py

This file was deleted.

18 changes: 0 additions & 18 deletions DormDashApp/migrations/0003_menuitem_restaurant_name.py

This file was deleted.

28 changes: 0 additions & 28 deletions DormDashApp/migrations/0004_auto_20211130_1034.py

This file was deleted.

18 changes: 0 additions & 18 deletions DormDashApp/migrations/0005_alter_menuitem_description.py

This file was deleted.

10 changes: 10 additions & 0 deletions DormDashApp/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ class menuItem(models.Model):
price = models.DecimalField(default=0.00, decimal_places=2, max_digits=6)
description = models.TextField(default='Other', max_length=144)

FOOD_TYPES = (
('A', 'Appetizer'),
('E', 'Entree'),
('D', 'Dessert'),
('S', 'Side'),
('R', 'Drink')
)

food_type = models.TextField(max_length=1,choices=FOOD_TYPES)

def get_name(self):
return self.name

Expand Down
98 changes: 97 additions & 1 deletion DormDashApp/templates/menu_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,35 @@
</p>

<div align="center">
<p align="center" style="font-size: 35px;font-family: Lobster;color:red;">
Appetizers
</p>
<table class="" style="width: 40%;">
{% for entry in menulist %}
{% if entry.restaurant_name == rn %}
{% if entry.restaurant_name == rn and entry.food_type == 'A' %}

<tr>

<td style="width: 150px;padding-bottom: 1em;">
<a href="#"><img src="{{ entry.food_pic.url }}" width="150" height="150"></a>
</td>
<td>
<a href="#"><p style="font-size: 25px;color: rgba(0,0,0,.65);text-decoration: underline; text-decoration-color: white;">{{ entry.name}}</p></a>
<p style="font-size: 18px;color: rgba(53, 53, 53, 0.788);text-decoration: underline; text-decoration-color: white;">${{ entry.price}}</p>
<p style="font-size: 18px;color: rgba(53, 53, 53, 0.788);text-decoration: underline; text-decoration-color: white;">{{ entry.description}}</p>
</td>

</tr>

{% endif %}
{% endfor %}
</table>
<table class="" style="width: 40%;">
<p align="center" style="font-size: 35px;font-family: Lobster;color:red;">
Entrees
</p>
{% for entry in menulist %}
{% if entry.restaurant_name == rn and entry.food_type == 'E' %}

<tr>

Expand All @@ -21,6 +47,76 @@
</td>

</tr>

{% endif %}
{% endfor %}
</table>
<p align="center" style="font-size: 35px;font-family: Lobster;color:red;">
Desserts
</p>
<table class="" style="width: 40%;">
{% for entry in menulist %}
{% if entry.restaurant_name == rn and entry.food_type == 'D' %}

<tr>

<td style="width: 150px;padding-bottom: 1em;">
<a href="#"><img src="{{ entry.food_pic.url }}" width="150" height="150"></a>
</td>
<td>
<a href="#"><p style="font-size: 25px;color: rgba(0,0,0,.65);text-decoration: underline; text-decoration-color: white;">{{ entry.name}}</p></a>
<p style="font-size: 18px;color: rgba(53, 53, 53, 0.788);text-decoration: underline; text-decoration-color: white;">${{ entry.price}}</p>
<p style="font-size: 18px;color: rgba(53, 53, 53, 0.788);text-decoration: underline; text-decoration-color: white;">{{ entry.description}}</p>
</td>

</tr>

{% endif %}
{% endfor %}
</table>
<p align="center" style="font-size: 35px;font-family: Lobster;color:red;">
Sides
</p>
<table class="" style="width: 40%;">
{% for entry in menulist %}
{% if entry.restaurant_name == rn and entry.food_type == 'S' %}

<tr>

<td style="width: 150px;padding-bottom: 1em;">
<a href="#"><img src="{{ entry.food_pic.url }}" width="150" height="150"></a>
</td>
<td>
<a href="#"><p style="font-size: 25px;color: rgba(0,0,0,.65);text-decoration: underline; text-decoration-color: white;">{{ entry.name}}</p></a>
<p style="font-size: 18px;color: rgba(53, 53, 53, 0.788);text-decoration: underline; text-decoration-color: white;">${{ entry.price}}</p>
<p style="font-size: 18px;color: rgba(53, 53, 53, 0.788);text-decoration: underline; text-decoration-color: white;">{{ entry.description}}</p>
</td>

</tr>

{% endif %}
{% endfor %}
</table>
<p align="center" style="font-size: 35px;font-family: Lobster;color:red;">
Drinks
</p>
<table class="" style="width: 40%;">
{% for entry in menulist %}
{% if entry.restaurant_name == rn and entry.food_type == 'R' %}

<tr>

<td style="width: 150px;padding-bottom: 1em;">
<a href="#"><img src="{{ entry.food_pic.url }}" width="150" height="150"></a>
</td>
<td>
<a href="#"><p style="font-size: 25px;color: rgba(0,0,0,.65);text-decoration: underline; text-decoration-color: white;">{{ entry.name}}</p></a>
<p style="font-size: 18px;color: rgba(53, 53, 53, 0.788);text-decoration: underline; text-decoration-color: white;">${{ entry.price}}</p>
<p style="font-size: 18px;color: rgba(53, 53, 53, 0.788);text-decoration: underline; text-decoration-color: white;">{{ entry.description}}</p>
</td>

</tr>

{% endif %}
{% endfor %}
</table>
Expand Down
Binary file modified db.sqlite3
Binary file not shown.
Binary file added media/images/burger_CBahDgF.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/images/burger_JRATucj.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/images/burger_OC3Gr9E.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/images/burger_THOH3qp.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/images/burger_Z71WAzm.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/images/mcd_LXu7TPj.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 79c2128

Please sign in to comment.