list_listings.html 2.13 KB
Newer Older
Daniel W Bond's avatar
Daniel W Bond committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{% extends 'layouts/base.html' %}

{% block title %}
SRCT Bookshare • Latest Listings
{% endblock %}

{% block content %}

<div class="page-header" id="banner">
  <div class="row">
    <div class="col-lg-12">
      <h1 class="text-center"><strong>SRCT</strong>&#8203;BOOKSHARE</h1>
      <p class="lead text-center"><strong>Latest Listings</strong></p>
    </div>
  </div>
</div>

{% if listings %}

  <div class="row">
    <div class="col-md-10 col-md-offset-1 text-center">
22
      <h4><p><em>Want to <strong><a href="/search">search</a></strong> for something specific?</em></p></h4>
Daniel W Bond's avatar
Daniel W Bond committed
23
24
25
    </div>
  </div>

26
  <legend></legend>
Daniel W Bond's avatar
Daniel W Bond committed
27

28
  <div class="row">
Daniel W Bond's avatar
Daniel W Bond committed
29
    {% for listing in listings %}
30
      <div class="col-md-6">
Daniel W Bond's avatar
Daniel W Bond committed
31
32
        {% include 'listing_preview_panel.html' %}
      </div>
33
34
35
36
      {% if forloop.counter|divisibleby:2 %}
     </div>
     <div class="row">
      {% endif %}
Daniel W Bond's avatar
Daniel W Bond committed
37
38
39
40
41
42
43
44
45
46
    {% endfor %}
  </div>

  <div class="row">
    <div class="col-lg-4 col-lg-offset-4">
      <ul class="pager">

        {% if listings.has_previous %}
          <li class="previous">
            <a href="?page={{ listings.previous_page_number }}">
47
              <h4>&larr; Newer</h4>
Daniel W Bond's avatar
Daniel W Bond committed
48
49
50
51
52
            </a>
          </li>
        {% else %}
          <li class="previous disabled">
            <a>
53
              <h4>&larr; Newer</h4>
Daniel W Bond's avatar
Daniel W Bond committed
54
55
56
57
58
59
60
            </a>
          </li>
        {% endif %}

        {% if listings.has_next %}
          <li class="next">
            <a href="?page={{ listings.next_page_number }}">
61
              <h4>Older &rarr;</h4>
Daniel W Bond's avatar
Daniel W Bond committed
62
63
64
65
66
            </a>
          </li>
        {% else %}
          <li class="next disabled">
            <a>
67
              <h4>Older &rarr;</h4>
Daniel W Bond's avatar
Daniel W Bond committed
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
            </a>
          </li>
        {% endif %}

      </ul>

    </div>
  </div>

{% else %}

  <div class="row">
    <div class="col-md-10 col-md-offset-1 text-center">
      <div class="panel panel-warning">
        <div class="panel-body">
          <h3>There aren't any books in the database!</h3>
          <p>
85
            Looks like you'll be the first to <a href="{% url 'create_listing' %}">create one</a>!
Daniel W Bond's avatar
Daniel W Bond committed
86
87
88
89
90
91
92
93
94
          </p>
        </div>
      </div>
    </div>
  </div>

{% endif %}

{% endblock %}