Source

dvd-collection / collection / templates / collection / director_list.html

Full commit
{% extends "base.html" %}
{% load bootstrap %}
{% load cache %}

{% block jquery %}  $('#nav_genre').addClass('active');{% endblock %}

{% block title %}Browse collection by Director{% endblock %}

{% block base_content %}
<h3>Browse collection by Director</h3>
<div class="pagination">
    <ul>
        {% if page_obj.has_previous %}
            <li><a href="?page={{ page_obj.previous_page_number }}">&laquo;</a></li>
        {% endif %}
        {% for tick in page_obj.paginator.num_pages|make_range %}
            <li><a href="?page={{ tick }}">{{tick}}</a></li>
        {% endfor %}
        {% if page_obj.has_next %}
            <li><a href="?page={{ page_obj.next_page_number }}">&raquo;</a></li>
        {% endif %}
    </ul>
</div>
<table class="table table-condensed table-striped">
  <thead><tr><th>Director</th><th>Titles by Director</th><th>Highest Rated(9+ stars)</th></tr></thead>
  <tbody>
    {% cache 3600 director_list page_obj.number %}
    {% for director in director_list %}
    <tr><td>{{director|link}}</td><td>{{director.movie_set.count}}</td><td>{{director.movie_set.highest_rated|link}}</td></tr>
    {% endfor %}
    {% endcache %}
  </tbody>
</table>
<div class="pagination">
    <ul>
        {% if page_obj.has_previous %}
            <li><a href="?page={{ page_obj.previous_page_number }}">&laquo;</a></li>
        {% endif %}
        {% for tick in page_obj.paginator.num_pages|make_range %}
            <li><a href="?page={{ tick }}">{{tick}}</a></li>
        {% endfor %}
        {% if page_obj.has_next %}
            <li><a href="?page={{ page_obj.next_page_number }}">&raquo;</a></li>
        {% endif %}
    </ul>
</div>
{% endblock %}