{% extends "layout.html" %}
{% block body %}
  {% if session.logged_in %}
    <form action="{{ url_for('add_entry') }}" method=post class=add-entry>
        {{ form.hidden_tag() }}
      <dl>
          <dt>{{ form.title.label }}:
          <dd>{{ form.title }}
          <dt>{{ form.text.label }}:
        <dd>{{ form.text(rows=5, cols=40) }}
        <dd>{{ form.submit }}
      </dl>
    </form>
  {% endif %}
  <ul class=entries>
  {% for entry in entries %}
    <li><h2>{{ entry.title }}</h2>{{ entry.text|safe }}
  {% else %}
    <li><em>Unbelievable.  No entries here so far</em>
  {% endfor %}
  </ul>
{% endblock %}
