Commit 401a70f6 authored by Andre Dalwin C. Tan's avatar Andre Dalwin C. Tan

Added forumpost-edit.html and forumpost-add.html

parent 89800a4e
...@@ -2,9 +2,10 @@ ...@@ -2,9 +2,10 @@
{% load static %} {% load static %}
{% block title %} Widget's Forum {% endblock %} {% block title %} Widget's Forum {% endblock %}
{% block content %} {% block content %}
<h1>Welcome to Widget's Forum!</h1> <h1>Welcome to Widget's Forum!</h1>
<h2>Forumposts</h2> <h2>Forum posts:</h2>
<ul> <ul>
{% for post in forumpost %} {% for post in forumpost %}
<li><a href="{{ post.get_absolute_url }}">{{ post.title }} by {{ post.author.first_name }} {{ post.author.last_name }}</a></li> <li><a href="{{ post.get_absolute_url }}">{{ post.title }} by {{ post.author.first_name }} {{ post.author.last_name }}</a></li>
...@@ -19,5 +20,4 @@ ...@@ -19,5 +20,4 @@
<a href="../announcements/">Announcements</a> <br> <a href="../announcements/">Announcements</a> <br>
<a href="../assignments/">Assignments</a> <br> <a href="../assignments/">Assignments</a> <br>
<a href="../calendar/">Calendar</a> <br> <a href="../calendar/">Calendar</a> <br>
{% endblock %} {% endblock %}
{% extends 'base.html' %}
{% load static %}
{% block title %} Add Post {% endblock %}
{% block content %}
<h1> Add a new post: </h1>
<form method="POST">
{% csrf_token %}
{% for field in form%}
<b>{{ field.label }}:</b> {{ field }} <br>
<br>
{% endfor %}
<button type="submit">Save New Post</button>
</form>
{% endblock %}
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
{% block title %} {{ object.title }} {% endblock %} {% block title %} {{ object.title }} {% endblock %}
{% block content %} {% block content %}
<h1> {{ object.title }} </h1> <h1> {{ object.title }} </h1>
<h2> {{ object.author.first_name }} {{ object.author.last_name }}</h2> <h2> {{ object.author.first_name }} {{ object.author.last_name }}</h2>
<h3> {{ object.pub_datetime|date:"m/d/Y, h:i A" }} </h3> <h3> {{ object.pub_datetime|date:"m/d/Y, h:i A" }} </h3>
<p> {{ object.body }} </p> <br> <p> {{ object.body }} </p> <br>
......
{% extends 'base.html' %}
{% load static %}
{% block title %} Edit Post {% endblock %}
{% block content %}
<h1> Edit Post: </h1>
<form method="POST">
{% csrf_token %}
{% for field in form%}
<b>{{ field.label }}:</b> {{ field }} <br><br>
{% endfor %}
<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