Commit d8829f75 authored by Eldon Dagdag's avatar Eldon Dagdag

Applied CSS styling to Forum pages via bootstrap

parent 51a1414f
...@@ -14,4 +14,4 @@ class WidgetUser(models.Model): ...@@ -14,4 +14,4 @@ class WidgetUser(models.Model):
department = models.ForeignKey(Department, on_delete=models.CASCADE) department = models.ForeignKey(Department, on_delete=models.CASCADE)
def __str__(self): def __str__(self):
return 'Name: {}, {} {}'.format(self.last_name, self.first_name, self.middle_name) return '{}, {} {}'.format(self.last_name, self.first_name, self.middle_name)
\ No newline at end of file \ No newline at end of file
...@@ -2,22 +2,50 @@ ...@@ -2,22 +2,50 @@
{% load static %} {% load static %}
{% block title %}Widget's Forum{% endblock %} {% block title %}Widget's Forum{% endblock %}
{% block content %} {% block content %}
<html> <div class="row">
<h1>Welcome to Widget's Forum!</h1> <div class="col-3 text-center text-white" style="background-color:#052c65">
<body> <br>
<h3>Forum posts:</h3> <br>
{% for post in posts %} <img src="{% static 'forum_icon.png'%}" class="img-fluid" width="100" height="100">
<ul> <br>
<a href="{{ post.get_absolute_url }}">{{ post.title }} by {{ post.author.first_name }} {{post.author.last_name }}</a> <br>
</ul> <h2>Forum</h2>
{% endfor %} <br><br><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:60px; color:#052c65">Welcome to Widget's Forum</h1>
</div>
<br>
<br>
<h6 class="display-3"style="font-size:40px; color:#052c65">Forum posts:</h6>
{% for post in posts %}
<a href="{{ post.get_absolute_url }}" class="link-dark; display-3" style="font-size:18px; color:#052c65">
{{ post.title }} by {{ post.author.first_name }} {{post.author.last_name }}</a>
<br>
{% endfor %}
<br><br>
<button type="button" class="btn btn-dark" style="background-color:#e3e4e6">
<a href="/forum/forumposts/add/" class="link-dark">New Post</a>
</button>
<br>
<br>
<br>
<button type="button" class="btn" style="background-color:#052c65">
<a href="/dashboard/" class="link-light">Dashboard</a>
</button> &nbsp;
<button type="button" class="btn" style="background-color:#334277">
<a href="/announcements/" class="link-light">Announcement Board</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>
<button class="button"><a href="/forum/forumposts/add/">New Post</a></button>
<br><br>
<a href="/dashboard/">Dashboard</a><br>
<a href="/announcements/">Announcements</a><br>
<a href="/assignments/">Assignments</a><br>
<a href="/calendar/">Calendar</a>
</body>
</html>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -2,12 +2,40 @@ ...@@ -2,12 +2,40 @@
{% load static %} {% load static %}
{% block title %}Add Post{% endblock %} {% block title %}Add Post{% endblock %}
{% block content %} {% block content %}
<h3>Add a new post.</h3> <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 'forum_icon.png'%}" class="img-fluid" width="100" height="100">
{% endfor %} <br>
<input type="submit" value="Save New Post"> <br>
</form> <h2>Calendar</h2>
<h4 class="display-6" style="font-size:20px">Add New Forum Post</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 post:</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 New Post" style="background-color:#052c65">
</form>
<br><br>
</div>
</div>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -2,22 +2,59 @@ ...@@ -2,22 +2,59 @@
{% load static %} {% load static %}
{% block title %}{{ object.title }}{% endblock %} {% block title %}{{ object.title }}{% endblock %}
{% block content %} {% block content %}
<h3>{{ object.title }}</h4> <div class="row">
<h4>by {{ object.author.first_name }} {{ object.author.last_name }}</h4> <div class="col-3 text-center text-white" style="background-color:#052c65">
<h4>{{ object.formatted_date }}, {{object.formatted_time }}</h4> <br>
<h4>{{ object.body }}</h4> <br>
<br><br> <img src="{% static 'forum_icon.png'%}" class="img-fluid" width="100" height="100">
<br>
<br>
<h2>Forum</h2>
<h4 class="display-6" style="font-size:20px">Forum Post 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.title }}</h1>
</div>
<br>
<div class="row">
<div class="col-5" style="text-align:right">
<h4 style="font-size:25px">By:</h4>
<h4 style="font-size:25px">Posted On:</h4>
</div>
<div class="col-7" style="text-align:left">
<h5 class="display-3" style="font-size:25px">{{ object.author.first_name }} {{ object.author.last_name }}</h5>
<h5 class="display-3" style="font-size:25px">{{ object.formatted_date }}, {{ object.formatted_time }}</h5>
</div>
</div>
<br>
<div class="row p-2" style="background-color:#e3e4e6">
<h5 class="display-3" style="font-size:25px">{{ object.body }}</h5>
</div>
<br>
<h3>POST REPLIES:</h3> <div class="row"><h3 class="display-3" style="font-size:35px; color:#052c65">Post Replies:</h3></div>
{% for reply in reply_list %}
{% if reply.forum_post.title == object.title %} {% for reply in reply_list %}
<ul> {% if reply.forum_post.title == object.title %}
<h4>by {{ reply.author.first_name }} {{ reply.author.last_name }}</h4> <div class="row p-5 text-center" style="background-color:#e3e4e6">
<h4>{{ reply.formatted_date }}, {{ reply.formatted_time }}</h4> <h1 class="display-3" style="font-size:25px; color:#052c65">{{ reply.body }}</h1>
<h4>{{ reply.body }}</h4><br> <h1 class="display-3" style="font-size:20px; color:#052c65">by {{ reply.author.first_name }} {{ reply.author.last_name }}</h1>
</ul> <h1 class="display-3" style="font-size:15px; color:#052c65">{{ reply.formatted_date }}, {{ reply.formatted_time }}</h1>
{% endif %} </div>
{% endfor %} {% endif %}
{% endfor %}
<br><br>
<button type="button" class="btn" style="background-color:#e3e4e6">
<a href="/forum/forumposts/{{ object.pk }}/edit/" class="link-dark">Edit Post</a>
</button> &nbsp; &nbsp;
<button type="button" class="btn" style="background-color:#052c65">
<a href="/forum/" class="link-light">Back to Forum</a>
</button>
</div>
</div>
<h3><button class="button"><a href="/forum/forumposts/{{ object.pk }}/edit/">Edit Post</a></button></h3>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -2,12 +2,40 @@ ...@@ -2,12 +2,40 @@
{% load static %} {% load static %}
{% block title %}Edit Post{% endblock %} {% block title %}Edit Post{% endblock %}
{% block content %} {% block content %}
<h3>Edit Post:</h3> <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> <img src="{% static 'forum_icon.png'%}" class="img-fluid" width="100" height="100">
{% endfor %} <br>
<input type="submit" value="Save Changes to Post"> <br>
</form> <h2>Calendar</h2>
<h4 class="display-6" style="font-size:20px">Edit Forum Post</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 post:</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 Post" style="background-color:#052c65">
</form>
<br><br>
</div>
</div>
{% endblock %} {% endblock %}
\ No newline at end of file
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