list_listings.html 1.79 KB
Newer Older
Daniel W Bond's avatar
Daniel W Bond committed
1
2
3
4
{% extends 'layouts/base.html' %}

{% block title %}
SRCT Bookshare • Latest Listings
Daniel W Bond's avatar
Daniel W Bond committed
5
{% endblock title %}
Daniel W Bond's avatar
Daniel W Bond committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

{% 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
    {% endfor %}
  </div>

Daniel W Bond's avatar
Daniel W Bond committed
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
  {% if is_paginated %}
  <nav>
    <ul class="pager">
      {% if page_obj.has_next %}
        <li class="next">
          <a href="/share/all/?page={{ page_obj.next_page_number }}"><strong>next &rarr;</strong></a>
        </li>
      {% endif %}
      {% if page_obj.has_previous %}
        <li class="previous">
          <a href="/share/all/?page={{ page_obj.previous_page_number }}"><strong>&larr; previous</strong></a>
        </li>
      {% endif %}
    </ul>
  </nav>
  {% endif %}
Daniel W Bond's avatar
Daniel W Bond committed
56
57
58
59
60
61
62
63
64

{% 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>
65
            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
66
67
68
69
70
71
72
73
          </p>
        </div>
      </div>
    </div>
  </div>

{% endif %}

Daniel W Bond's avatar
Daniel W Bond committed
74
{% endblock content %}