list_listings.html 2.03 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
33
34
35
36
37
38
39
40
41
42
        {% include 'listing_preview_panel.html' %}
      </div>
    {% 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 }}">
43
              <h4>&larr; Newer</h4>
Daniel W Bond's avatar
Daniel W Bond committed
44
45
46
47
48
            </a>
          </li>
        {% else %}
          <li class="previous disabled">
            <a>
49
              <h4>&larr; Newer</h4>
Daniel W Bond's avatar
Daniel W Bond committed
50
51
52
53
54
55
56
            </a>
          </li>
        {% endif %}

        {% if listings.has_next %}
          <li class="next">
            <a href="?page={{ listings.next_page_number }}">
57
              <h4>Older &rarr;</h4>
Daniel W Bond's avatar
Daniel W Bond committed
58
59
60
61
62
            </a>
          </li>
        {% else %}
          <li class="next disabled">
            <a>
63
              <h4>Older &rarr;</h4>
Daniel W Bond's avatar
Daniel W Bond committed
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
            </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>
81
            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
82
83
84
85
86
87
88
89
90
          </p>
        </div>
      </div>
    </div>
  </div>

{% endif %}

{% endblock %}