feat: added base template into the forums app and modified detail template

parent 2f2f0e03
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" type="text/css"
href="{% static 'homepage/style.css' %}">
<title>Website</title>
</head>
<body>
{% block content %}
{% endblock %}
</body>
</html>
\ No newline at end of file
<h1>{{ post.post_title }}</h1>
<h3>by {{ post.author.first_name }}, {{ post.pub_date|date:"SHORT_DATE_FORMAT" }}</h3>
<p>{{ post.post_body }}</p>
\ No newline at end of file
{% extends "forum/base.html" %}
{% block content %}
<h1>{{ post.post_title }}</h1>
<h3>by {{ post.author.first_name }} {{ post.author.last_name }}, {{ post.pub_date|date:"SHORT_DATE_FORMAT" }}</h3>
<p>{{ post.post_body }}</p>
{% if reply.associated_post is post %}
<ul>
{% for reply in reply_list %}
<li>{{ reply.reply_body }}</li>
{% endfor %}
</ul>
{% else %}
<p>No replies available for this post.</p>
{% endif %}
{% endblock %}
\ No newline at end of file
{% if posts_list %}
<ul>
{% for post in posts_list %}
<li><a href="{% url 'forum:detail' post.id %}">{{ post.post_title }}</a> by {{ post.author_id.first_name }} {{ post.author_id.last_name}} dated {{ post.pub_date|date:"SHORT_DATE_FORMAT" }}</li>
{% endfor %}
</ul>
{% else %}
<p>No posts are available.</p>
{% endif %}
\ No newline at end of file
{% extends "forum/base.html" %}
{% block content%}
{% if posts_list %}
<ul>
{% 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>
{% endfor %}
</ul>
{% else %}
<p>No posts are available.</p>
{% endif %}
{% 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