Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_k3git
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
Stefan Gomez
midterm_k3git
Commits
ffb2be43
Commit
ffb2be43
authored
May 08, 2023
by
Stefan Gomez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented the 'Edit Widget User Page'.
parent
b6d3d47d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
4 deletions
+25
-4
models.cpython-311.pyc
widget_k3git/dashboard/__pycache__/models.cpython-311.pyc
+0
-0
urls.cpython-311.pyc
widget_k3git/dashboard/__pycache__/urls.cpython-311.pyc
+0
-0
views.cpython-311.pyc
widget_k3git/dashboard/__pycache__/views.cpython-311.pyc
+0
-0
widgetuser-details.html
...git/dashboard/templates/dashboard/widgetuser-details.html
+1
-1
widgetuser-edit.html
..._k3git/dashboard/templates/dashboard/widgetuser-edit.html
+14
-0
urls.py
widget_k3git/dashboard/urls.py
+2
-1
views.py
widget_k3git/dashboard/views.py
+8
-2
No files found.
widget_k3git/dashboard/__pycache__/models.cpython-311.pyc
View file @
ffb2be43
No preview for this file type
widget_k3git/dashboard/__pycache__/urls.cpython-311.pyc
View file @
ffb2be43
No preview for this file type
widget_k3git/dashboard/__pycache__/views.cpython-311.pyc
View file @
ffb2be43
No preview for this file type
widget_k3git/dashboard/templates/dashboard/widgetuser-details.html
View file @
ffb2be43
...
...
@@ -7,5 +7,5 @@
<h3>
{{ widgetuser.department.home_unit}}
</h3>
{% endblock %}
{% block scripts %}
<
input
type=
"submit"
value=
"Edit Widget User"
>
<
a
href=
"/dashboard/{{ widgetuser.pk }}/edit"
><input
type=
"submit"
value=
"Edit Widget User"
></a
>
{% endblock %}
\ No newline at end of file
widget_k3git/dashboard/templates/dashboard/widgetuser-edit.html
0 → 100644
View file @
ffb2be43
{% extends 'base.html' %}
{% block title %}Edit Widget User{% endblock %}
{% block content %}
<h1>
Edit Widget user:
</h1>
<form
action=
""
method=
"post"
>
{% csrf_token %}
{{ form.as_p }}
<input
type=
"submit"
value=
"Save Changes to Widget User"
>
</form>
{% endblock %}
{% block scripts %}
{% endblock %}
\ No newline at end of file
widget_k3git/dashboard/urls.py
View file @
ffb2be43
from
django.contrib
import
admin
from
django.urls
import
path
from
.views
import
index
,
WidgetUserDetailView
,
WidgetUserCreateView
from
.views
import
index
,
WidgetUserDetailView
,
WidgetUserCreateView
,
WidgetUserUpdateView
urlpatterns
=
[
path
(
''
,
index
,
name
=
'index'
),
path
(
'<int:pk>/details'
,
WidgetUserDetailView
.
as_view
(),
name
=
'widgetuser-details'
),
path
(
'add/'
,
WidgetUserCreateView
.
as_view
(),
name
=
'add-widgetuser'
),
path
(
'<int:pk>/edit'
,
WidgetUserUpdateView
.
as_view
(),
name
=
'edit-widgetuser'
),
]
app_name
=
"dashboard"
\ No newline at end of file
widget_k3git/dashboard/views.py
View file @
ffb2be43
from
django.shortcuts
import
render
from
django.views.generic.detail
import
DetailView
from
django.views.generic.edit
import
CreateView
from
django.views.generic.edit
import
CreateView
,
UpdateView
from
.
models
import
WidgetUser
...
...
@@ -19,4 +19,10 @@ class WidgetUserDetailView(DetailView):
class
WidgetUserCreateView
(
CreateView
):
model
=
WidgetUser
fields
=
'__all__'
template_name
=
'dashboard/widgetuser-add.html'
\ No newline at end of file
template_name
=
'dashboard/widgetuser-add.html'
class
WidgetUserUpdateView
(
UpdateView
):
model
=
WidgetUser
fields
=
'__all__'
template_name
=
'dashboard/widgetuser-edit.html'
\ 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