Commit 03f475c9 authored by Charles Lim's avatar Charles Lim

Created image file for WidgetUser and fixed styles

parent a91e5594
# 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'),
),
]
# 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',
),
]
# 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'),
),
]
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,
......
...@@ -11,3 +11,14 @@ p { ...@@ -11,3 +11,14 @@ p {
margin-bottom: 20px; margin-bottom: 20px;
font-family: Oxygen; 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
...@@ -9,11 +9,12 @@ ...@@ -9,11 +9,12 @@
{% endblock %} {% endblock %}
{% block header %} {% block header %}
<img width=60 height=60 src="{% static '/default_profilepic.png' %}"/>
{{object.last_name}}, {{object.first_name}} {{object.middle_name}} {{object.last_name}}, {{object.first_name}} {{object.middle_name}}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<p> Student ID: {{object.id_num}}</p> <p> Student ID: {{object.id_num}}</p>
<p> Email: {{object.email}}</p> <p> Email: {{object.email}}</p>
<p> Department: {{object.department.home_unit}}, {{object.department.dept_name}}</p> <p> Department and Course: {{object.department.home_unit}}, {{object.department.dept_name}}</p>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -126,6 +126,8 @@ USE_TZ = True ...@@ -126,6 +126,8 @@ USE_TZ = True
# https://docs.djangoproject.com/en/4.0/howto/static-files/ # https://docs.djangoproject.com/en/4.0/howto/static-files/
STATIC_URL = '/static/' STATIC_URL = '/static/'
STATICFILES_DIRS = [os.path.join(
BASE_DIR, 'widget_father_when_can_i_be_on_my_own_i_have_the_hello_world_to_see/static')]
# Default primary key field type # Default primary key field type
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field # https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
......
...@@ -52,5 +52,6 @@ body { ...@@ -52,5 +52,6 @@ body {
margin: 0; margin: 0;
padding: 0; padding: 0;
font-size: 50px; font-size: 50px;
font-family: Khula font-family: Khula;
margin-bottom: 10px;
} }
\ No newline at end of file
...@@ -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')),
] ]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment