{% extends 'base.html' %} {% load static %} {% block custom-tags %} {% endblock %} {% block content %} {% if request.user.is_authenticated and request.user.id == post.user.id %} Delete Post Edit Post {% endif %}

{{ post.user }} | {{ post.created }}

{{ post.body }}


{% if comments.count != 0 %} {% with total=comments.count %}

This post has {{ total }} comment{{ total|pluralize }}

{% endwith %} {% endif %}
{% if request.user.is_authenticated%}
{% csrf_token %} {{ form.as_p}}
{% else %}

Only logged in user can send comments

{% endif %}

{% for comment in comments %}
{{ comment.user }}     

{{ comment.body }}

{% if request.user.is_authenticated %}
{% else %}

You have to login to send reply

{% endif %} {% for reply in comment.rcomment.all %}

{{ reply.user }}
{{ reply.body }}

{% endfor %}

{% empty %}

There is no comment

{% endfor %} {% endblock %}