{% extends "blog/base.html" %}

{% block title %}{{ post.title }}{% endblock %}

{% block content %}

  <h1>{{ post.title }}</h1>
  <p class="date">
    Opublikowany {{ post.publish }} przez {{ post.author }}
  </p>
  {{ post.body|linebreaks }}
  <p>
    <a href="{% url "blog:post_share" post.id %}">
      Udostępnij ten post
    </a>
  </p>
  {% with comments.count as total_comments %}
    <h2>
      {{ total_comments }} komentarzy
    </h2>
  {% endwith %}
  {% for comment in comments %}
    <div class="comment">
      <p class="info">
        Komentarz {{ forloop.counter }} dodany przez {{ comment.name }}
        {{ comment.created }}
      </p>
      {{ comment.body|linebreaks }}
    </div>
  {% empty %}
    <p>Nie ma jeszcze żadnych komentarzy.</p>
  {% endfor %}
  {% include "blog/post/includes/comment_form.html" %}
{% endblock %}