Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_someone here is possessed by an owl
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
Laetitia de Castro
widget_someone here is possessed by an owl
Commits
7179931b
Commit
7179931b
authored
May 25, 2022
by
Anya Habana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added navigation buttons and add widget user title
parent
50c552c3
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
4 deletions
+19
-4
db.sqlite3
db.sqlite3
+0
-0
views.cpython-38.pyc
homepage/__pycache__/views.cpython-38.pyc
+0
-0
index.html
homepage/templates/users/index.html
+1
-0
newuser.html
homepage/templates/users/newuser.html
+17
-3
views.py
homepage/views.py
+1
-1
No files found.
db.sqlite3
View file @
7179931b
No preview for this file type
homepage/__pycache__/views.cpython-38.pyc
View file @
7179931b
No preview for this file type
homepage/templates/users/index.html
View file @
7179931b
...
...
@@ -19,5 +19,6 @@
{% else %}
<p>
There are no widget users currently.
</p>
{% endif %}
<button
class=
"homepage-button"
type=
"submit"
><a
href=
"/users/add/"
>
Add Widget User
</a></button>
{% endblock %}
homepage/templates/users/newuser.html
View file @
7179931b
<form
action=
"{% url 'homepage:newuser' %}"
method=
"POST"
>
{% extends 'base.html' %}
{% load static %}
{% block title %}New User{% endblock %}
{% block styles %}
<link
rel=
"stylesheet"
href=
"{% static 'homepage.css' %}"
>
{% endblock %}
{% block content %}
<h1
class=
"homepage-heading"
>
Add Widget User
</h1>
<form
class=
"homepage-form"
action=
"{% url 'homepage:newuser' %}"
method=
"POST"
>
{% csrf_token %}
{{ user_form }}
<
<
button
class=
"button"
type=
"submit"
>
Save New User
</button>
<button
class=
"button"
type=
"submit"
>
Save New User
</button>
</form>
<button
class=
"button"
type=
"submit"
><a
href=
"/homepage"
>
Back to Homepage
</a></button>
{% endblock %}
\ No newline at end of file
homepage/views.py
View file @
7179931b
...
...
@@ -18,7 +18,7 @@ def newuser(request):
user_form
=
WidgetUserForm
(
request
.
POST
)
if
user_form
.
is_valid
():
new_user
=
user_form
.
save
()
return
redirect
(
"homepage:index"
,
pk
=
new_user
.
pk
)
return
redirect
(
"homepage:index"
)
else
:
user_form
=
WidgetUserForm
()
return
render
(
request
,
'users/newuser.html'
,
{
"user_form"
:
user_form
})
...
...
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