Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_huli
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
Izaac Daniel B. Muncal
midterm_huli
Commits
48d84356
Commit
48d84356
authored
May 13, 2023
by
Brescia Amandy
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dashboardv2' into 'master'
parents
9ec65c4d
5167149d
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
111 additions
and
21 deletions
+111
-21
README.txt
README.txt
+3
-6
__init__.cpython-311.pyc
widget_huli/dashboard/__pycache__/__init__.cpython-311.pyc
+0
-0
admin.cpython-311.pyc
widget_huli/dashboard/__pycache__/admin.cpython-311.pyc
+0
-0
apps.cpython-311.pyc
widget_huli/dashboard/__pycache__/apps.cpython-311.pyc
+0
-0
models.cpython-311.pyc
widget_huli/dashboard/__pycache__/models.cpython-311.pyc
+0
-0
urls.cpython-311.pyc
widget_huli/dashboard/__pycache__/urls.cpython-311.pyc
+0
-0
views.cpython-311.pyc
widget_huli/dashboard/__pycache__/views.cpython-311.pyc
+0
-0
0001_initial.cpython-311.pyc
...board/migrations/__pycache__/0001_initial.cpython-311.pyc
+0
-0
__init__.cpython-311.pyc
...dashboard/migrations/__pycache__/__init__.cpython-311.pyc
+0
-0
models.py
widget_huli/dashboard/models.py
+9
-1
dashboard.html
widget_huli/dashboard/templates/dashboard/dashboard.html
+20
-0
widgetuser-add.html
...et_huli/dashboard/templates/dashboard/widgetuser-add.html
+24
-0
widgetuser-details.html
...uli/dashboard/templates/dashboard/widgetuser-details.html
+12
-0
widgetuser-edit.html
...t_huli/dashboard/templates/dashboard/widgetuser-edit.html
+14
-0
urls.py
widget_huli/dashboard/urls.py
+6
-4
views.py
widget_huli/dashboard/views.py
+23
-10
No files found.
README.txt
View file @
48d84356
...
...
@@ -4,24 +4,21 @@ group members’ full name, ID number;
Amandy, Brescia V. -
Muncal, Izaac Daniel B. - 214138
Silang, Anchilla Vera Marie C. - 204714
Villareal, Athena Ricci V. -
full name format → last name, first name, M.I.
in alphabetical order by last name
Midterm Project: Widget
Final Project: Widgetv2
members’ app assignments;
dani - dashboard
richie - announcement board
anchie - forum
brescia - assignments
date of submission; Ma
rch 6
date of submission; Ma
y 12, 2023
We did our project on our own, asking help from only members of Huli - Dani,
Richie,
Anchie, and Brescia
We did our project on our own, asking help from only members of Huli - Dani, Anchie, and Brescia
Amandy, Brescia V. March 6 (sgd)
Muncal, Izaac Daniel B. March 6 (sgd)
Silang, Anchilla Vera Marie C. March 6 (sgd)
Villareal, Athena Ricci V. March 6 (sgd)
widget_huli/dashboard/__pycache__/__init__.cpython-311.pyc
0 → 100644
View file @
48d84356
File added
widget_huli/dashboard/__pycache__/admin.cpython-311.pyc
0 → 100644
View file @
48d84356
File added
widget_huli/dashboard/__pycache__/apps.cpython-311.pyc
0 → 100644
View file @
48d84356
File added
widget_huli/dashboard/__pycache__/models.cpython-311.pyc
0 → 100644
View file @
48d84356
File added
widget_huli/dashboard/__pycache__/urls.cpython-311.pyc
0 → 100644
View file @
48d84356
File added
widget_huli/dashboard/__pycache__/views.cpython-311.pyc
0 → 100644
View file @
48d84356
File added
widget_huli/dashboard/migrations/__pycache__/0001_initial.cpython-311.pyc
0 → 100644
View file @
48d84356
File added
widget_huli/dashboard/migrations/__pycache__/__init__.cpython-311.pyc
0 → 100644
View file @
48d84356
File added
widget_huli/dashboard/models.py
View file @
48d84356
from
django.db
import
models
from
django.urls
import
reverse
class
Department
(
models
.
Model
):
...
...
@@ -16,4 +17,11 @@ class WidgetUser(models.Model):
department
=
models
.
ForeignKey
(
Department
,
null
=
True
,
on_delete
=
models
.
CASCADE
)
def
__str__
(
self
):
return
'{}, {} {} : {}'
.
format
(
self
.
last_name
,
self
.
first_name
,
self
.
middle_name
,
self
.
department
)
\ No newline at end of file
return
'{}, {} {} : {}'
.
format
(
self
.
last_name
,
self
.
first_name
,
self
.
middle_name
,
self
.
department
)
def
get_absolute_url
(
self
):
return
reverse
(
'dashboard:widgetuser-details'
,
kwargs
=
{
'pk'
:
self
.
pk
})
def
get_update_url
(
self
):
return
reverse
(
'dashboard:widgetuser-edit'
,
kwargs
=
{
'pk'
:
self
.
pk
})
widget_huli/dashboard/templates/dashboard/dashboard.html
0 → 100644
View file @
48d84356
{% extends 'base.html' %}
{% block title %} Widget v2 {% endblock %}
{% block header %} Welcome to Widget!{% endblock %}
{% block body %}
<p>
Widget User:
</p>
<ul>
{% for name in widgetuser_list %}
<li>
<a
href=
"dashboard/widgetusers/{{ name.pk }}/details"
>
{{ name.last_name }}, {{name.first_name }}
</a><br>
</li>
{% endfor %}
</ul>
<button><a
href =
"dashboard/widgetusers/add"
>
Add Widget User
</a></button>
</p>
<a
href =
"/forum/"
>
Forum
</a>
<br>
<a
href =
"/assignments/"
>
Assignments
</a>
{% endblock %}
\ No newline at end of file
widget_huli/dashboard/templates/dashboard/widgetuser-add.html
0 → 100644
View file @
48d84356
{% extends 'base.html' %}
{% load static %}
{% block title %}Add Widget User {% endblock %}
{% block header %}Add a new Widget user:{% endblock %}
{% block body %}
{{ form.non_field_errors }}
{% for field in form %}
{% if field.errors %}
<ul>
{% for error in field.errors %}
<li>
{{ error }}
</li>
{% endfor %}
</ul>
{% endif %}
{% endfor %}
<form
method =
"post"
>
{% csrf_token %}
{% for field in form %}
{{field.label}}: {{field}}
<br><br>
{% endfor %}
<input
type=
"submit"
value=
"Add Widget User"
>
</form>
{% endblock %}
\ No newline at end of file
widget_huli/dashboard/templates/dashboard/widgetuser-details.html
0 → 100644
View file @
48d84356
{% extends 'base.html' %}
{% load static %}
{% block title %}{{ object.last_name }}, {{ object.first_name }}{% endblock %}
{% block header %}{{ object.first_name }} {{ object.middle_name }} {{ object.last_name }}{% endblock %}
{% block body %}
<p>
{{object.department.dept_name}}
</p>
<p>
{{object.department.home_unit}}
</p>
<button>
<a
href=
"edit"
>
Edit Widget User
</a></button>
<button><a
href =
"/dashboard"
>
Dashboard
</a></button>
{% endblock %}
\ No newline at end of file
widget_huli/dashboard/templates/dashboard/widgetuser-edit.html
0 → 100644
View file @
48d84356
{% extends 'base.html' %}
{% load static %}
{% block title %} Edit Widget User{% endblock %}
{% block header %}Edit Widget User:{% endblock %}
{% block body %}
<form
method =
"post"
>
{% csrf_token %}
{% for field in form %}
{{field.label}}: {{field}}
<br><br>
{% endfor %}
<input
type=
"submit"
value=
"Save Changes to Widget User"
>
</form>
{% endblock %}
\ No newline at end of file
widget_huli/dashboard/urls.py
View file @
48d84356
from
django.urls
import
path
from
.views
import
index
from
.views
import
dashboard_view
,
WidgetUserView
,
WidgetUserCreateView
,
WidgetUserUpdateView
urlpatterns
=
[
path
(
''
,
index
,
name
=
'index'
),
path
(
''
,
dashboard_view
,
name
=
'dashboard'
),
path
(
'/widgetusers/<pk>/details'
,
WidgetUserView
.
as_view
(),
name
=
'widgetuser-details'
),
path
(
'/widgetusers/add'
,
WidgetUserCreateView
.
as_view
(),
name
=
'widgetuser-add'
),
path
(
'/widgetusers/<pk>/edit'
,
WidgetUserUpdateView
.
as_view
(),
name
=
'widgetuser-edit'
),
]
dashboard
=
"Dashboard"
\ No newline at end of file
app_name
=
"dashboard"
\ No newline at end of file
widget_huli/dashboard/views.py
View file @
48d84356
from
django.shortcuts
import
render
from
django.http
import
HttpResponse
from
django.views.generic.detail
import
DetailView
from
django.views.generic.edit
import
CreateView
,
UpdateView
from
.models
import
WidgetUser
,
Department
def
index
(
request
):
text_in_http
=
"Welcome to Widget! <br> <br> WIDGET USERS: <br> <ul>"
for
user
in
WidgetUser
.
objects
.
all
():
text_in_http
+=
"<li>{}, {} {} : {}</li>"
.
format
(
user
.
last_name
,
user
.
first_name
,
user
.
middle_name
,
user
.
department
)
text_in_http
+=
"</ul>"
html_string
=
'<html><body>{}</body></html>'
.
format
(
text_in_http
)
def
dashboard_view
(
request
):
context
=
{}
context
[
"widgetuser_list"
]
=
WidgetUser
.
objects
.
all
()
return
render
(
request
,
'dashboard/dashboard.html'
,
context
)
class
WidgetUserView
(
DetailView
):
model
=
WidgetUser
template_name
=
'dashboard/widgetuser-details.html'
class
WidgetUserCreateView
(
CreateView
):
model
=
WidgetUser
fields
=
'__all__'
template_name
=
'dashboard/widgetuser-add.html'
class
WidgetUserUpdateView
(
UpdateView
):
model
=
WidgetUser
fields
=
'__all__'
template_name
=
'dashboard/widgetuser-edit.html'
return
HttpResponse
(
html_string
)
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