Commit 8dff3fa2 authored by Alex Bernard Francia's avatar Alex Bernard Francia

Set-up views and urls. Home page template added.

parent d0a7ec3b
<!DOCTYPE html>
<html>
<head>
<title>The Good Place</title>
<style>
h1#title{
font-family: Arial;
text-align: center;
font-size: 60px;
margin-bottom: -20px;
}
h1#title2{
font-family: Arial;
text-align: center;
font-size:30px;
}
table{
width:65%;
margin-left:auto;
margin-right:auto;
}
table, th, td{
border: 2px solid black;
border-collapse: collapse;
font-family: Arial;
font-size: 24px;
}
th, td{
padding: 5px;
}
tr.r1{
text-align:center;
border: 3px solid black;
}
tr.r2{
border: 3px solid black;
}
td.link{
font-size:18px;
text-align:center;
}
</style>
</head>
<body>
<h1 id='title'>The Good Place<h1>
<h1 id='title2'>FroYo Shop</h1>
<table>
<tr class = "r1">
<th>Ingredients</th>
<th>Recipes</th>
<th>Orders</th>
</tr>
<tr class = "r2">
<td class="link"><a href = ingredients/list>List</a></td>
<td class="link"><a href = recipes/list>List</a></td>
<td class="link"><a href = orders/list>List</a></td>
</tr>
<tr class = "r2">
<td class="link"><a href = ingredients/detail>Detail</a></td>
<td class="link"><a href = recipes/detail>Detail</a></td>
<td class="link"><a href = orders/detail>Detail</a></td>
</tr>
<tr class = "r2">
<td class="link"><a href = ingredients/update>Update</a></td>
<td class="link"><a href = recipes/update>Update</a></td>
<td class="link"><a href = orders/update>Update</a></td>
</tr>
<tr class = "r2">
<td class="link"><a href = ingredients/create>Create</a></td>
<td class="link"><a href = recipes/create>Create</a></td>
<td class="link"><a href = orders/create>Create</a></td>
</tr>
</table>
</body>
</html>
\ No newline at end of file
from django.conf.urls import url
from .views import go_to_home_page
from .views import go_to_ingredients_detail
from .views import go_to_ingredients_list
from .views import go_to_ingredients_update_form
from .views import go_to_ingredients_create_form
from .views import go_to_orders_create_form
from .views import go_to_orders_detail
from .views import go_to_orders_list
from .views import go_to_orders_update_form
from .views import go_to_recipes_create_form
from .views import go_to_recipes_detail
from .views import go_to_recipes_list
from .views import go_to_recipes_update_form
urlpatterns = [
url(r'^$', go_to_home_page,name='homepage'),
url(r'^ingredients/detail$', go_to_ingredients_detail,name='ingredients_detail'),
url(r'^ingredients/list$', go_to_ingredients_list,name='ingredients_list'),
url(r'^ingredients/update$', go_to_ingredients_update_form,name='ingredients_update_form'),
url(r'^ingredients/create$', go_to_ingredients_create_form,name='ingredients_create_form'),
url(r'^orders/detail$', go_to_orders_detail,name='orders_detail'),
url(r'^orders/list$', go_to_orders_list,name='orders_list'),
url(r'^orders/update$', go_to_orders_update_form,name='orders_update_form'),
url(r'^orders/create$', go_to_orders_create_form,name='orders_create_form'),
url(r'^recipes/detail$', go_to_recipes_detail,name='recipes_detail'),
url(r'^recipes/list$', go_to_recipes_list,name='recipes_list'),
url(r'^recipes/update$', go_to_recipes_update_form,name='recipes_update_form'),
url(r'^recipes/create$', go_to_recipes_create_form,name='recipes_create_form'),
]
\ No newline at end of file
from django.shortcuts import render
# Create your views here.
# from django.http import HttpResponse
def go_to_home_page(request):
return render(request, 'home_page.html')
def go_to_ingredients_create_form(request):
return render(request,'ingredients_create_form.html')
def go_to_ingredients_detail(request):
return render(request,"ingredients_detail.html")
def go_to_ingredients_list(request):
return render(request,"ingredients_list.html")
def go_to_ingredients_update_form(request):
return render(request,"ingredients_update_form.html")
def go_to_orders_create_form(request):
return render(request,'orders_create_form.html')
def go_to_orders_detail(request):
return render(request,"orders_detail.html")
def go_to_orders_list(request):
return render(request,"orders_list.html")
def go_to_orders_update_form(request):
return render(request,"orders_update_form.html")
home_page = None
\ No newline at end of file
def go_to_recipes_create_form(request):
return render(request,'recipes_create_form.html')
def go_to_recipes_detail(request):
return render(request,"recipes_detail.html")
def go_to_recipes_list(request):
return render(request,"recipes_list.html")
def go_to_recipes_update_form(request):
return render(request,"recipes_update_form.html")
# Create your views here.
......@@ -13,9 +13,10 @@ Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'', include('froyo.urls')),
]
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