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
8b56b8e8
Commit
8b56b8e8
authored
May 06, 2023
by
Mavrick Jordan Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added view and template for dashboard. Updated urls for project and app level.
parent
f7b9c051
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
9 deletions
+18
-9
dashboard.html
...mgabolanimav/dashboard/templates/dashboard/dashboard.html
+12
-0
urls.py
widget_mgabolanimav/dashboard/urls.py
+1
-1
views.py
widget_mgabolanimav/dashboard/views.py
+4
-7
urls.py
widget_mgabolanimav/widget_mgabolanimav/urls.py
+1
-1
No files found.
widget_mgabolanimav/dashboard/templates/dashboard/dashboard.html
0 → 100644
View file @
8b56b8e8
{% extends 'base.html' %}
{% block title %}Widget v2{% endblock %}
{% block content %}
<h1>
Welcome to Widget!
</h1>
<h2>
Widget Users:
</h2>
{% for user in widget_users %}
{{user.last_name}}, {{user.first_name}}
<br>
{% endfor %}
<br><button>
Add Widget User
</button><br><br>
Announcement Board
<br>
Forum
<br>
{% endblock %}
\ No newline at end of file
widget_mgabolanimav/dashboard/urls.py
View file @
8b56b8e8
...
@@ -3,5 +3,5 @@ from django.urls import path
...
@@ -3,5 +3,5 @@ from django.urls import path
from
.
import
views
from
.
import
views
urlpatterns
=
[
urlpatterns
=
[
path
(
''
,
views
.
dashboard
,
name
=
"dashboard"
),
path
(
'
dashboard/
'
,
views
.
dashboard
,
name
=
"dashboard"
),
]
]
\ No newline at end of file
widget_mgabolanimav/dashboard/views.py
View file @
8b56b8e8
from
django.http
import
HttpResponse
from
.models
import
Department
,
WidgetUser
from
.models
import
Department
,
WidgetUser
from
django.shortcuts
import
render
# Create your views here.
# Create your views here.
def
dashboard
(
request
):
def
dashboard
(
request
):
widget_users
=
WidgetUser
.
objects
.
all
()
widget_users
=
WidgetUser
.
objects
.
all
()
response
=
"Welcome to Widget!<br><br>"
+
"WIDGET USERS:<br>"
context
=
{
"widget_users"
:
widget_users
}
for
user
in
widget_users
:
return
render
(
request
,
'dashboard/dashboard.html'
,
context
)
name
=
user
.
last_name
+
", "
+
user
.
first_name
+
" "
+
user
.
middle_name
+
": "
\ No newline at end of file
response
+=
name
+
user
.
user_department
.
dept_name
+
", "
+
user
.
user_department
.
home_unit
+
"<br>"
return
HttpResponse
(
response
)
\ No newline at end of file
widget_mgabolanimav/widget_mgabolanimav/urls.py
View file @
8b56b8e8
...
@@ -17,7 +17,7 @@ from django.contrib import admin
...
@@ -17,7 +17,7 @@ from django.contrib import admin
from
django.urls
import
path
,
include
from
django.urls
import
path
,
include
urlpatterns
=
[
urlpatterns
=
[
path
(
'
dashboard/
'
,
include
(
"dashboard.urls"
)),
path
(
''
,
include
(
"dashboard.urls"
)),
path
(
'admin/'
,
admin
.
site
.
urls
),
path
(
'admin/'
,
admin
.
site
.
urls
),
path
(
'announcements/'
,
include
(
"announcements.urls"
)),
path
(
'announcements/'
,
include
(
"announcements.urls"
)),
path
(
'forum/'
,
include
(
"forum.urls"
))
path
(
'forum/'
,
include
(
"forum.urls"
))
...
...
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