Commit 2fb966da authored by Jan Enzo Salvador's avatar Jan Enzo Salvador

Created html files for the main page of forum, add page, edit page and details...

Created html files for the main page of forum, add page, edit page and details page of a forum post.
parent 8923b212
{% extends 'base.html' %}
{% load static %}
{% block title %} Widget's Forum {% endblock %}
{% block content %}
<h1>Welcome to Widget's Forum!</h1>
<body>
Forum posts:
{% for post in forumposts %}
<li>
<a href="{{ post.get_absolute_url }}">
{{ post.title }} by {{ post.author.last_name }}, {{ post.author.first_name }}
</a>
</li>
{% endfor %}
</body> <br>
<form action="forumposts/add">
<button type="submit">New Post</button>
</form> <br>
<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 %}
{{ form.non_field_errors }}
{% for field in form %}
{% if field.errors %}
<p> {{ field.label }} has the following errors:</p>
<ul>
{% for error in field.errors %}
<li>{{ error }}</li>
{% endfor %}
</ul>
{% endif %}
{% endfor %}
<p> Add a new post: </p>
<form method = "post">
{% csrf_token %}
{% for field in form %}
{{field.label}}: {{field}}<br><br>
{% endfor %}
&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value="Save New Post">
</form>
{% endblock %}
{% extends 'base.html'%}
{% block title %}
{{ object.title }}
{% endblock %}
{% block content %}
<h1>{{ object.title }}</h1>
<body>
by {{ object.author.first_name }} {{ object.author.last_name }}<br>
{{ object.pub_datetime|date:"m/d/Y, h:i A" }}<br>
{{ object.body }}<br><br>
POST REPLIES: <br>
{% for reply in replies %}
{% if reply.forum_post == object %}
by {{ reply.author.first_name }} {{ reply.author.last_name }}<br>
{{ reply.pub_datetime|date:"m/d/Y, h:i A" }}<br>
{{ reply.body }}<br><br>
{% endif %}
{% endfor %}
</body>
<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