Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_mgabolanimav
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
Mavrick Jordan Lee
midterm_mgabolanimav
Commits
b06aba32
Commit
b06aba32
authored
May 06, 2023
by
Mavrick Jordan Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Add Widget User Page. Updated views, urls, and dashboard.html.
parent
c5662e9f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
5 deletions
+26
-5
dashboard.html
...mgabolanimav/dashboard/templates/dashboard/dashboard.html
+6
-2
widgetuser-add.html
...lanimav/dashboard/templates/dashboard/widgetuser-add.html
+10
-0
urls.py
widget_mgabolanimav/dashboard/urls.py
+3
-2
views.py
widget_mgabolanimav/dashboard/views.py
+7
-1
No files found.
widget_mgabolanimav/dashboard/templates/dashboard/dashboard.html
View file @
b06aba32
...
...
@@ -4,11 +4,15 @@
<h1>
Welcome to Widget!
</h1>
<h2>
Widget Users:
</h2>
{% for user in widget_users %}
<a
href=
"{% url 'dashboard:widgetuser-detail
s
' user.id %}"
>
<a
href=
"{% url 'dashboard:widgetuser-detail' user.id %}"
>
{{user.last_name}}, {{user.first_name}}
</a><br>
{% endfor %}
<br><button>
Add Widget User
</button><br><br>
<br>
<a
href=
"{% url 'dashboard:widgetuser-add' %}"
>
<button>
Add Widget User
</button>
</a>
<br><br>
Announcement Board
<br>
Forum
<br>
{% endblock %}
\ No newline at end of file
widget_mgabolanimav/dashboard/templates/dashboard/widgetuser-add.html
0 → 100644
View file @
b06aba32
{% extends 'base.html' %}
{% block title %}Add Widget User{% endblock %}
{% block content %}
<h2>
Add a new Widget user:
</h2>
<form
method=
"POST"
>
{% csrf_token %}
{{ form.as_p }}
<input
type=
"Submit"
value=
"Add Widget User"
>
</form>
{% endblock %}
\ No newline at end of file
widget_mgabolanimav/dashboard/urls.py
View file @
b06aba32
...
...
@@ -2,12 +2,13 @@ from django.urls import path
from
.
import
views
from
.views
import
(
WidgetUserDetailsView
WidgetUserDetailsView
,
WidgetUserCreateView
)
urlpatterns
=
[
path
(
'dashboard/'
,
views
.
dashboard
,
name
=
"dashboard"
),
path
(
'widgetusers/<int:pk>/details/'
,
WidgetUserDetailsView
.
as_view
(),
name
=
"widgetuser-details"
),
path
(
'widgetusers/<int:pk>/details/'
,
WidgetUserDetailsView
.
as_view
(),
name
=
"widgetuser-detail"
),
path
(
'widgetusers/add/'
,
WidgetUserCreateView
.
as_view
(),
name
=
"widgetuser-add"
),
]
app_name
=
'dashboard'
\ No newline at end of file
widget_mgabolanimav/dashboard/views.py
View file @
b06aba32
from
.models
import
Department
,
WidgetUser
from
.models
import
WidgetUser
from
django.shortcuts
import
render
from
django.views.generic.detail
import
DetailView
from
django.views.generic.edit
import
CreateView
,
UpdateView
# Create your views here.
def
dashboard
(
request
):
...
...
@@ -12,3 +13,8 @@ def dashboard(request):
class
WidgetUserDetailsView
(
DetailView
):
model
=
WidgetUser
template_name
=
'dashboard/widgetuser-details.html'
class
WidgetUserCreateView
(
CreateView
):
model
=
WidgetUser
fields
=
'__all__'
template_name
=
'dashboard/widgetuser-add.html'
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