Commit d636c601 authored by Andre Matthew Dumandan's avatar Andre Matthew Dumandan 😴

Moved the static and templates directory in settings.py, Moved the static and...

Moved the static and templates directory in settings.py, Moved the static and template files, Updated the css files, and Updated the directory of base.html in the templates.
parent ad1923ae
# Generated by Django 4.0.3 on 2022-03-21 09:09
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Department',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('dept_name', models.CharField(max_length=124)),
('home_unit', models.CharField(max_length=124)),
],
),
migrations.CreateModel(
name='WidgetUser',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('first_name', models.CharField(max_length=35)),
('middle_name', models.CharField(max_length=20)),
('last_name', models.CharField(max_length=20)),
('id_num', models.IntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(9999999)])),
('email', models.EmailField(max_length=254)),
('department', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='homepage.department')),
],
),
]
# Generated by Django 4.0.3 on 2022-03-21 09:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('homepage', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='widgetuser',
name='id_num',
field=models.IntegerField(),
),
]
# Generated by Django 4.0.3 on 2022-03-21 09:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('homepage', '0002_alter_widgetuser_id_num'),
]
operations = [
migrations.AlterField(
model_name='widgetuser',
name='email',
field=models.EmailField(default='', max_length=254),
),
migrations.AlterField(
model_name='widgetuser',
name='id_num',
field=models.IntegerField(default=''),
),
]
# Generated by Django 4.0.3 on 2022-03-21 09:21
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('homepage', '0003_alter_widgetuser_email_alter_widgetuser_id_num'),
]
operations = [
migrations.AlterField(
model_name='widgetuser',
name='id_num',
field=models.IntegerField(default='', validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(9999999)]),
),
]
# Generated by Django 4.0.3 on 2022-03-23 07:38
from django.db import migrations, models
import homepage.models
class Migration(migrations.Migration):
dependencies = [
('homepage', '0004_alter_widgetuser_id_num'),
]
operations = [
migrations.AlterField(
model_name='widgetuser',
name='id_num',
field=models.CharField(default='', max_length=7, validators=[homepage.models.WidgetUser.ID_validator]),
),
]
body {
background-color: paleturquoise;
font-family: Helvetica, Arial, sans-serif;
}
header {
color: blue;
font-size: 200%;
}
p {
color: black;
font-size: 100%;
}
......@@ -7,7 +7,7 @@ from .models import WidgetUser
# Create your views here.
def index(request):
user_list = WidgetUser.objects.order_by("last_name")
template = loader.get_template("homepage/index.html")
template = loader.get_template("homepage/homepage.html")
context = {
"user_list" : user_list,
}
......
......@@ -62,7 +62,7 @@ ROOT_URLCONF = 'widget_group_25.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'DIRS': [os.path.join(BASE_DIR,'widget_group_25/templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
......@@ -124,6 +124,7 @@ USE_TZ = True
# https://docs.djangoproject.com/en/4.0/howto/static-files/
STATIC_URL = 'static/'
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'widget_group_25/static')]
# Default primary key field type
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
......
@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;
}
@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;
}
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="base.css">
<title>{% block title %} {% endblock %}</title>
<link rel="stylesheet" href="styles.css">
<title>{% block title %}{% endblock %}</title>
{% block styles %}{% endblock %}
</head>
<body>
<div id="content">
{% block content %}{% endblock %}
{% block content %}This is the base html{% endblock %}
</div>
{% block scripts %}{% endblock %}
{% block scripts %}{% endblock %}
</body>
</html>
\ No newline at end of file
{% extends 'homepage/base.html' %}
{% extends 'base.html' %}
{% load static %}
{% block title %} User Details {% endblock %}
{% block styles %} <link rel="stylesheet" href="{% static 'base.css' %}"> {% endblock %}
{% block styles %} <link rel="stylesheet" href="{% static 'homepage/css/details.css' %}"> {% endblock %}
{% block content %}
Complete name: {{user.last_name}}, {{user.first_name}} {{user.middle_name}} </br>
<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>
Profile Picture: <img src="{% static 'profile-picture.jpg' %}" alt="Profile Picture"> </br>
</info>
{% endblock %}
\ No newline at end of file
{% extends 'homepage/base.html' %}
{% extends 'base.html' %}
{% load static %}
{% block title %} Homepage {% endblock %}
{% block styles %} <link rel="stylesheet" href="{% static 'base.css' %}"> {% endblock %}
{% block styles %} <link rel="stylesheet" href="{% static 'homepage/css/homepage.css' %}"> {% endblock %}
{% block content %}
<header> Welcome to the Widget! </header>
<p>
Widget Users:
<wu> Widget Users: </wu>
<ol type = '1'>
{% for user in user_list %}
<a href = "{% url 'homepage:details' user.id_num %}"">
......
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