{% extends 'blog/base.html' %}
{% load blog %}

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

{% block sidebar %}
  {% if user.is_admin %}
  <div class="blog">
    <h3>Actions</h3>
    <p>
      <b>{% translate "Show" %}</b>
      <a href="?show=published">{% translate "Published" %}</a> or
      <a href="?show=unpublished">{% translate "Not published" %}</a>
    </p>
    <p class="last">
      <a href="{% url blog.create_entry %}">{% translate "New entry" %}</a>
    </p>
  </div>
  {% endif %}

  <div class="blog entries">
    <h3>{% translate "Latest entries" %}</h3>
    {% get_recent_entries as recent_entries %}
    {% for entry in recent_entries %}
      <p {% if forloop.last %}class="last"{% endif %}><a href="{% url blog.entry_details entry=entry %}">{{ entry.title }}</a></p>
    {% empty %}
      <p class="last">{% translate "No entries" %}</p>
    {% endfor %}
  </div>
{% endblock %}

{% block content %}
  {% include "blog/block/entries_list.html" %}
{% endblock %}