Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
Francia - Midterm Project
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
Alex Bernard Francia
Francia - Midterm Project
Commits
8dff3fa2
Commit
8dff3fa2
authored
Mar 19, 2020
by
Alex Bernard Francia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set-up views and urls. Home page template added.
parent
d0a7ec3b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
178 additions
and
3 deletions
+178
-3
home_page.html
froyo/templates/home_page.html
+91
-0
urls.py
froyo/urls.py
+38
-0
views.py
froyo/views.py
+47
-2
urls.py
thegoodplace/urls.py
+2
-1
No files found.
froyo/templates/home_page.html
0 → 100644
View file @
8dff3fa2
<!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
froyo/urls.py
0 → 100644
View file @
8dff3fa2
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
froyo/views.py
View file @
8dff3fa2
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.
thegoodplace/urls.py
View file @
8dff3fa2
...
...
@@ -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'
)),
]
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