Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widgets_FEKK
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
Kyla Martin
widgets_FEKK
Commits
c7241cd4
Commit
c7241cd4
authored
May 24, 2022
by
Franco Velasco
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed profile image in Homepage users
parent
cd6d2b07
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
models.py
WidgetFEKK/Homepage/models.py
+4
-1
user_page.html
WidgetFEKK/Homepage/templates/user_page.html
+2
-2
No files found.
WidgetFEKK/Homepage/models.py
View file @
c7241cd4
...
...
@@ -3,6 +3,9 @@ from django.urls import reverse
from
datetime
import
datetime
import
os
def
dp_location
(
request
,
filename
):
return
os
.
path
.
join
(
"widget-users/images/"
,
filename
)
"""
A model for a school department in Widget.
Has fields for the names of the department and the unit it is associated with.
...
...
@@ -28,7 +31,7 @@ class WidgetUser(models.Model):
department
=
models
.
ForeignKey
(
Department
,
on_delete
=
models
.
CASCADE
)
profile_image
=
models
.
ImageField
(
upload_to
=
f
"widget-users/images/{id_num}"
,
null
=
True
,
blank
=
True
)
profile_image
=
models
.
ImageField
(
upload_to
=
dp_location
,
null
=
True
,
blank
=
True
)
def
__str__
(
self
):
return
f
"""{self.last_name}, {self.first_name} {self.middle_name}:
...
...
WidgetFEKK/Homepage/templates/user_page.html
View file @
c7241cd4
...
...
@@ -34,8 +34,8 @@
{% block content %}
<h1>
Widget User Profile
</h1>
<div
class=
"user-page-container"
>
{% if
post
.profile_image %}
<img
src=
"{{ MEDIA_DIR }}/widget-users/images/{{ user.
id_num
}}"
alt=
"Profile Image of {{ user.get_name }}"
width=
"192"
height=
"192"
>
{% if
user
.profile_image %}
<img
src=
"{{ MEDIA_DIR }}/widget-users/images/{{ user.
profile_image
}}"
alt=
"Profile Image of {{ user.get_name }}"
width=
"192"
height=
"192"
>
{% else %}
<img
src=
"{% static 'Homepage/3.JPG' %}"
alt=
"Profile Image of {{ user.get_name }}"
width=
"192"
height=
"192"
>
{% endif %}
...
...
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