1
{% extends "layout.html" %}
2
{% block body %}
3
<script type="text/javascript">
4
  function deletePost(post_id) {
5
    if(confirm("Do you really want to delete this post?")) {
6
      $.post(
7
        '/posts/delete/',
8
        {'post_id': post_id},
9
        function() {
10
          alert("The post has been deleted!!");
11
          window.location.href = '/';
12
        });
13
    }
14
    return false;
15
  }
16
</script>
17
<ul class="entries">
18
  {% for entry in entries %}
19
    <li>
20
      @<b>{{ entry.who }}</b>
21
      <b>#{{ entry.what }}</b> /{{ entry.where }} {{ entry.how|safe }}
22
      {% if session.logged_in %}
23
      <a class="pull-right" href="#" onclick='deletePost({{entry.id|string|tojson|safe}})'>
24
        <i class="icon-trash"></i>
25
      </a>
26
      {% endif %}
27
    </li>
28
	{% endfor %}
29
</ul>
30
{% endblock %}