<div class="post{%if not inlist %} single-post{% endif %}{% if not post.published %} unpublished-post{% endif %}">
<div class="header">
{% if inlist %}
<a href="{{context}}{{post|post-url}}"><h2>{{post.title}}</h2></a>
{% else %}
<h2>{{post.title}}</h2>
{% endif %}
<div>
<div class="pull-left">
<span class="muted">Posted by {{post.user}}, <time title="{{post.created_at|to_fulltime}}">{{post.created_at|to_relative}}</time></span>
</div>
{% if user-id %}
<div class="pull-right">
<a class="btn btn-mini" href="{{context}}/editpost/{{post._id}}">Edit</a>
<a class="btn btn-mini btn-danger" data-deletepostid="{{post._id}}" href="#">Delete</a>
{% if post.published %}
<a class="btn btn-mini btn-warning" href="{{context}}/unpublish/{{post._id}}">Unpublish</a>
{% if not post.published %}
<a class="btn btn-mini btn-success" data-publishpostid="{{post._id}}" href="#">Publish</a>
<div class="clearfix"></div>
<div class="content">
{{post.body|md-to-html|safe}}
<div class="footer">
<small>{% for tag in post.tags %}<span class="label"><a href="{{context}}/tag/{{tag}}">{{tag}}</a></span> {% endfor %}</small>
<a href="{{context}}{{post|post-url}}#comments">Comments</a>