Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
esguerra_lab1
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
James Esguerra
esguerra_lab1
Commits
9fcf6e04
Commit
9fcf6e04
authored
Apr 07, 2021
by
James Esguerra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added edit button for bio
parent
51e5837d
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
64 additions
and
17 deletions
+64
-17
forms.cpython-38.pyc
pages/__pycache__/forms.cpython-38.pyc
+0
-0
urls.cpython-38.pyc
pages/__pycache__/urls.cpython-38.pyc
+0
-0
views.cpython-38.pyc
pages/__pycache__/views.cpython-38.pyc
+0
-0
forms.py
pages/forms.py
+6
-0
urls.py
pages/urls.py
+1
-0
views.py
pages/views.py
+14
-0
styles.css
static/css/styles.css
+1
-1
default_kpTnUUI.jpg
static/images/default_kpTnUUI.jpg
+0
-0
luka.JPG
static/images/luka.JPG
+0
-0
delete_itemT.html
templates/delete_itemT.html
+1
-1
delete_itemTW.html
templates/delete_itemTW.html
+1
-1
edit_bio.html
templates/edit_bio.html
+18
-0
edit_itemT.html
templates/edit_itemT.html
+7
-5
edit_nickname.html
templates/edit_nickname.html
+7
-5
key.html
templates/key.html
+1
-1
profile.html
templates/profile.html
+5
-1
this_week.html
templates/this_week.html
+1
-1
today.html
templates/today.html
+1
-1
No files found.
pages/__pycache__/forms.cpython-38.pyc
View file @
9fcf6e04
No preview for this file type
pages/__pycache__/urls.cpython-38.pyc
View file @
9fcf6e04
No preview for this file type
pages/__pycache__/views.cpython-38.pyc
View file @
9fcf6e04
No preview for this file type
pages/forms.py
View file @
9fcf6e04
...
...
@@ -18,6 +18,12 @@ class NicknameForm(forms.ModelForm):
fields
=
[
'nickname'
]
class
BioForm
(
forms
.
ModelForm
):
class
Meta
:
model
=
User
fields
=
[
'bio'
]
class
KeyForm
(
forms
.
ModelForm
):
class
Meta
:
model
=
Key
...
...
pages/urls.py
View file @
9fcf6e04
...
...
@@ -16,4 +16,5 @@ urlpatterns = [
path
(
'edit_itemT/<int:pk>'
,
views
.
ShowEditItemT
,
name
=
'edit_itemT'
),
path
(
'delete_itemT/<int:pk>'
,
views
.
ShowDeleteItemT
,
name
=
'delete_itemT'
),
path
(
'edit_nickname'
,
views
.
ShowEditNickname
,
name
=
'edit_nickname'
),
path
(
'edit_bio'
,
views
.
ShowEditBio
,
name
=
'edit_bio'
),
]
pages/views.py
View file @
9fcf6e04
...
...
@@ -5,6 +5,7 @@ from .forms import (
HomeForm
,
UserForm
,
NicknameForm
,
BioForm
,
KeyForm
,
ItemsThisWeekForm
,
ItemsTodayForm
,
...
...
@@ -63,6 +64,19 @@ def ShowEditNickname(request):
return
render
(
request
,
'edit_nickname.html'
,
{
'form'
:
form
})
def
ShowEditBio
(
request
):
user
=
User
.
objects
.
get
(
pk
=
1
)
form
=
BioForm
(
instance
=
user
)
if
request
.
method
==
'POST'
:
form
=
BioForm
(
request
.
POST
,
instance
=
user
)
if
form
.
is_valid
():
form
.
save
()
return
redirect
(
'profile'
)
return
render
(
request
,
'edit_bio.html'
,
{
'form'
:
form
})
def
ShowKey
(
request
):
key_list
=
Key
.
objects
.
all
()
return
render
(
request
,
'key.html'
,
{
'key_list'
:
key_list
})
...
...
static/css/styles.css
View file @
9fcf6e04
...
...
@@ -42,7 +42,7 @@ a {
font-size
:
1.5em
;
}
#
key
,
#this_week
,
#today
,
#delete
{
#
center
{
margin
:
0
auto
;
width
:
50%
;
font-size
:
1.5em
;
...
...
static/images/default_kpTnUUI.jpg
deleted
100644 → 0
View file @
51e5837d
8.35 KB
static/images/luka.JPG
deleted
100644 → 0
View file @
51e5837d
69.5 KB
templates/delete_itemT.html
View file @
9fcf6e04
...
...
@@ -7,7 +7,7 @@
{% block content %}
<div
id=
'
today
'
>
<div
id=
'
center
'
>
<h3>
Are you sure you want to delete this item?
</h3>
<form
action=
''
method=
'POST'
>
{% csrf_token %}
...
...
templates/delete_itemTW.html
View file @
9fcf6e04
...
...
@@ -7,7 +7,7 @@
{% block content %}
<div
id=
'
this_week
'
>
<div
id=
'
center
'
>
<h3>
Are you sure you want to delete this item?
</h3>
<form
action=
''
method=
'POST'
>
{% csrf_token %}
...
...
templates/edit_bio.html
0 → 100644
View file @
9fcf6e04
{% extends 'base.html' %}
{% load static %}
{% block title %} Key {% endblock %}
{% block header %} Key {% endblock %}
{% block content %}
<div
id=
'center'
>
<form
action=
''
method=
'POST'
>
{% csrf_token %}
{{ form }}
<input
type=
'submit'
name=
'Submit'
value=
'Save'
>
</form>
</div>
{% endblock %}
templates/edit_itemT.html
View file @
9fcf6e04
...
...
@@ -7,10 +7,12 @@
{% block content %}
<form
action=
''
method=
'POST'
>
{% csrf_token %}
{{ form }}
<input
type=
'submit'
name=
'Submit'
value=
'Save'
>
</form>
<div
id=
'center'
>
<form
action=
''
method=
'POST'
>
{% csrf_token %}
{{ form }}
<input
type=
'submit'
name=
'Submit'
value=
'Save'
>
</form>
</div>
{% endblock %}
templates/edit_nickname.html
View file @
9fcf6e04
...
...
@@ -7,10 +7,12 @@
{% block content %}
<form
action=
''
method=
'POST'
>
{% csrf_token %}
{{ form }}
<input
type=
'submit'
name=
'Submit'
value=
'Save'
>
</form>
<div
id=
'center'
>
<form
action=
''
method=
'POST'
>
{% csrf_token %}
{{ form }}
<input
type=
'submit'
name=
'Submit'
value=
'Save'
>
</form>
</div>
{% endblock %}
templates/key.html
View file @
9fcf6e04
...
...
@@ -7,7 +7,7 @@
{% block content %}
<div
id=
'
key
'
>
<div
id=
'
center
'
>
<h3>
Your Keys
</h3>
<br>
{% for key in key_list %}
...
...
templates/profile.html
View file @
9fcf6e04
...
...
@@ -15,7 +15,11 @@
<a
href=
'{% url '
edit_nickname
'
%}'
><button
type=
'button'
>
Edit
</button></a>
</p>
<br>
<p><b>
Bio:
</b>
{{ user.bio }}
</p>
<p>
<b>
Bio:
</b>
{{ user.bio }}
<a
href=
'{% url '
edit_bio
'
%}'
><button
type=
'button'
>
Edit
</button></a>
</p>
</div>
<div
id=
'image-container'
>
...
...
templates/this_week.html
View file @
9fcf6e04
...
...
@@ -7,7 +7,7 @@
{% block content %}
<div
id=
'
this_week
'
>
<div
id=
'
center
'
>
<h2>
04.12.MON - 04.18.SUN
</h2>
<br>
{% for item in item_list %}
...
...
templates/today.html
View file @
9fcf6e04
...
...
@@ -7,7 +7,7 @@
{% block content %}
<div
id=
'
today
'
>
<div
id=
'
center
'
>
<h2>
04.14.WED
</h2>
<br>
{% for item in item_list %}
...
...
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