Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_father when can i be on my own i have the hello world to see
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
father when can i be on my own i have the hello world to see
widget_father when can i be on my own i have the hello world to see
Commits
747e094a
Verified
Commit
747e094a
authored
May 15, 2022
by
Angelo Esteban
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into esteban/assignments
parents
f5ef7048
01b3b775
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
274 additions
and
45 deletions
+274
-45
.gitignore
.gitignore
+1
-0
0004_widgetuser_profile_pic.py
homepage/migrations/0004_widgetuser_profile_pic.py
+18
-0
0005_remove_widgetuser_profile_pic.py
homepage/migrations/0005_remove_widgetuser_profile_pic.py
+17
-0
0006_widgetuser_profile_pic.py
homepage/migrations/0006_widgetuser_profile_pic.py
+18
-0
models.py
homepage/models.py
+7
-2
widgetuser_detail.html
homepage/templates/homepage/widgetuser_detail.html
+20
-0
index.html
homepage/templates/index.html
+19
-0
urls.py
homepage/urls.py
+4
-3
views.py
homepage/views.py
+11
-29
base_style.css
static/base_style.css
+57
-0
default_profilepic.png
static/default_profilepic.png
+0
-0
homepage.css
static/homepage.css
+23
-0
widgetuser_details.css
static/widgetuser_details.css
+24
-0
base.html
templates/base.html
+24
-9
settings.py
..._i_be_on_my_own_i_have_the_hello_world_to_see/settings.py
+4
-1
base.html
..._my_own_i_have_the_hello_world_to_see/templates/base.html
+25
-0
urls.py
..._can_i_be_on_my_own_i_have_the_hello_world_to_see/urls.py
+2
-1
No files found.
.gitignore
View file @
747e094a
...
@@ -11,6 +11,7 @@ media
...
@@ -11,6 +11,7 @@ media
# Environments
# Environments
.env
.env
/widgetenv
# .vscode
# .vscode
.vscode
.vscode
...
...
homepage/migrations/0004_widgetuser_profile_pic.py
0 → 100644
View file @
747e094a
# Generated by Django 4.0.4 on 2022-05-14 12:45
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'homepage'
,
'0003_alter_widgetuser_email_alter_widgetuser_id_num'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'widgetuser'
,
name
=
'profile_pic'
,
field
=
models
.
FileField
(
blank
=
True
,
null
=
True
,
upload_to
=
'static'
),
),
]
homepage/migrations/0005_remove_widgetuser_profile_pic.py
0 → 100644
View file @
747e094a
# Generated by Django 4.0.4 on 2022-05-14 12:48
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'homepage'
,
'0004_widgetuser_profile_pic'
),
]
operations
=
[
migrations
.
RemoveField
(
model_name
=
'widgetuser'
,
name
=
'profile_pic'
,
),
]
homepage/migrations/0006_widgetuser_profile_pic.py
0 → 100644
View file @
747e094a
# Generated by Django 4.0.4 on 2022-05-14 12:49
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'homepage'
,
'0005_remove_widgetuser_profile_pic'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'widgetuser'
,
name
=
'profile_pic'
,
field
=
models
.
FileField
(
blank
=
True
,
null
=
True
,
upload_to
=
'uploads'
),
),
]
homepage/models.py
View file @
747e094a
from
django.db
import
models
from
django.db
import
models
# Model for Department
# Model for Department
class
Department
(
models
.
Model
):
class
Department
(
models
.
Model
):
dept_name
=
models
.
CharField
(
max_length
=
100
)
dept_name
=
models
.
CharField
(
max_length
=
100
)
home_unit
=
models
.
CharField
(
max_length
=
100
)
home_unit
=
models
.
CharField
(
max_length
=
100
)
# Model for Widget User
# Model for Widget User
class
WidgetUser
(
models
.
Model
):
class
WidgetUser
(
models
.
Model
):
first_name
=
models
.
CharField
(
max_length
=
100
)
first_name
=
models
.
CharField
(
max_length
=
100
)
middle_name
=
models
.
CharField
(
max_length
=
100
)
middle_name
=
models
.
CharField
(
max_length
=
100
)
last_name
=
models
.
CharField
(
max_length
=
100
)
last_name
=
models
.
CharField
(
max_length
=
100
)
id_num
=
models
.
CharField
(
max_length
=
7
,
default
=
"123456"
)
id_num
=
models
.
CharField
(
max_length
=
7
,
default
=
"123456"
)
email
=
models
.
EmailField
(
max_length
=
256
,
default
=
"john.appleseed@gmail.com"
)
email
=
models
.
EmailField
(
max_length
=
256
,
default
=
"john.appleseed@gmail.com"
)
profile_pic
=
models
.
FileField
(
upload_to
=
"uploads"
,
null
=
True
,
blank
=
True
)
department
=
models
.
ForeignKey
(
department
=
models
.
ForeignKey
(
Department
,
Department
,
on_delete
=
models
.
SET_NULL
,
on_delete
=
models
.
SET_NULL
,
...
...
homepage/templates/homepage/widgetuser_detail.html
0 → 100644
View file @
747e094a
<!-- homepage/widgetuser_detail.html -->
{% extends 'base.html' %}
{% load static %}
{% block title %}Homepage{% endblock %}
{% block styles %}
<link
rel=
"stylesheet"
href=
"{% static '/widgetuser_details.css' %}"
>
{% endblock %}
{% block header %}
<img
width=
60
height=
60
src=
"{% static '/default_profilepic.png' %}"
/>
{{object.last_name}}, {{object.first_name}} {{object.middle_name}}
{% endblock %}
{% block content %}
<p>
Student ID: {{object.id_num}}
</p>
<p>
Email: {{object.email}}
</p>
<p>
Department and Course: {{object.department.home_unit}}, {{object.department.dept_name}}
</p>
{% endblock %}
\ No newline at end of file
homepage/templates/index.html
0 → 100644
View file @
747e094a
<!-- homepage/index.html -->
{% extends 'base.html' %}
{% load static %}
{% block title %}Homepage{% endblock %}
{% block styles %}
<link
rel=
"stylesheet"
href=
"{% static '/homepage.css' %}"
>
{% endblock %}
{% block header %}
Welcome to Widget!
{% endblock %}
{% block content %}
{% for user in all_widgetusers %}
<a
class=
"details"
href=
"{{user.id}}/details"
>
{{forloop.counter}}. {{user.last_name}}, {{user.first_name}} {{user.middle_name}}
</a>
</br>
{% endfor %}
{% endblock %}
\ No newline at end of file
homepage/urls.py
View file @
747e094a
from
django.urls
import
path
from
django.urls
import
path
from
.views
import
index
from
.views
import
HomepageView
,
WidgetUserDetailView
urlpatterns
=
[
urlpatterns
=
[
path
(
''
,
index
,
name
=
'index'
),
path
(
''
,
HomepageView
.
as_view
(),
name
=
'index'
),
path
(
'<int:pk>/details'
,
WidgetUserDetailView
.
as_view
(),
name
=
'widgetuser_detail'
),
]
]
app_name
=
"homepage"
app_name
=
"homepage"
homepage/views.py
View file @
747e094a
from
django.shortcuts
import
render
from
django.shortcuts
import
render
from
django.views
import
View
from
django.views.generic.detail
import
DetailView
from
.models
import
Department
,
WidgetUser
from
forum.views
import
display_forumposts
from
.models
import
WidgetUser
,
Department
from
django.http
import
HttpResponse
def
index
(
request
):
class
HomepageView
(
View
):
return
HttpResponse
(
display_homepage
(
WidgetUser
.
objects
.
all
(),
Department
.
objects
.
all
()))
def
get
(
self
,
request
):
objects_set
=
{
"all_widgetusers"
:
[
obj
for
obj
in
WidgetUser
.
objects
.
all
()
.
order_by
(
'last_name'
)]
}
return
render
(
request
,
'index.html'
,
objects_set
)
# View for HomePage
def
display_homepage
(
widgetuser_data
,
department_data
):
display_output
=
"WIDGET USERS: <br>"
for
object
in
widgetuser_data
:
class
WidgetUserDetailView
(
DetailView
):
first_name
=
object
.
first_name
model
=
WidgetUser
middle_name
=
object
.
middle_name
last_name
=
object
.
last_name
id_num
=
object
.
id_num
department_object
=
Department
.
objects
.
filter
(
id
=
object
.
department_id
)
.
first
()
if
(
department_object
!=
None
):
dept_name
=
department_object
.
dept_name
home_unit
=
department_object
.
home_unit
else
:
dept_name
=
"NONE"
home_unit
=
"NONE"
display_output
+=
f
'''
{last_name}, {first_name} {middle_name}: {id_num}, {dept_name}, {home_unit}<br>
'''
return
display_output
static/base_style.css
0 → 100644
View file @
747e094a
@font-face
{
font-family
:
'Khula'
;
font-style
:
normal
;
font-weight
:
300
;
font-display
:
swap
;
src
:
url(https://fonts.gstatic.com/s/khula/v12/OpNPnoEOns3V7G-ljBvTpi8.woff2)
format
(
'woff2'
);
unicode-range
:
U
+
0000-00
FF
,
U
+
0131
,
U
+
0152-0153
,
U
+
02
BB-02BC
,
U
+
02
C6
,
U
+
02
DA
,
U
+
02
DC
,
U
+
2000-206
F
,
U
+
2074
,
U
+
20
AC
,
U
+
2122
,
U
+
2191
,
U
+
2193
,
U
+
2212
,
U
+
2215
,
U
+
FEFF
,
U
+
FFFD
;
}
@font-face
{
font-family
:
'Comfortaa'
;
font-style
:
normal
;
font-weight
:
700
;
font-display
:
swap
;
src
:
url(https://fonts.gstatic.com/s/comfortaa/v38/1Pt_g8LJRfWJmhDAuUsSQamb1W0lwk4S4Y_LDrMfIA.woff2)
format
(
'woff2'
);
unicode-range
:
U
+
0000-00
FF
,
U
+
0131
,
U
+
0152-0153
,
U
+
02
BB-02BC
,
U
+
02
C6
,
U
+
02
DA
,
U
+
02
DC
,
U
+
2000-206
F
,
U
+
2074
,
U
+
20
AC
,
U
+
2122
,
U
+
2191
,
U
+
2193
,
U
+
2212
,
U
+
2215
,
U
+
FEFF
,
U
+
FFFD
;
}
nav
:focus
{
outline
:
0
!important
;
}
ul
{
list-style-type
:
none
;
margin
:
0
;
padding
:
0
;
display
:
flex
;
flex-direction
:
row
;
width
:
100%
;
background-color
:
#bb00ff
;
}
ul
li
{
padding
:
20px
;
}
.links
{
padding
:
21px
;
text-decoration
:
none
;
font-size
:
15px
;
color
:
white
;
font-family
:
Comfortaa
;
transition
:
background-color
0.2s
ease-in-out
;
}
.links
:hover
{
background-color
:
#410178
;
}
body
{
margin
:
0
;
}
.content
{
display
:
flex
;
flex-direction
:
column
;
margin
:
16px
0
0
25px
;
}
.header
{
margin
:
0
;
padding
:
0
;
font-size
:
50px
;
font-family
:
Khula
;
margin-bottom
:
10px
;
}
\ No newline at end of file
static/default_profilepic.png
0 → 100644
View file @
747e094a
15.1 KB
static/homepage.css
0 → 100644
View file @
747e094a
@font-face
{
font-family
:
'Oxygen'
;
font-style
:
normal
;
font-weight
:
400
;
font-display
:
swap
;
src
:
url(https://fonts.gstatic.com/s/oxygen/v15/2sDfZG1Wl4LcnbuKjk0m.woff2)
format
(
'woff2'
);
unicode-range
:
U
+
0000-00
FF
,
U
+
0131
,
U
+
0152-0153
,
U
+
02
BB-02BC
,
U
+
02
C6
,
U
+
02
DA
,
U
+
02
DC
,
U
+
2000-206
F
,
U
+
2074
,
U
+
20
AC
,
U
+
2122
,
U
+
2191
,
U
+
2193
,
U
+
2212
,
U
+
2215
,
U
+
FEFF
,
U
+
FFFD
;
}
.details
{
color
:
black
;
padding
:
10px
20px
10px
20px
;
text-decoration
:
none
;
font-family
:
Oxygen
;
width
:
fit-content
;
background-size
:
200%
100%
;
background-image
:
linear-gradient
(
to
right
,
#ffffff
50%
,
#000000
50%
);
transition
:
background-position
0.3s
ease-in-out
,
color
0.2s
ease-in-out
;
}
.details
:hover
{
background-color
:
black
;
background-position
:
-100%
0
;
color
:
white
;
}
\ No newline at end of file
static/widgetuser_details.css
0 → 100644
View file @
747e094a
@font-face
{
font-family
:
'Oxygen'
;
font-style
:
normal
;
font-weight
:
400
;
font-display
:
swap
;
src
:
url(https://fonts.gstatic.com/s/oxygen/v15/2sDfZG1Wl4LcnbuKjk0m.woff2)
format
(
'woff2'
);
unicode-range
:
U
+
0000-00
FF
,
U
+
0131
,
U
+
0152-0153
,
U
+
02
BB-02BC
,
U
+
02
C6
,
U
+
02
DA
,
U
+
02
DC
,
U
+
2000-206
F
,
U
+
2074
,
U
+
20
AC
,
U
+
2122
,
U
+
2191
,
U
+
2193
,
U
+
2212
,
U
+
2215
,
U
+
FEFF
,
U
+
FFFD
;
}
p
{
margin-top
:
0
;
margin-bottom
:
20px
;
font-family
:
Oxygen
;
}
h1
{
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
}
img
{
border-radius
:
50%
;
border
:
1px
solid
black
;
margin-right
:
30px
;
margin-top
:
-10px
;
}
\ No newline at end of file
templates/base.html
View file @
747e094a
<!-- project/template/base.html -->
{% load static %}
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<html
lang=
"en"
>
<head>
<head>
<title>
{% block title %}{% endblock %}
</title>
<title>
{% block title %}{% endblock %}
</title>
<link
href=
"{% static 'base_style.css' %}"
rel=
"stylesheet"
/>
{% block styles %}{% endblock %}
{% block styles %}{% endblock %}
</head>
</head>
<body>
<body>
<nav>
<ul>
<li><a
class=
"links"
href=
"/homepage"
>
HOMEPAGE
</a></li>
<li><a
class=
"links"
href=
"/assignments"
>
ASSIGNMENTS
</a></li>
<li><a
class=
"links"
href=
"/forum"
>
FORUM
</a></li>
<li><a
class=
"links"
href=
"/announcements"
>
ANNOUNCEMENTS
</a></li>
</ul>
</nav>
<div
class=
"content"
>
<h1
class=
"header"
>
{% block header %}{% endblock %}
</h1>
{% block content %}{% endblock %}
{% block content %}{% endblock %}
</div>
{% block scripts %}{% endblock %}
</body>
</body>
</html>
</html>
widget_father_when_can_i_be_on_my_own_i_have_the_hello_world_to_see/settings.py
View file @
747e094a
...
@@ -42,10 +42,11 @@ INSTALLED_APPS = [
...
@@ -42,10 +42,11 @@ INSTALLED_APPS = [
'django.contrib.sessions'
,
'django.contrib.sessions'
,
'django.contrib.messages'
,
'django.contrib.messages'
,
'django.contrib.staticfiles'
,
'django.contrib.staticfiles'
,
'widget_father_when_can_i_be_on_my_own_i_have_the_hello_world_to_see'
,
'forum'
,
'forum'
,
'assignments'
,
'assignments'
,
'homepage'
,
'homepage'
,
'announcement_board'
,
'announcement_board'
]
]
MIDDLEWARE
=
[
MIDDLEWARE
=
[
...
@@ -127,6 +128,8 @@ USE_TZ = True
...
@@ -127,6 +128,8 @@ USE_TZ = True
STATIC_URL
=
'static/'
STATIC_URL
=
'static/'
STATICFILES_DIRS
=
[
STATICFILES_DIRS
=
[
BASE_DIR
/
"static"
,
BASE_DIR
/
"static"
,
"assignments/templates"
,
"homepage/templates"
]
]
# Default primary key field type
# Default primary key field type
...
...
widget_father_when_can_i_be_on_my_own_i_have_the_hello_world_to_see/templates/base.html
0 → 100644
View file @
747e094a
<!-- project/template/base.html -->
{% load static %}
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<title>
{% block title %}{% endblock %}
</title>
<link
href=
"{% static 'base_style.css' %}"
rel=
"stylesheet"
/>
{% block styles %}{% endblock %}
</head>
<body>
<nav>
<ul>
<li><a
class=
"links"
href=
"/homepage"
>
HOMEPAGE
</a></li>
<li><a
class=
"links"
href=
"/assignments"
>
ASSIGNMENTS
</a></li>
<li><a
class=
"links"
href=
"/forum"
>
FORUM
</a></li>
<li><a
class=
"links"
href=
"/announcements"
>
ANNOUNCEMENTS
</a></li>
</ul>
</nav>
<div
class=
"content"
>
<h1
class=
"header"
>
{% block header %}{% endblock %}
</h1>
{% block content %}{% endblock %}
</div>
{% block scripts %}{% endblock %}
</body>
</html>
widget_father_when_can_i_be_on_my_own_i_have_the_hello_world_to_see/urls.py
View file @
747e094a
...
@@ -20,6 +20,7 @@ urlpatterns = [
...
@@ -20,6 +20,7 @@ urlpatterns = [
path
(
'homepage/'
,
include
(
"homepage.urls"
,
namespace
=
'homepage'
)),
path
(
'homepage/'
,
include
(
"homepage.urls"
,
namespace
=
'homepage'
)),
path
(
'admin/'
,
admin
.
site
.
urls
),
path
(
'admin/'
,
admin
.
site
.
urls
),
path
(
'forum/'
,
include
(
"forum.urls"
,
namespace
=
'forum'
)),
path
(
'forum/'
,
include
(
"forum.urls"
,
namespace
=
'forum'
)),
path
(
'announcements/'
,
include
(
"announcement_board.urls"
,
namespace
=
'announcement_board'
)),
path
(
'announcements/'
,
include
(
"announcement_board.urls"
,
namespace
=
'announcement_board'
)),
path
(
'assignments/'
,
include
(
"assignments.urls"
,
namespace
=
'assignments'
)),
path
(
'assignments/'
,
include
(
"assignments.urls"
,
namespace
=
'assignments'
)),
]
]
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