Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
Bullet Journal
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
Franz Leonard Atanacio
Bullet Journal
Commits
58e6977f
Commit
58e6977f
authored
Apr 05, 2021
by
nikkastra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changing content
parent
83b24993
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
47 additions
and
22 deletions
+47
-22
forms.cpython-38.pyc
mysite/bulletjournal/__pycache__/forms.cpython-38.pyc
+0
-0
urls.cpython-38.pyc
mysite/bulletjournal/__pycache__/urls.cpython-38.pyc
+0
-0
views.cpython-38.pyc
mysite/bulletjournal/__pycache__/views.cpython-38.pyc
+0
-0
forms.py
mysite/bulletjournal/forms.py
+0
-1
views.py
mysite/bulletjournal/views.py
+6
-8
base.html
mysite/mysite/templates/base.html
+16
-6
home.html
mysite/mysite/templates/home.html
+24
-0
index.html
mysite/mysite/templates/index.html
+1
-7
No files found.
mysite/bulletjournal/__pycache__/forms.cpython-38.pyc
View file @
58e6977f
No preview for this file type
mysite/bulletjournal/__pycache__/urls.cpython-38.pyc
View file @
58e6977f
No preview for this file type
mysite/bulletjournal/__pycache__/views.cpython-38.pyc
View file @
58e6977f
No preview for this file type
mysite/bulletjournal/forms.py
View file @
58e6977f
from
django
import
forms
class
IndexCardForm
(
forms
.
Form
):
name
=
forms
.
CharField
(
label
=
"Hello! What is your name? "
,
max_length
=
100
)
\ No newline at end of file
mysite/bulletjournal/views.py
View file @
58e6977f
...
...
@@ -2,26 +2,24 @@ from django.shortcuts import render
from
django.http
import
HttpResponse
from
django.views
import
View
from
.forms
import
IndexCardForm
from
.forms
import
*
class
HomePageView
(
View
):
def
get
(
self
,
request
):
form
=
IndexCardForm
()
return
render
(
request
,
'index.html'
,
{
'form'
:
form
})
return
render
(
request
,
'base.html'
,
{
'form'
:
form
})
def
index_card_view
(
request
):
if
request
.
method
==
'POST'
:
form
=
IndexCardForm
(
request
.
POST
)
if
form
.
is_valid
():
return
HttpResponse
(
'Hello, {}! Today is gonna be a great day!'
.
format
(
form
.
cleaned_data
[
'name'
]
)
return
render
(
request
,
'base.html'
,
{
'name'
:
form
.
cleaned_data
[
'name'
]
}
)
else
:
form
=
IndexCardForm
()
return
render
(
request
,
'
index
.html'
,
{
'form'
:
form
})
return
render
(
request
,
'
base
.html'
,
{
'form'
:
form
})
def
profile
(
request
):
...
...
mysite/mysite/templates/base.html
View file @
58e6977f
...
...
@@ -8,12 +8,22 @@
</head>
<body>
<h1>
YOUR BULLET JOURNAL
</h1>
<form
action=
"/home"
method=
"post"
>
{% csrf_token %}
{{form}}
<input
type=
"Submit"
value=
"Submit"
>
</form>
{% block content %}{% endblock %}
{% if name %}
<p>
Hello, {{name}}! Today is gonna be a great day!
</p>
{% else %}
<form
action=
"/home"
method=
"post"
id=
"nickname"
>
{% csrf_token %}
{{form}}
<input
type=
"Submit"
value=
"Submit"
>
</form>
{% endif %}
<ul>
<li>
<a
href=
"{% url 'home'%}"
>
Home
</a>
</li>
<li>
<a
href=
"{% url 'profile'%}"
>
Profile
</a>
</li>
<li>
<a
href=
"{% url 'key'%}"
>
Key
</a>
</li>
<li>
<a
href=
"{% url 'thisweek'%}"
>
This Week
</a>
</li>
<li>
<a
href=
"{% url 'today'%}"
>
Today
</a>
</li>
</ul>
{% block scripts %}{% endblock %}
</body>
</html>
\ No newline at end of file
mysite/mysite/templates/home.html
0 → 100644
View file @
58e6977f
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
'viewport'
content=
'width=device-width'
>
<title>
{% block title %}Your Bujo{% endblock %}
</title>
{% block styles %}{% endblock %}
</head>
<body>
<h1>
YOUR BULLET JOURNAL
</h1>
{% if is_it_valid == 'True' %}
<p>
'Hello, {}! Today is gonna be a great day!'.format(
form.cleaned_data['name'])
</p>
{% else %}
<form
action=
"/home"
method=
"post"
>
{% csrf_token %}
{{form}}
<input
type=
"Submit"
value=
"Submit"
>
</form>
{% endif %}
{% block content %}{% endblock %}
{% block scripts %}{% endblock %}
</body>
</html>
\ No newline at end of file
mysite/mysite/templates/index.html
View file @
58e6977f
...
...
@@ -7,11 +7,5 @@
{% endblock %}
{% block content %}
<ul>
<li>
<a
href=
"{% url 'home'%}"
>
Home
</a>
</li>
<li>
<a
href=
"{% url 'profile'%}"
>
Profile
</a>
</li>
<li>
<a
href=
"{% url 'key'%}"
>
Key
</a>
</li>
<li>
<a
href=
"{% url 'thisweek'%}"
>
This Week
</a>
</li>
<li>
<a
href=
"{% url 'today'%}"
>
Today
</a>
</li>
</ul>
{% endblock %}
\ No newline at end of file
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