Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_group 25
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
Andre Matthew Dumandan
widget_group 25
Commits
6945a987
Commit
6945a987
authored
May 16, 2022
by
Andre Matthew Dumandan
😴
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dumandan/homepage'
parents
b6fdb185
896379f3
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
147 additions
and
10 deletions
+147
-10
models.py
widget_group_25/homepage/models.py
+1
-1
urls.py
widget_group_25/homepage/urls.py
+3
-3
views.py
widget_group_25/homepage/views.py
+24
-6
details.css
..._group_25/widget_group_25/static/homepage/css/details.css
+46
-0
homepage.css
...group_25/widget_group_25/static/homepage/css/homepage.css
+34
-0
profile-picture.jpg
...5/widget_group_25/static/homepage/img/profile-picture.jpg
+0
-0
details.html
..._group_25/widget_group_25/templates/homepage/details.html
+21
-0
homepage.html
...group_25/widget_group_25/templates/homepage/homepage.html
+18
-0
No files found.
widget_group_25/homepage/models.py
View file @
6945a987
widget_group_25/homepage/urls.py
View file @
6945a987
from
django.urls
import
path
from
django.urls
import
path
from
homepage
import
views
from
.views
import
index
urlpatterns
=
[
urlpatterns
=
[
path
(
''
,
index
,
name
=
'index'
),
path
(
''
,
views
.
index
,
name
=
'index'
),
path
(
'users/<str:user_id>/details'
,
views
.
details
,
name
=
'details'
),
]
]
app_name
=
"homepage"
app_name
=
"homepage"
\ No newline at end of file
widget_group_25/homepage/views.py
View file @
6945a987
from
re
import
A
,
template
from
django.shortcuts
import
render
from
django.shortcuts
import
render
from
django.template
import
loader
from
django.http
import
HttpResponse
from
django.http
import
HttpResponse
from
.models
import
WidgetUser
from
.models
import
WidgetUser
# Create your views here.
# Create your views here.
def
index
(
request
):
def
index
(
request
):
model
=
WidgetUser
user_list
=
WidgetUser
.
objects
.
order_by
(
"last_name"
)
widget_users
=
model
.
objects
.
all
()
template
=
loader
.
get_template
(
"homepage/homepage.html"
)
homepage_response
=
"WIDGET USERS: </br>"
context
=
{
"user_list"
:
user_list
,
}
return
HttpResponse
(
template
.
render
(
context
,
request
))
for
user
in
widget_users
:
homepage_response
+=
user
.
get_user_info
()
return
HttpResponse
(
homepage_response
)
def
details
(
request
,
user_id
):
\ No newline at end of file
user
=
WidgetUser
.
objects
.
get
(
id_num
=
user_id
)
template
=
loader
.
get_template
(
"homepage/details.html"
)
context
=
{
"user"
:
user
,
}
return
HttpResponse
(
template
.
render
(
context
,
request
))
#model = WidgetUser
#widget_users = model.objects.all()
#homepage_response = "WIDGET USERS: </br>"
#for user in widget_users:
#homepage_response += user.get_user_info()
#return HttpResponse(homepage_response)
\ No newline at end of file
widget_group_25/widget_group_25/static/homepage/css/details.css
0 → 100644
View file @
6945a987
@import
url('https://fonts.googleapis.com/css?family=Klavika&display=swap')
;
body
{
background-color
:
rgb
(
227
,
229
,
231
);
font-family
:
Helvetica
,
Arial
,
sans-serif
;
}
header
{
padding
:
70px
;
background-color
:
rgb
(
35
,
116
,
225
);
margin
:
-9px
;
margin-bottom
:
0px
;
}
wid
{
float
:
left
;
margin-top
:
50px
;
margin-left
:
10px
;
color
:
white
;
font-family
:
Klavika
,
Helvetica
,
Arial
,
sans-serif
;
font-size
:
25px
;
font-weight
:
bold
;
}
infohead
{
font-family
:
'Segoe UI'
,
Tahoma
,
Geneva
,
Verdana
,
sans-serif
;
line-height
:
10px
;
color
:
black
;
font-size
:
20px
;
line-height
:
40px
;
font-weight
:
bold
;
}
info
{
font-family
:
'Segoe UI'
,
Tahoma
,
Geneva
,
Verdana
,
sans-serif
;
line-height
:
10px
;
color
:
black
;
font-size
:
large
;
line-height
:
40px
;
}
img
{
border
:
5px
solid
rgb
(
227
,
229
,
231
);
border-radius
:
50%
;
float
:
right
;
margin-top
:
-100px
;
margin-right
:
50px
;
}
widget_group_25/widget_group_25/static/homepage/css/homepage.css
0 → 100644
View file @
6945a987
@import
url('https://fonts.googleapis.com/css?family=Klavika&display=swap')
;
body
{
background-color
:
rgb
(
227
,
229
,
231
);
}
header
{
margin-top
:
-10px
;
margin-left
:
-10px
;
margin-right
:
-10px
;
padding
:
30px
;
background-color
:
rgb
(
35
,
116
,
225
);
text-align
:
center
;
color
:
white
;
font-size
:
200%
;
font-family
:
Klavika
,
Arial
,
Helvetica
,
sans-serif
;
font-weight
:
bold
;
}
p
{
color
:
black
;
font-family
:
'Segoe UI'
,
Tahoma
,
Geneva
,
Verdana
,
sans-serif
,
Arial
,
sans-serif
;
text-align
:
center
;
}
wu
{
font-size
:
25px
;
font-weight
:
500
;
}
a
{
color
:
black
;
font-family
:
'Segoe UI'
,
Tahoma
,
Geneva
,
Verdana
,
sans-serif
;
text-decoration
:
none
;
font-size
:
large
;
}
widget_group_25/widget_group_25/static/homepage/img/profile-picture.jpg
0 → 100644
View file @
6945a987
1.58 KB
widget_group_25/widget_group_25/templates/homepage/details.html
0 → 100644
View file @
6945a987
{% extends 'base.html' %}
{% load static %}
{% block title %} User Details {% endblock %}
{% block styles %}
<link
rel=
"stylesheet"
href=
"{% static 'homepage/css/details.css' %}"
>
{% endblock %}
{% block content %}
<wid>
{{user.last_name}}, {{user.first_name}} {{user.middle_name}}
</wid>
<header></header>
<img
src=
"{% static 'homepage/img/profile-picture.jpg' %}"
alt=
"Profile Picture"
>
<infohead>
User Details
</br></infohead>
<info>
ID number: {{user.id_num}}
</br>
Email address: {{user.email}}
</br>
Department name: {{user.department}}
</br>
Home unit: {{user.department.home_unit}}
</br>
</info>
{% endblock %}
\ No newline at end of file
widget_group_25/widget_group_25/templates/homepage/homepage.html
0 → 100644
View file @
6945a987
{% extends 'base.html' %}
{% load static %}
{% block title %} Homepage {% endblock %}
{% block styles %}
<link
rel=
"stylesheet"
href=
"{% static 'homepage/css/homepage.css' %}"
>
{% endblock %}
{% block content %}
<header>
Welcome to the Widget!
</header>
<p>
<wu>
Widget Users:
</wu>
<ol
type =
'1'
>
{% for user in user_list %}
<a
href =
"{% url 'homepage:details' user.id_num %}"
"
>
<li>
{{user.last_name}}, {{user.first_name}} {{user.middle_name}}
</br>
</a>
</li>
</p>
{% endfor %}
</ol>
{% endblock %}
\ No newline at end of file
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