{% extends "base.html" %}
{% load crispy_forms_tags %}


{% block head_title %}
{{ instance.title }} | {{ block.super }}
{% endblock head_title %}


 {% block post_detail_link %}
  <li><a href='{{ instance.get_absolute_url }}'>{{ instance.title }}</a></li>
  {% endblock %}



{% block content %}
<div class='col-sm-6 col-sm-offset-3'>
    {% if instance.image %}
    <img src='{{ instance.image.url }}' class='img-responsive' />
    {% endif %}
<h1>{{ title }} <small>{% if instance.draft %}<span style='color:red;'>Draft</span> {% endif %}{{ instance.publish }}</small></h1>

<!-- {% if instance.read_time|time:"i" <= "01" %} < 1 minute {% else %}{{ instance.read_time|time:"i" }} minutes {% endif %} -->


<p>Read time: {% if instance.read_time <= 1 %} < 1 Minute {% else %}{{ instance.read_time }} minutes {% endif %}</p>
<p><a class='like-btn' data-href='{{ instance.get_api_like_url }}' data-likes='{{ instance.likes.count }}' href='{{ instance.get_like_url }}'>{{ instance.likes.count }} Like</a></p>
{% if instance.user.get_full_name %}
<p>Author: {{ instance.user.get_full_name }}</p>
{% endif %}

<p><div class="fb-like" data-href="{{ request.build_absolute_uri }}" data-layout="button_count" data-action="like" data-show-faces="true" data-share="true"></div>
<hr/>
</p>
<div class='row'>
<div class='col-sm-12 '>

    <div class='post-detail-item'>
        {{ instance.content|safe }}
      </div>

    <hr/>
    <br/>





</div>
</div>
</div>


{% endblock content %}