{% extends 'base.html' %}
{% load markup %}
{% load comments %}

{% block content %}
    {% if enable_promoted %}
        {% if promoted_posts %}
            <h3 class="section-header">Promoted Posts</h3>
            {% for p in promoted_posts %}
                    <h3><a href="{{p.get_absolute_url}}">{{p.title}}</a>  {% if user.is_authenticated %}<small><a href="{% url admin:blogger_post_change p.id %}">(edit)</a></small>{% endif %}</h3>
                        <p>{{p.created_at}} | 
                            {% if p.tags.count < 1 %}
                                No tags
                            {% endif %}
                            {% for t in p.tags.all %}
                                <a href="{{t.get_absolute_url}}">{{t}}</a>
                                {% if not forloop.last %}
                                , 
                                {% endif%}
                            {%endfor%}
                        </p>
                        <p>{{p.body|truncatechars:300|markdown}}</p>
                        {% if not forloop.last %}
                            <hr>
                        {% endif %}
                {% endfor %}
        {% endif %}
    {% endif %}
	{% if posts %}
	    <h3>{{section_title}}</h3>
	    {% for p in posts %}
	        <h2><a href="{{p.get_absolute_url}}">{{p.title}}</a>  {% if user.is_authenticated %}<small><a href="{% url admin:blogger_post_change p.id %}">(edit)</a></small>{% endif %}</h2>
	        	<p>{{p.body|truncatechars:200|markdown}}</p>

	    {% endfor %}
	{% endif %}
{% endblock %}



