Edited the HTML templates for Forum to use CSS

parent 2fd5a27e
{% extends 'base.html' %} {% extends 'base.html' %}
{% load static %} {% block title %} Widget's Forum {% endblock %}
{% block content %} {% block header %} Welcome to Widget's Forum {% endblock %}
<title>Widget's Forum</title>
<h1>Welcome to Widget's Forum</h1>
<h2>Forum posts:</h2> {% block content %}
<div id = "object_container">
<ul id = "object_list">
{% for post in posts %} {% for post in posts %}
<a href="forumposts/{{ post.pk }}/details/">{{ post.title }} by {{ post.author.first_name }} {{ post.author.last_name }}</a><br> <a href="forumposts/{{ post.pk }}/details/" class="item">{{ post.title }} by {{ post.author.first_name }} {{ post.author.last_name }}</a><br>
{% endfor %} {% endfor %}
<br><br> <br>
<li>
<a href="forumposts/add/"><button value="click here">New Post</button></a><br><br> <a href="forumposts/add/" class="item">New Post</a>
</li>
</ul>
</div>
{% endblock %}
<a href="/Dashboard/">Dashboard</a><br> {% block navbar %}
<a href="/announcements/">Announcements</a><br> <div id = "navbar">
<a href="/assignments/">Assignments</a><br> <a href = "/dashboard/">Dashboard</a>
<a href="/widget_Calendar/">Calendar</a><br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{% endblock content %} <a href="/announcements/">Announcements</a>
\ No newline at end of file &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href = "/assignments/">Assignments</a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href = "/calendar/">Calendar</a>
</div>
{% endblock %}
\ No newline at end of file
{% extends 'base.html' %} {% extends 'base.html' %}
{% load static %} {% block title %} Add Post {% endblock %}
{% block header %} Add a new post: {% endblock %}
{% block content %} {% block content %}
<title>Add Post</title> <form action="" method=POST>
<h1>Add a new post:</h1>
<form method="post">
{% csrf_token %} {% csrf_token %}
{{ form.as_p }} {{ form.as_p }}
<input type="submit" value="Save New Post"> <input type="submit" value="Save New Post">
</form> </form>
{% endblock content %} {% endblock %}
\ No newline at end of file
{% extends 'base.html' %} {% extends 'base.html' %}
{% load static %} {% block title %} {{ posts.title }} {% endblock %}
{% block header %} {{ posts.title }} {% endblock %}
{% block content %} {% block content %}
<title>{{ posts.title }}</title>
<h1>{{ posts.title }}</h1>
<h2>by {{ posts.author.first_name }} {{ posts.author.last_name }}</h2> <h2>by {{ posts.author.first_name }} {{ posts.author.last_name }}</h2>
<p>{{ posts.pub_datetime|date:"M/d/Y, f A"}}</p> <p>{{ posts.pub_datetime|date:"M/d/Y, f A"}}</p>
<p>{{ posts.body }}</p> <p>{{ posts.body }}</p>
...@@ -14,5 +14,7 @@ ...@@ -14,5 +14,7 @@
{{ reply.pub_datetime|date:"M/d/Y, f A"}}<br> {{ reply.pub_datetime|date:"M/d/Y, f A"}}<br>
{{ reply.body }}<br><br> {{ reply.body }}<br><br>
{% endfor %} {% endfor %}
<a href="/forum/forumposts/{{ posts.pk }}/edit/"><button value="click here">Edit Post</button></a> <li>
{% endblock content %} <a href="/forum/forumposts/{{ posts.pk }}/edit/" class="item">Edit Post</a>
\ No newline at end of file </li>
{% endblock %}
{% extends 'base.html' %} {% extends 'base.html' %}
{% load static %} {% block title %} Edit Post {% endblock %}
{% block header %} Edit post: {% endblock %}
{% block content %} {% block content %}
<title>Edit Post</title> <form action="" method=POST>
<h1>Edit post:</h1>
<form method="post">
{% csrf_token %} {% csrf_token %}
{{ form.as_p }} {{ form.as_p }}
<input type="submit" value="Save Changes to Post"> <input type="submit" value="Save Changes to Post">
</form> </form>
{% endblock content %} {% 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