Commit 46a5e9ce authored by Jenica Vizmanos's avatar Jenica Vizmanos

Applied CSS styling to Dashboard pages via bootstrap

parent 17b10071
...@@ -9,9 +9,9 @@ class Department(models.Model): ...@@ -9,9 +9,9 @@ class Department(models.Model):
return '{}, {}'.format(self.dept_name, self.home_unit) return '{}, {}'.format(self.dept_name, self.home_unit)
class WidgetUser(models.Model): class WidgetUser(models.Model):
first_name = models.CharField(max_length=255, default='') first_name = models.CharField(max_length=255, default='', verbose_name='First Name')
middle_name = models.CharField(max_length=255, default='') middle_name = models.CharField(max_length=255, default='', verbose_name='Middle Name')
last_name = models.CharField(max_length=255, default='') last_name = models.CharField(max_length=255, default='', verbose_name='Last Name')
department = models.ForeignKey(Department, on_delete=models.CASCADE, verbose_name='Department, Home Unit') department = models.ForeignKey(Department, on_delete=models.CASCADE, verbose_name='Department, Home Unit')
def __str__(self): def __str__(self):
......
...@@ -2,20 +2,49 @@ ...@@ -2,20 +2,49 @@
{% load static %} {% load static %}
{% block title %}Widget v2{% endblock %} {% block title %}Widget v2{% endblock %}
{% block content %} {% block content %}
<h1>Welcome to Widget!</h1> <div class="row">
<p> <div class="col-3 text-center text-white" style="background-color:#052c65">
Widget Users:<br> <br>
{% for user in users %} <br>
<a href='{{ user.get_absolute_url }}'>{{ user }}</a><br> <img src="{% static 'dashboard_icon.png'%}" class="img-fluid" width="100" height="100">
{% endfor %} <br>
</p> <br>
<p> <h2>Dashboard</h2>
<button class='button'><a href='/dashboard/widgetusers/add/'>Add Widget User</a></button> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</p> <p>© Jenica e-Sports</p>
<p> </div>
<a href='/announcements/'>Announcement Board</a><br> <div class="col-9 text-center">
<a href='/forum/'>Forum</a><br> <div class="row p-5 text-center" style="background-color:#e3e4e6">
<a href='/assignments/'>Assignments</a><br> <h1 class="display-3"style="font-size:60px; color:#052c65">Welcome to Widget!</h1>
<a href='/calendar/'>Calendar</a><br> </div>
</p> <br>
<br>
<h6 class="display-3"style="font-size:40px; color:#052c65">Widget Users:</h6><br>
{% for user in users %}
<a href="{{ user.get_absolute_url }}" class="link-dark; display-3" style="font-size:18px; color:#052c65">
{{ user }}</a>
<br>
{% endfor %}
<br><br>
<button type="button" class="btn" style="background-color:#e3e4e6">
<a href="/dashboard/widgetusers/add/" class="link-dark">Add Widget User</a>
</button>
<br>
<br>
<br>
</button> &nbsp;
<button type="button" class="btn" style="background-color:#052c65">
<a href="/announcements/" class="link-light">Announcement Board</a>
</button> &nbsp;
<button type="button" class="btn" style="background-color:#334277">
<a href="/forum/" class="link-light">Forum</a>
</button> &nbsp;
<button type="button" class="btn" style="background-color:#425086">
<a href="/assignments/" class="link-light">Assignments</a>
</button> &nbsp;
<button type="button" class="btn" style="background-color:#515e96">
<a href="/calendar/" class="link-light">Calendar</a>
</button>
</div>
</div>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -2,12 +2,40 @@ ...@@ -2,12 +2,40 @@
{% load static %} {% load static %}
{% block title %}Add Widget User{% endblock %} {% block title %}Add Widget User{% endblock %}
{% block content %} {% block content %}
<h1>Add a new Widget User:</h1> <div class="row">
<form method="post"> <div class="col-3 text-center text-white" style="background-color:#052c65">
{% csrf_token %} <br>
{% for field in form %} <br>
{{ field.label }}: {{ field }}<br><br> <img src="{% static 'dashboard_icon.png'%}" class="img-fluid" width="100" height="100">
{% endfor %} <br>
<input type="submit" value="Add Widget User"> <br>
</form> <h2>Dashboard</h2>
<h4 class="display-6" style="font-size:20px">Add Widget User</h4>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<p>© Jenica e-Sports</p>
</div>
<div class="col-9 text-center">
<div class="row p-5 text-center" style="background-color:#e3e4e6">
<h1 class="display-3" style="font-size:50px; color:#052c65">Add a new widget user:</h1>
</div>
<br>
<div class="row"></div>
<form method="post">
{% csrf_token %}
{% for field in form %}
<div class="row">
<div class="col-5" style="text-align:right">
<h5 class="display-3" style="font-size:25px">{{field.label}}:</h4>
</div>
<div class="col-7" style="text-align:left">
{{field}}
</div>
</div>
<br>
{% endfor %}
<input type="submit" class="btn btn-dark" value="Add Widget User" style="background-color:#052c65">
</form>
<br><br>
</div>
</div>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -2,12 +2,40 @@ ...@@ -2,12 +2,40 @@
{% load static %} {% load static %}
{% block title %}{{ object }}{% endblock %} {% block title %}{{ object }}{% endblock %}
{% block content %} {% block content %}
<h1>{{ object.first_name }} {{ object.middle_name }} {{ object.last_name }}</h1> <div class="row">
<p> <div class="col-3 text-center text-white" style="background-color:#052c65">
{{ object.department.dept_name }}<br> <br>
{{ object.department.home_unit }} <br>
</p> <img src="{% static 'dashboard_icon.png'%}" class="img-fluid" width="100" height="100">
<p> <br>
<button class='button'><a href='/dashboard/widgetusers/{{ object.pk }}/edit/'>Edit Widget User</a></button> <br>
</p> <h2>Dashboard</h2>
<h4 class="display-6" style="font-size:20px">Widget User Details</h4>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<p>© Jenica e-Sports</p>
</div>
<div class="col-9 text-center">
<div class="row p-5 text-center" style="background-color:#e3e4e6">
<h1 class="display-3" style="font-size:50px; color:#052c65">{{ object.first_name }} {{ object.middle_name }} {{ object.last_name }}</h1>
</div>
<br>
<div class="row">
<div class="col-5" style="text-align:right">
<h4 style="font-size:25px">Department Name:</h4>
<h4 style="font-size:25px">Home Unit:</h4>
</div>
<div class="col-7" style="text-align:left">
<h5 class="display-3" style="font-size:25px">{{ object.department.dept_name }}</h5>
<h5 class="display-3" style="font-size:25px">{{ object.department.home_unit }}</h5>
</div>
</div>
<br><br>
<button type="button" class="btn" style="background-color:#e3e4e6">
<a href="/dashboard/widgetusers/{{ object.pk }}/edit/" class="link-dark">Edit Widget User</a>
</button> &nbsp; &nbsp;
<button type="button" class="btn" style="background-color:#052c65">
<a href="/dashboard/" class="link-light">Back to Dashboard</a>
</button>
</div>
</div>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -2,12 +2,40 @@ ...@@ -2,12 +2,40 @@
{% load static %} {% load static %}
{% block title %}Edit Widget User{% endblock %} {% block title %}Edit Widget User{% endblock %}
{% block content %} {% block content %}
<h1>Edit Widget User:</h1> <div class="row">
<form method="post"> <div class="col-3 text-center text-white" style="background-color:#052c65">
{% csrf_token %} <br>
{% for field in form %} <br>
{{ field.label }}: {{ field }}<br><br> <img src="{% static 'dashboard_icon.png'%}" class="img-fluid" width="100" height="100">
{% endfor %} <br>
<input type="submit" value="Save Changes to Widget User"> <br>
</form> <h2>Dashboard</h2>
<h4 class="display-6" style="font-size:20px">Edit Widget User</h4>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<p>© Jenica e-Sports</p>
</div>
<div class="col-9 text-center">
<div class="row p-5 text-center" style="background-color:#e3e4e6">
<h1 class="display-3" style="font-size:50px; color:#052c65">Edit Widget User:</h1>
</div>
<br>
<div class="row"></div>
<form method="post">
{% csrf_token %}
{% for field in form %}
<div class="row">
<div class="col-5" style="text-align:right">
<h5 class="display-3" style="font-size:25px">{{field.label}}:</h4>
</div>
<div class="col-7" style="text-align:left">
{{field}}
</div>
</div>
<br>
{% endfor %}
<input type="submit" class="btn btn-dark" value="Save Changes to Widget User" style="background-color:#052c65">
</form>
<br><br>
</div>
</div>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -126,6 +126,7 @@ USE_TZ = True ...@@ -126,6 +126,7 @@ USE_TZ = True
# https://docs.djangoproject.com/en/4.1/howto/static-files/ # https://docs.djangoproject.com/en/4.1/howto/static-files/
STATIC_URL = 'static/' STATIC_URL = 'static/'
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]
# Default primary key field type # Default primary key field type
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field # https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
......
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