Commit dbaf36de authored by foopie's avatar foopie

wahu

parents
Pipeline #1916 failed with stages
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tapas.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()
asgiref==3.3.1
boto3==1.17.78
botocore==1.20.78
dj-database-url==0.5.0
Django==2.2
django-filter==2.4.0
django-storages==1.11.1
gunicorn==20.1.0
jmespath==0.10.0
Pillow==8.2.0
psycopg2==2.8.6
python-dateutil==2.8.1
pytz==2021.1
s3transfer==0.4.2
six==1.16.0
sqlparse==0.4.1
urllib3==1.26.4
whitenoise==5.2.0
"""
ASGI config for tapas project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tapas.settings')
application = get_asgi_application()
"""
Django settings for tapas project.
Generated by 'django-admin startproject' using Django 3.0.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = ')+r(iegy+g#e$2_@s49&s%*m7rvsy(&7f4tj)ijvlz1cywr6jp'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = ['localhost', '127.0.0.1']
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'tapasapp.apps.TapasappConfig',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'tapas.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',
],
},
},
]
WSGI_APPLICATION = 'tapas.wsgi.application'
# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# Password validation
# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/3.0/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'Hongkong'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.0/howto/static-files/
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
"""tapas URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('tapasapp.urls')),
]
"""
WSGI config for tapas project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tapas.settings')
application = get_wsgi_application()
from django.contrib import admin
from .models import Dish, Account
# Register your models here.
admin.site.register(Dish)
admin.site.register(Account)
\ No newline at end of file
from django.apps import AppConfig
class TapasappConfig(AppConfig):
name = 'tapasapp'
# Generated by Django 3.0 on 2020-03-25 08:49
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Dish',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=300)),
('prep_time', models.IntegerField()),
('cook_time', models.IntegerField()),
],
),
]
# Generated by Django 3.1.7 on 2021-05-18 04:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tapasapp', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Account',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('username', models.CharField(max_length=300)),
('password', models.CharField(max_length=300)),
],
),
]
from django.db import models
# Create your models here.
class Dish(models.Model):
name = models.CharField(max_length=300)
prep_time = models.IntegerField()
cook_time = models.IntegerField()
objects = models.Manager()
def __str__(self):
return str(self.pk) + ": " + self.name
class Account(models.Model):
username = models.CharField(max_length=300)
password = models.CharField(max_length=300)
objects = models.Manager()
def __str__(self):
return str(self.pk) + ": " + self.username
def getUsername(self):
return self.username
def getPassword(self):
return self.password
\ No newline at end of file
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
/*!
* Bootstrap Reboot v4.4.1 (https://getbootstrap.com/)
* Copyright 2011-2019 The Bootstrap Authors
* Copyright 2011-2019 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/
*,
*::before,
*::after {
box-sizing: border-box;
}
html {
font-family: sans-serif;
line-height: 1.15;
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
article, aside, figcaption, figure, footer, header, hgroup, main, nav, section {
display: block;
}
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: #212529;
text-align: left;
background-color: #fff;
}
[tabindex="-1"]:focus:not(:focus-visible) {
outline: 0 !important;
}
hr {
box-sizing: content-box;
height: 0;
overflow: visible;
}
h1, h2, h3, h4, h5, h6 {
margin-top: 0;
margin-bottom: 0.5rem;
}
p {
margin-top: 0;
margin-bottom: 1rem;
}
abbr[title],
abbr[data-original-title] {
text-decoration: underline;
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
cursor: help;
border-bottom: 0;
-webkit-text-decoration-skip-ink: none;
text-decoration-skip-ink: none;
}
address {
margin-bottom: 1rem;
font-style: normal;
line-height: inherit;
}
ol,
ul,
dl {
margin-top: 0;
margin-bottom: 1rem;
}
ol ol,
ul ul,
ol ul,
ul ol {
margin-bottom: 0;
}
dt {
font-weight: 700;
}
dd {
margin-bottom: .5rem;
margin-left: 0;
}
blockquote {
margin: 0 0 1rem;
}
b,
strong {
font-weight: bolder;
}
small {
font-size: 80%;
}
sub,
sup {
position: relative;
font-size: 75%;
line-height: 0;
vertical-align: baseline;
}
sub {
bottom: -.25em;
}
sup {
top: -.5em;
}
a {
color: #007bff;
text-decoration: none;
background-color: transparent;
}
a:hover {
color: #0056b3;
text-decoration: underline;
}
a:not([href]) {
color: inherit;
text-decoration: none;
}
a:not([href]):hover {
color: inherit;
text-decoration: none;
}
pre,
code,
kbd,
samp {
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
font-size: 1em;
}
pre {
margin-top: 0;
margin-bottom: 1rem;
overflow: auto;
}
figure {
margin: 0 0 1rem;
}
img {
vertical-align: middle;
border-style: none;
}
svg {
overflow: hidden;
vertical-align: middle;
}
table {
border-collapse: collapse;
}
caption {
padding-top: 0.75rem;
padding-bottom: 0.75rem;
color: #6c757d;
text-align: left;
caption-side: bottom;
}
th {
text-align: inherit;
}
label {
display: inline-block;
margin-bottom: 0.5rem;
}
button {
border-radius: 0;
}
button:focus {
outline: 1px dotted;
outline: 5px auto -webkit-focus-ring-color;
}
input,
button,
select,
optgroup,
textarea {
margin: 0;
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
button,
input {
overflow: visible;
}
button,
select {
text-transform: none;
}
select {
word-wrap: normal;
}
button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
button:not(:disabled),
[type="button"]:not(:disabled),
[type="reset"]:not(:disabled),
[type="submit"]:not(:disabled) {
cursor: pointer;
}
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
padding: 0;
border-style: none;
}
input[type="radio"],
input[type="checkbox"] {
box-sizing: border-box;
padding: 0;
}
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"] {
-webkit-appearance: listbox;
}
textarea {
overflow: auto;
resize: vertical;
}
fieldset {
min-width: 0;
padding: 0;
margin: 0;
border: 0;
}
legend {
display: block;
width: 100%;
max-width: 100%;
padding: 0;
margin-bottom: .5rem;
font-size: 1.5rem;
line-height: inherit;
color: inherit;
white-space: normal;
}
progress {
vertical-align: baseline;
}
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
[type="search"] {
outline-offset: -2px;
-webkit-appearance: none;
}
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-file-upload-button {
font: inherit;
-webkit-appearance: button;
}
output {
display: inline-block;
}
summary {
display: list-item;
cursor: pointer;
}
template {
display: none;
}
[hidden] {
display: none !important;
}
/*# sourceMappingURL=bootstrap-reboot.css.map */
\ No newline at end of file
This diff is collapsed.
/*!
* Bootstrap Reboot v4.4.1 (https://getbootstrap.com/)
* Copyright 2011-2019 The Bootstrap Authors
* Copyright 2011-2019 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus:not(:focus-visible){outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]){color:inherit;text-decoration:none}a:not([href]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}
/*# sourceMappingURL=bootstrap-reboot.min.css.map */
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
.footer {
position: absolute;
bottom: 0;
width: 100%;
height: 40px;
line-height: 40px;
color: white;
text-align: center;
}
\ No newline at end of file
.navbar-custom {
background-color: #800020;
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
{% extends 'tapasapp/base.html' %}
{% load static %}
<!DOCTYPE html>
<html lang="en">
<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">
{% block title %}<title>Add to Menu</title>{% endblock %}
</head>
<body>
{% block sidebar %}
<li class="nav-item">
<a href="{% url 'view_menu' %}" class="nav-link active" aria-current="page">
<svg class="bi me-2" width="16" height="16"><use xlink:href="#home"></use></svg>
Back to main
</a>
</li>
{% endblock %}
{% block content %}
<form action="{% url 'add_menu' %}" method="POST">{% csrf_token %}
<label for="dname">Dish Name</label>
<input type="text" name="dname" id="dname">
<label for="ctime">Cooking Time</label>
<input type="number" name="ctime" id="ctime">
<label for="ptime">Prep Time</label>
<input type="number" name="ptime" id="ptime">
<input type="submit">
</form>
{% endblock %}
</body>
</html>
\ No newline at end of file
{% load static %}
<html>
<head>
{% block title %}<title>The List</title>{% endblock %}
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons">
<link rel="stylesheet" href="{% static '/bootstrap/css/bootstrap.css' %}">
<link rel="stylesheet" href="{% static '/bootstrap/css/custom.css' %}">
<script src="{% static '/bootstrap/jquery-3.4.1.slim.min.js' %}"></script>
<script src="{% static '/bootstrap/popper.min.js' %}"></script>
<script src="{% static '/bootstrap/js/bootstrap.min.js' %}"></script>
</head>
<body>
<nav class="navbar navbar-dark bg-custom mb-3 sticky-top" style="background-color: #590404;">
<a class="navbar-brand mb-0" href="{% url 'view_menu' %}">My Tapas Menu</span> </a>
<a href="{% url 'add_menu' %}" style="color:white"><i class="material-icons">add</i></a>
</nav>
<div>
<div class="row">
<div class="col-3">
<div class="d-flex flex-column p-3 text-white bg-dark" style="width: 280px;">
<a href="/" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-white text-decoration-none">
<svg class="bi me-2" width="40" height="32"><use xlink:href="#bootstrap"></use></svg>
<span class="fs-4">Sidebar</span>
</a>
<hr>
<ul class="nav nav-pills flex-column mb-auto">
{% block sidebar %}
<li class="nav-item">
<a href="#" class="nav-link active" aria-current="page">
<svg class="bi me-2" width="16" height="16"><use xlink:href="#home"></use></svg>
View Wines
</a>
</li>
<li>
<a href="#" class="nav-link text-white">
<svg class="bi me-2" width="16" height="16"><use xlink:href="#speedometer2"></use></svg>
View Large Dishes
</a>
</li>
<li>
<a href="#" class="nav-link text-white">
<svg class="bi me-2" width="16" height="16"><use xlink:href="#table"></use></svg>
View Coursed Menus
</a>
</li>
{% endblock %}
</ul>
<hr>
<div class="dropdown">
<a href="#" class="d-flex align-items-center text-white text-decoration-none dropdown-toggle" id="dropdownUser1" data-bs-toggle="dropdown" aria-expanded="false">
<img src="https://github.com/mdo.png" alt="" width="32" height="32" class="rounded-circle me-2">
<strong>mdo</strong>
</a>
<ul class="dropdown-menu dropdown-menu-dark text-small shadow" aria-labelledby="dropdownUser1">
<li><a class="dropdown-item" href="#">New project...</a></li>
<li><a class="dropdown-item" href="#">Settings</a></li>
<li><a class="dropdown-item" href="#">Profile</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#">Sign out</a></li>
</ul>
</div>
</div>
</div>
<div class="col-9">
{% include 'tapasapp/messages.html' %}
{% block content %}
{% endblock %}
</div>
</div>
</div>
<footer class="footer bg-custom" style="background-color: #590404;">
<!-- Copyright -->
<div class="container">&copy; 2020</div>
<!-- Copyright -->
</footer>
</body>
</html>
\ No newline at end of file
{% load static %}
<html>
<head>
<title>The List</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons">
<link rel="stylesheet" href="{% static '/bootstrap/css/bootstrap.css' %}">
<link rel="stylesheet" href="{% static '/bootstrap/css/custom.css' %}">
<script src="{% static '/bootstrap/jquery-3.4.1.slim.min.js' %}"></script>
<script src="{% static '/bootstrap/popper.min.js' %}"></script>
<script src="{% static '/bootstrap/js/bootstrap.min.js' %}"></script>
</head>
<body>
<nav class="navbar navbar-dark bg-custom mb-3 sticky-top" style="background-color: #590404;">
<a class="navbar-brand mb-0" href="{% url 'view_menu' %}">My Tapas Menu</span> </a>
<a href="" style="color:white"><i class="material-icons">add</i></a>
</nav>
<div class="container">
<div class="row">
<div class="col-12">
<table class="table table-striped">
<thead>
<th scope="col"> Name </th>
<th scope="col"> Cooking Time </th>
<th scope="col"> Prep Time </th>
</thead>
<tbody>
{% for d in dishes %}
<tr>
<td> {{ d.name }} </td>
<td> {{ d.prep_time }} </td>
<td> {{ d.cook_time }} </td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
<footer class="footer bg-custom" style="background-color: #590404;">
<!-- Copyright -->
<div class="container">&copy; 2020</div>
<!-- Copyright -->
</footer>
</body>
</html>
\ No newline at end of file
{% extends 'tapasapp/base.html' %}
{% load static %}
{% block content %}
<h1>CHANGE PASSWORD:</h1>
<form action="{% url 'change_password' lia.pk %}" method="POST">{% csrf_token %}
<label for="current_password">Current Password: </label>
<input type="text" name="current_password" id="current_password" minlength="8">
<label for="new_password">New Password: </label>
<input type="text" name="new_password" id="new_password" minlength="8">
<label for="confirm_new_password">Confirm New Password: </label>
<input type="text" name="confirm_new_password" id="confirm_new_password" minlength="8">
<input type="submit">
</form>
{% endblock %}
\ No newline at end of file
{% extends 'tapasapp/base.html' %}
{% load static %}
{% block content %}
<a href="{% url 'manage_account' pk=lia.pk %}"><button>MANAGE ACCOUNT</button></a>
<a href="{% url 'login' %}"><button>LOGOUT</button></a>
<div class="col-12">
<table class="table table-striped">
<thead>
<th scope="col"> Name </th>
<th scope="col"> Cooking Time </th>
<th scope="col"> Prep Time </th>
<th scope="col"> View Detail </th>
<th scope="col"> Update </th>
<th scope="col"> Delete </th>
</thead>
<tbody>
{% for d in dishes %}
<tr>
<td> {{ d.name }} </td>
<td> {{ d.cook_time }} </td>
<td> {{ d.prep_time }} </td>
<td> <a href="{% url 'view_detail' pk=d.pk %}" class="btn btn-dark">Details</a> </td>
<td> <a href="{% url 'update_dish' pk=d.pk %}" class="btn btn-info">UPDATE</a> </td>
<td> <a href="{% url 'delete_dish' pk=d.pk %}" class="btn btn-danger">DESTROY</a> </td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}
\ No newline at end of file
{% extends 'tapasapp/base.html' %}
{% load static %}
{% block content %}
<h1>LOGIN PAGE</h1>
<form action="{% url 'login' %}" method="POST">{% csrf_token %}
<label for="username">Username: </label>
<input type="email" name="username" id="username">
<label for="password">Password: </label>
<input type="password" name="password" id="password" minlength="8">
<input type="submit">
</form>
<a href="{% url 'signup' %}"><button class="btn btn-info">SIGNUP</button></a>
{% endblock %}
\ No newline at end of file
{% extends 'tapasapp/base.html' %}
{% load static %}
{% block content %}
<h1>MANAGE ACCOUNT PAGE</h1>
<h1>{{lia.username}}</h1>
<a href="{% url 'change_password' pk=lia.pk %}"><button>Change Password</button></a>
<a href="{% url 'delete_account' pk=lia.pk %}"><button>Delete Account</button></a>
<a href="{% url 'view_menu' %}"><button>Back</button></a>
{% endblock %}
\ No newline at end of file
{% if messages %}
{% for m in messages %}
<div style="color:red">
{{ m }}
</div>
{% endfor %}
{% endif %}
\ No newline at end of file
{% extends 'tapasapp/base.html' %}
{% load static %}
{% block content %}
<h1>SIGNUP PAGE</h1>
<form action="{% url 'signup' %}" method="POST">{% csrf_token %}
<label for="username">Username: </label>
<input type="email" name="username" id="username">
<label for="password">Password: </label>
<input type="password" name="password" id="password" minlength="8">
<input type="submit">
</form>
{% endblock %}
\ No newline at end of file
{% extends 'tapasapp/base.html' %}
{% load static %}
{% block content %}
<form action="{% url 'update_dish' pk=d.pk %}" method="POST">{% csrf_token %}
<label for="dname">Dish Name</label>
<input type="text" name="dname" id="dname" value="{{d.name}}" disabled>
<label for="ctime">Cooking Time</label>
<input type="number" name="ctime" id="ctime" value="{{d.cook_time}}">
<label for="ptime">Prep Time</label>
<input type="number" name="ptime" id="ptime" value="{{d.prep_time}}">
<input type="submit">
</form>
{% endblock %}
\ No newline at end of file
{% extends 'tapasapp/base.html' %}
{% load static %}
{% block content %}
<h1>{{d.name}}</h1>
<p>Cook Time: {{d.cook_time}}</p>
<p>Prep Time: {{d.prep_time}}</p>
<p>
<a href="{% url 'update_dish' pk=d.pk %}" class="btn btn-info">UPDATE</a>
<a href="{% url 'delete_dish' pk=d.pk %}" class="btn btn-danger">DELETE</a>
</p>
{% endblock %}
\ No newline at end of file
from django.test import TestCase
# Create your tests here.
from django.urls import path
from . import views
urlpatterns = [
path('basic_list', views.view_basic_list, name='view_basic_list'),
path('', views.login, name='login'),
path('signup', views.signup, name='signup'),
path('manage_account/<int:pk>/', views.manage_account, name='manage_account'),
path('change_password/<int:pk>/', views.change_password, name='change_password'),
path('delete_account/<int:pk>/', views.delete_account, name='delete_account'),
path('view_menu', views.view_menu, name='view_menu'),
path('add_menu', views.add_menu, name='add_menu'),
path('success', views.success, name='success'),
path('view_detail/<int:pk>/', views.view_detail, name='view_detail'),
path('update_dish/<int:pk>/', views.update_dish, name='update_dish'),
path('delete_dish/<int:pk>/', views.delete_dish, name='delete_dish')
]
# path('pathname/<int:pk>/', view.nameoffunction, name='pathname')
\ No newline at end of file
This diff is collapsed.
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