{% load admin_tags %}

<ul class="page_thumbnails">
    {% for page in pages %}
        <li class="page_thumbnail {% if forloop.first %} first {% endif %} {% if forloop.last %} last {% endif %}">
          {% thumb_arrow_up %}
          <div class="document page" 
               data-page_num="{{page.number}}"
               data-img_type="thumbnail"
               data-page_id="{{page.id}}"
               data-doc_id="{{document.pk}}"
               data-page_order="{{page.number}}"
               data-step="4">
               <input type="checkbox" name="_selected_action" value="{{ page.number }}" />
            </div>
          {% thumb_arrow_down %}
          <div class="page_number">{{ page.number }}</div>
        </li>
    {% endfor %}
</ul> 