update: modified index template to include the button to add new forum post

parent 5a7a0601
...@@ -9,8 +9,10 @@ ...@@ -9,8 +9,10 @@
{% for post in posts_list %} {% for post in posts_list %}
<li><a href="{% url 'forum:detail' post.id %}">{{ post.post_title }}</a> by {{ post.author.first_name }} {{ post.author.last_name}} dated {{ post.pub_date|date:"SHORT_DATE_FORMAT" }}</li> <li><a href="{% url 'forum:detail' post.id %}">{{ post.post_title }}</a> by {{ post.author.first_name }} {{ post.author.last_name}} dated {{ post.pub_date|date:"SHORT_DATE_FORMAT" }}</li>
{% endfor %} {% endfor %}
<button onclick="location.href = '/posts/add'">New Forum Post</button>
</ul> </ul>
{% else %} {% else %}
<p>No posts are available.</p> <p>No posts are available.</p>
<button onclick="location.href = '/posts/add'">New Forum Post</button>
{% endif %} {% endif %}
{% 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