Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_gitgud
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
Neal Luigi D. Rodriguez
midterm_gitgud
Commits
f651f2ff
Commit
f651f2ff
authored
May 14, 2023
by
Gareth Xerxes Yap Castillo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finalize views and htmls
parent
69dd52d5
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
6 deletions
+15
-6
models.cpython-39.pyc
widget_gitgud/Dashboard/__pycache__/models.cpython-39.pyc
+0
-0
views.cpython-39.pyc
widget_gitgud/Dashboard/__pycache__/views.cpython-39.pyc
+0
-0
models.py
widget_gitgud/Dashboard/models.py
+2
-1
dashboard.html
widget_gitgud/Dashboard/templates/Dashboard/dashboard.html
+2
-2
widgetuser-details.html
...gud/Dashboard/templates/Dashboard/widgetuser-details.html
+2
-2
views.py
widget_gitgud/Dashboard/views.py
+9
-1
db.sqlite3
widget_gitgud/db.sqlite3
+0
-0
No files found.
widget_gitgud/Dashboard/__pycache__/models.cpython-39.pyc
View file @
f651f2ff
No preview for this file type
widget_gitgud/Dashboard/__pycache__/views.cpython-39.pyc
View file @
f651f2ff
No preview for this file type
widget_gitgud/Dashboard/models.py
View file @
f651f2ff
from
django.db
import
models
from
django.db
import
models
from
django.urls
import
reverse
class
Department
(
models
.
Model
):
class
Department
(
models
.
Model
):
default_string
=
""
default_string
=
""
...
@@ -20,4 +21,4 @@ class WidgetUser(models.Model):
...
@@ -20,4 +21,4 @@ class WidgetUser(models.Model):
def
get_absolute_url
(
self
):
def
get_absolute_url
(
self
):
return
reverse
(
'Dashboard:user_details'
,
kwargs
=
{
'pk'
:
self
.
pk
})
return
reverse
(
'Dashboard:user_details'
,
kwargs
=
{
'user_id'
:
self
.
id
})
\ No newline at end of file
\ No newline at end of file
widget_gitgud/Dashboard/templates/Dashboard/dashboard.html
View file @
f651f2ff
...
@@ -6,8 +6,8 @@
...
@@ -6,8 +6,8 @@
{% block content %}
{% block content %}
<h>
Welcome to Widget!
</h>
<h>
Welcome to Widget!
</h>
<ul>
<ul>
{% for
object in object_list
%}
{% for
user in users
%}
<li><a
href =
"
{{ object.id }}/details/"
>
{{ object.last_name }} {{ object
.first_name }}
</a></li>
<li><a
href =
"
../widgetusers/{{ user.id }}/details/"
>
{{ user.last_name }} {{ user
.first_name }}
</a></li>
{% empty %}
{% empty %}
<li>
No users registered.
</li>
<li>
No users registered.
</li>
{% endfor %}
{% endfor %}
...
...
widget_gitgud/Dashboard/templates/Dashboard/widgetuser-details.html
View file @
f651f2ff
...
@@ -6,9 +6,9 @@
...
@@ -6,9 +6,9 @@
{% block content %}
{% block content %}
<h
style =
"text-transform: uppercase"
>
{{user.first_name}} {{user.middle_name}} {{user.last_name}}
</h>
<h
style =
"text-transform: uppercase"
>
{{user.first_name}} {{user.middle_name}} {{user.last_name}}
</h>
<p>
<p>
<br
/>
{{user.department.dept_name}}
{{user.department.dept_name}}
<br
/>
{{user.department.home_unit}}
<br
/>
{{user.department.home_unit}}
<b
utton
onclick=
"window.location.href='../../../widgetusers/{{autho
r.id}}/edit/';"
>
Edit Author
</button>
<br
/>
<b
r>
<button
onclick=
"window.location.href='../../../widgetusers/{{use
r.id}}/edit/';"
>
Edit Author
</button>
<br
/>
</p>
</p>
{% endblock %}
{% endblock %}
\ No newline at end of file
widget_gitgud/Dashboard/views.py
View file @
f651f2ff
...
@@ -3,9 +3,14 @@ from django.http import HttpResponse, Http404
...
@@ -3,9 +3,14 @@ from django.http import HttpResponse, Http404
from
django.shortcuts
import
render
from
django.shortcuts
import
render
from
django.views
import
View
from
django.views
import
View
from
.models
import
Department
,
WidgetUser
from
.models
import
Department
,
WidgetUser
from
django.views.generic.list
import
ListView
def
dashboard_view
(
request
):
def
dashboard_view
(
request
):
return
render
(
request
,
'Dashboard/dashboard.html'
)
users
=
WidgetUser
.
objects
.
all
()
context
=
{
'users'
:
users
}
return
render
(
request
,
'Dashboard/dashboard.html'
,
context
)
class
userdetails_view
(
View
):
class
userdetails_view
(
View
):
def
get
(
self
,
request
,
user_id
):
def
get
(
self
,
request
,
user_id
):
...
@@ -23,6 +28,9 @@ class userdetails_view(View):
...
@@ -23,6 +28,9 @@ class userdetails_view(View):
"user_id"
:
user_id
"user_id"
:
user_id
}
}
return
render
(
request
,
'Dashboard/widgetuser-details.html'
,
context
)
return
render
(
request
,
'Dashboard/widgetuser-details.html'
,
context
)
class
IndexView
(
ListView
):
queryset
=
WidgetUser
.
objects
.
order_by
(
"last_name"
)
class
adduser_view
(
CreateView
):
class
adduser_view
(
CreateView
):
model
=
WidgetUser
model
=
WidgetUser
...
...
widget_gitgud/db.sqlite3
View file @
f651f2ff
No preview for this file type
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