Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_robo_mommy
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Raul Jarod Conanan
midterm_robo_mommy
Commits
0df29e8b
Commit
0df29e8b
authored
May 14, 2023
by
Lance Dominic B. Santuyo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated FBV implementation to use template
parent
dbf1408f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
23 deletions
+8
-23
views.py
widget_robo_mommy/Dashboard/views.py
+8
-23
No files found.
widget_robo_mommy/Dashboard/views.py
View file @
0df29e8b
from
django.shortcuts
import
render
from
.models
import
WidgetUser
from
django.http
import
HttpResponse
from
django.views
import
generic
...
...
@@ -5,29 +6,13 @@ from django.urls import reverse
def
Dashboard_list_view
(
request
):
html_string_1
=
'<html lang="en"><head><meta charset="UTF-8">'
\
'<h1>Welcome to Widget</h1>'
\
'<h2>WIDGET USERS</h2></head><ul>'
html_string_2
=
''
for
wu
in
WidgetUser
.
objects
.
all
():
number
=
str
(
wu
.
pk
)
href
=
'<a href="/Widgetusers/'
+
number
+
'/details">'
html_string_2
+=
'<li>'
+
href
+
'{}, {} {}: {}, {}'
.
format
(
wu
.
last_name
,
wu
.
first_name
,
wu
.
middle_name
,
wu
.
department
.
dept_name
,
wu
.
department
.
home_unit
)
html_string_2
+=
'</ul></li>'
html_string_3
=
'<a href="/Widgetusers/add"><button value="click here" > Add Widget User</button></a><br><br>'
html_string_3
+=
'<a href="/announcements/">Announcement Board</a><br>'
html_string_3
+=
'<a href="/forum/">Forum</a><br>'
html_string_3
+=
'<a href="/assignments">Assignment</a><br>'
html_string_3
+=
'<a href="/widget_Calendar/">Calendar</a><br>'
html_string_final
=
html_string_1
+
html_string_2
+
html_string_3
+
'</html>'
return
HttpResponse
(
html_string_final
)
users
=
WidgetUser
.
objects
.
all
()
context
=
{
'users'
:
users
}
return
render
(
request
,
'dashboard/dashboard.html'
,
context
)
class
WidgetUserDetailView
(
generic
.
DetailView
):
...
...
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