Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Blizzard Blast
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Martina Therese R. Reyes
Blizzard Blast
Commits
de12c436
Commit
de12c436
authored
Dec 12, 2021
by
Martina Therese R. Reyes
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'MateBranch'
parents
51830b93
7b8e0d88
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
138 additions
and
9 deletions
+138
-9
.gitignore
.gitignore
+2
-1
settings.py
blizzardblast/settings.py
+1
-1
styles.css
blizzardblast/static/css/styles.css
+4
-4
schedule.html
blizzardblast/templates/schedule.html
+18
-0
0001_initial.py
main/migrations/0001_initial.py
+38
-0
models.py
main/models.py
+44
-1
views.py
main/views.py
+31
-2
No files found.
.gitignore
View file @
de12c436
*.pyc
.env
\ No newline at end of file
.env
*.sql
\ No newline at end of file
blizzardblast/settings.py
View file @
de12c436
...
...
@@ -42,6 +42,7 @@ INSTALLED_APPS = [
'django.contrib.sessions'
,
'django.contrib.messages'
,
'django.contrib.staticfiles'
,
'main'
]
MIDDLEWARE
=
[
...
...
@@ -91,7 +92,6 @@ DATABASES = {
}
# Password validation
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
...
...
blizzardblast/static/css/styles.css
View file @
de12c436
...
...
@@ -75,14 +75,14 @@ ul {
/* ======= HEADING ======= */
header
{
padding
:
0.5rem
;
animation
:
gradient
1s
1
s
infinite
;
animation
:
gradient
5s
5
s
infinite
;
color
:
#FEFCFD
;
}
@keyframes
gradient
{
0
%
{
background-color
:
#5D5D81
;
}
}
100
%
{
background-color
:
#BFCDE0
;
}
...
...
@@ -215,7 +215,7 @@ header {
color
:
#FEFCFD
;
}
#order-table
,
#receipt-table
{
#order-table
,
#receipt-table
,
#scheduling-table
{
display
:
flex
;
justify-content
:
center
;
}
...
...
@@ -260,4 +260,4 @@ table, th {
cursor
:
pointer
;
background-color
:
#3B3355
;
color
:
#FEFCFD
;
}
\ No newline at end of file
}
blizzardblast/templates/schedule.html
View file @
de12c436
...
...
@@ -7,6 +7,24 @@
{% endblock %}
{% block content %}
<h1
class=
'view-title'
>
Schedule
</h1>
<table
id=
"scheduling-table"
>
<tr>
<th>
Week
</th>
<th>
Staff
</th>
<th>
Role
</th>
<th>
Day-Mgr
</th>
</tr>
{% for m in manager%}
<tr>
<td>
{{m.role_date}}
</td>
<td>
{{m.employee.employee_name}}
</td>
<td>
{{m.role_description}}
</td>
<td>
{{m.is_manager}}
</td>
</tr>
{% endfor %}
</table>
{% endblock %}
main/migrations/0001_initial.py
0 → 100644
View file @
de12c436
# Generated by Django 3.1.7 on 2021-12-12 06:02
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
initial
=
True
dependencies
=
[
]
operations
=
[
migrations
.
CreateModel
(
name
=
'Employee'
,
fields
=
[
(
'employee_id'
,
models
.
IntegerField
(
primary_key
=
True
,
serialize
=
False
)),
(
'employee_name'
,
models
.
CharField
(
max_length
=
255
)),
],
options
=
{
'db_table'
:
'employee'
,
'managed'
:
False
,
},
),
migrations
.
CreateModel
(
name
=
'Employeerole'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'role_date'
,
models
.
DateField
()),
(
'role_description'
,
models
.
CharField
(
choices
=
[(
'Cashier'
,
'Cashier'
),
(
'Preparation'
,
'Preparation'
),
(
'Cleaning'
,
'Cleaning'
)],
max_length
=
20
)),
(
'is_manager'
,
models
.
CharField
(
max_length
=
1
)),
],
options
=
{
'db_table'
:
'employeerole'
,
'managed'
:
False
,
},
),
]
main/models.py
View file @
de12c436
# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# * Make sure each ForeignKey and OneToOneField has `on_delete` set to the desired behavior
# * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table
# Feel free to rename the models, but don't rename db_table values or field names.
from
django.db
import
models
# Create your models here.
class
Employee
(
models
.
Model
):
employee_id
=
models
.
IntegerField
(
primary_key
=
True
)
employee_name
=
models
.
CharField
(
max_length
=
255
)
class
Meta
:
managed
=
False
db_table
=
'employee'
class
EmployeeRole
(
models
.
Model
):
ROLES
=
[
(
'Cashier'
,
'Cashier'
),
(
'Preparation'
,
'Preparation'
),
(
'Cleaning'
,
'Cleaning'
),
]
IS_MANAGER
=
[
(
'Y'
,
'Y'
),
(
'N'
,
'N'
),
]
role_id
=
models
.
AutoField
(
primary_key
=
True
)
role_date
=
models
.
DateField
()
employee
=
models
.
ForeignKey
(
Employee
,
models
.
DO_NOTHING
)
role_description
=
models
.
CharField
(
max_length
=
20
,
choices
=
ROLES
)
is_manager
=
models
.
CharField
(
max_length
=
1
,
choices
=
IS_MANAGER
)
def
employeename
(
self
):
return
self
.
employee
.
employee_name
class
Meta
:
managed
=
False
db_table
=
'employeerole'
main/views.py
View file @
de12c436
...
...
@@ -2,30 +2,59 @@ from django.shortcuts import render
from
django.http
import
HttpResponse
from
.forms
import
AddInventoryForm
,
AddOrderForm
from
.models
import
*
def
homepage
(
request
):
return
render
(
request
,
"blizzardblast/templates/index.html"
)
def
order
(
request
):
return
render
(
request
,
"blizzardblast/templates/order.html"
)
def
receipt
(
request
):
return
render
(
request
,
"blizzardblast/templates/receipt.html"
)
def
inventory
(
request
):
return
render
(
request
,
"blizzardblast/templates/inventory.html"
)
def
schedule
(
request
):
return
render
(
request
,
"blizzardblast/templates/schedule.html"
)
# 1: FILTER EMPLOYEES BY MANAGER FOR THE DAY - mate
ismanager_query
=
EmployeeRole
.
objects
.
all
()
.
filter
(
is_manager
=
'Y'
)
# 2: FILTER EMPLOYEES AND ROLES IN ALPHABETICAL ORDER - felizia
employee_role_order_query
=
EmployeeRole
.
objects
.
all
()
.
order_by
(
'role_description'
)
# 3 : FILTER BY WEEK - dedz
week_query1
=
EmployeeRole
.
objects
.
all
()
.
filter
(
role_date__range
=
[
"2025-09-01"
,
"2025-09-06"
])
.
order_by
(
'role_date'
)
week_query2
=
EmployeeRole
.
objects
.
all
()
.
filter
(
role_date__range
=
[
"2025-09-08"
,
"2025-09-13"
])
.
order_by
(
'role_date'
)
# 4: FILTER EMPLOYEES BY ROLES - xtine
role_query1
=
EmployeeRole
.
objects
.
all
()
.
filter
(
role_description
=
'Cashier'
)
role_query2
=
EmployeeRole
.
objects
.
all
()
.
filter
(
role_description
=
'Preparation'
)
role_query3
=
EmployeeRole
.
objects
.
all
()
.
filter
(
role_description
=
'Cleaning'
)
# 5: FILTER EMPLOYEES AND ROLES BY DATE IN ORDER - xx
date_order_query
=
EmployeeRole
.
objects
.
all
()
.
order_by
(
'role_date'
)
return
render
(
request
,
"blizzardblast/templates/schedule.html"
,
{
'manager'
:
ismanager_query
}
)
def
report
(
request
):
return
render
(
request
,
"blizzardblast/templates/report.html"
)
def
addorder
(
request
):
form
=
AddOrderForm
()
return
render
(
request
,
"blizzardblast/templates/addorder.html"
,
{
'form'
:
form
})
def
addinventory
(
request
):
form
=
AddInventoryForm
()
return
render
(
request
,
"blizzardblast/templates/addinventory.html"
,
{
'inventory_form'
:
form
})
\ No newline at end of file
return
render
(
request
,
"blizzardblast/templates/addinventory.html"
,
{
'inventory_form'
:
form
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment