<article>
  <div class="voting-buttons fill">
    <!-- Voting -->
    {% if user.is_authenticated %}    
    <a class="btn btn-default upvote
	      {% if post in user.upvoted.all %}upvoted{% endif %}"
       id="post-upvote-{{post.id}}">
      <i class="fa fa-chevron-up"></i>
      <div class="score">
	{{post.score}}
      </div>
    </a>
    {% else %}
    <!-- If not authenticated - open login popup. -->
    <a class="btn btn-default"
       data-toggle="modal" data-target="#login">
      <i class="fa fa-chevron-up"></i>
      <div class="score">
	{{post.score}}
      </div>
    </a>    
    {% endif %}    

    <br/>
    <!-- Comments -->
    <a class="btn btn-default comment" href="{{post.get_absolute_url}}">      
      <i class="fi-comment"></i>
      {{post.comments.count}}
    </a>
  </div>

  
  <!-- Post title -->
  <div class="post-header vertical-center">    
    <h2><a href="{{post.url}}">{{post.title}}</a></h2>
    {% if request.user == post.author %}
    <a class="post-edit" href="{{post.get_absolute_url}}edit">
      <i class="fa fa-pencil"></i>      
    </a>
    {% endif %}    
    
  </div>

  <!-- Post body -->
  <div class="post-body">  
    <p>
      {{post.body}} <!-- |truncatechars:200 -->
    </p>
  </div>

  <div class="clearfix"></div>

  <!-- Post tags -->
  <div class="post-footer">
    <span class="label label-default">{{post.category.title}}</span>
    {% for tag in post.tags.all %}
    <span class="label label-default"><a href="/{{tag.slug}}-tutorials/">{{tag.title}}</a></span>
    {% endfor %}
    <span class="label label-default">{{post.post_type | title}}</span>
    <span class="label label-default">{% if post.post_level == "all" %}Level: All{% else %}{{post.post_level | title}}{% endif %}</span> 
    <span class="label label-default">{{post.post_price | title }}</span>
    <!-- <span class="label label-default">@rayalez</span> -->
    <span class="right">@{{post.author.username}}</span>
    
  </div>
</article>

