{% extends "template.html" %}
{% block content %}
  
  <div class="row">
    <div class="span7">
      <h2>{{class_name}}</h2>
    </div>
    <div class="span5">
      {% if sortable %}
      <div class="btn-group pull-right">
        <a href="#" class="btn"><i class="icon-filter"></i>Order</a>
        <a href="#" data-toggle="dropdown" class="btn dropdown-toggle"><span class="caret"></span></a>
        <ul class="dropdown-menu">
          {% for field in order_fields %}
            <li>
              <a href="?order={{field}}">{{field}}</a>
            </li>
          {% endfor%}
          <li class="divider"></li>
          <li><a href="?">No order</a></li>
        </ul>
      </div>
      {% endif %}
      {% if editable %}
      <a class="btn pull-right" href="/new/{{class_name}}">
        <i class="icon-plus-sign"></i>New Item
      </a>
      {% endif %}
    </div>

  </div>
  {% if index_chart %}
    <div>
      {{index_chart|safe}}
    </div>
  {% endif %}
  {% for item in items%} 
      <a href="/{{class_name}}/{{item.primary_key}}">{{item}}</a><br>
  {% endfor %}
    <ul class="pager">
      <li class="previous">
        <a href="..">← Back</a>
      </li>
    </ul>
{% endblock %}  
