list_listings.html 1.95 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>Want to instead <strong><a href="/search">search</a></strong> for something specific?</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">
29 30 31
    <div class="col-md-10 col-md-offset-1 text-center bottom-padding">
      <small><em>New listings may take a few moments to appear.</em></small>
    </div>
Daniel W Bond's avatar
Daniel W Bond committed
32
    {% for listing in listings %}
33
      <div class="col-md-6">
Daniel W Bond's avatar
Daniel W Bond committed
34 35
        {% include 'listing_preview_panel.html' %}
      </div>
36 37 38 39
      {% if forloop.counter|divisibleby:2 %}
     </div>
     <div class="row">
      {% endif %}
Daniel W Bond's avatar
Daniel W Bond committed
40 41 42
    {% endfor %}
  </div>

Daniel W Bond's avatar
Daniel W Bond committed
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
  {% 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
59 60 61 62 63 64 65

{% else %}

  <div class="row">
    <div class="col-md-10 col-md-offset-1 text-center">
      <div class="panel panel-warning">
        <div class="panel-body">
66
          <h3>There aren't any open listings in the database right now!</h3>
Daniel W Bond's avatar
Daniel W Bond committed
67
          <p>
68
            You can be the first to <a href="{% url 'create_listing' %}">create one</a>.
Daniel W Bond's avatar
Daniel W Bond committed
69 70 71 72 73 74 75 76
          </p>
        </div>
      </div>
    </div>
  </div>

{% endif %}

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