{% extends "base.html" %}

{% block title %}Blog entries{% endblock %}

{% block content_title %}{% if search %}Search "{{ search }}"{% else %}Blog entries{% endif %}{% endblock %}

{% block content %}
  {% for entry in object_list %}
    {% if search %}
      {% set entry = entry.entry %}
    {% endif %}
    <h3>
      <a href="{% if entry.published %}{{ url_for('detail', slug=entry.slug) }}{% else %}{{ url_for('edit', slug=entry.slug) }}{% endif %}">
        {{ entry.title }}
      </a>
    </h3>
    <p>Created {{ entry.timestamp.strftime('%m/%d/%Y at %G:%I%p') }}</p>
  {% else %}
    <p>No entries have been created yet.</p>
  {% endfor %}
  {% include "includes/pagination.html" %}
{% endblock %}
