{% extends 'base.html' %}
{% load static %}

    {% block styles %}
        <link rel="stylesheet" type="text/css" href="{% static 'forum/style.css' %}">   
    {% endblock %}

{% block title %}{{post.post_title}}{% endblock %}
{% block content %}
    <h1>{{post.post_title}}</h1>
    <h2>by {{post.author.first_name}} {{post.author.last_name}}, {{post.pub_date|date:"d/m/Y"}}</h2>
    <div> 
        <p>
            {{post.post_body}}<br><br>
            {% if post.post_image %}
                <p style="text-align:center"><img src = "{{ post.post_image.url }}"></p><br>
            {% endif %}

            {% if replies %}
                Replies:<br>
                <ul>
                    {% for reply in replies %} 
                    <li>
                        <h4>by {{reply.author.first_name}} {{reply.author.last_name}}, {{reply.pub_date|date:"d/m/Y"}}:</h4>
                        <p> {{reply.reply_body}} </p>
                    </li>
                    {% endfor %}
                </ul>
            {% endif %}
            
        </p>
    </div>
{% endblock  %}