Commit c18ff0d7 authored by Jan Enzo Salvador's avatar Jan Enzo Salvador

Created a forum folder inside the template folder

parent a8cf4d37
{% extends 'base.html' %}
{% load static %}
{% block title %} Widget's Forum {% endblock %}
{% block content %}
<h1>Welcome to Widget's Forum!</h1>
<h2>Forum posts:</h2>
<ul>
{% for forumpost in forumposts %}
<li>
<a href="{{forumpost.get_absolute_url}}">
{{ forumpost.title }} by {{ forumpost.author.firstname }} {{ forumpost.author.lastname }}
</a>
</li>
{% endfor %}
</ul>
<form action="forum/forumposts/add">
<button type="submit">New Post</button>
</form>
<li><a href="/dashboard">Dashboard</a> <br></li>
<li> <a href="/announcements">Announcements</a> <br></li>
<li> <a href="/assignments">Assignments</a> <br></li>
<li><a href="/calendar">Calendar</a> <br></li>
{% endblock %}
{% extends 'base.html' %}
{% load static %}
{% block title %} Add Post {% endblock %}
{% block content %}
<h1>Add a new post:</h1>
<form method="POST">
{% csrf_token %}
{{form.as_p}}
<button type="submit">Save New Post</button>
</form>
{% endblock %}
{% extends 'base.html'%}
{% block title %}
{{ object.title }}
{% endblock %}
{% block content %}
<h1>{{ object.title }}</h1>
<ul>
<p>by {{ object.author.firstname }} {{ object.author.lastname }}</p><br>
<p>{{ object.pub_datetime|date:"m/d/Y, h:i A" }}</p><br>
<p>{{ object.body }}</p><br>
<p>POST REPLIES: </p><br>
{% for reply in object.replies.all %}
<p>by {{ reply.author.firstname }} {{ reply.author.lastname }}</p>
<p>{{ reply.pub_datetime|date:"m/d/Y, h:i A" }}</p>
<p>{{ reply.body }}</p>
{{% endfor %}}
</ul>
<form action="./edit">
<button type="submit">Edit Post</button>
</form>
{% endblock %}
{% extends 'base.html' %}
{% load static %}
{% block title %} Edit Post {% endblock %}
{% block content %}
<h1>Edit Post:</h1>
<form method="POST">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Save Changes to Post</button>
</form>
{% endblock %}
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