index.html 3.24 KB
Newer Older
1
{% extends 'layouts/base.html' %}
2 3

{% block title %}
4
SRCT Bookshare • Homepage
Daniel W Bond's avatar
Daniel W Bond committed
5
{% endblock title %}
6

7 8
{% block content %}

9 10
{% if not user.is_authenticated %}

11
<div class="container">
12
  <div class="row">
13 14 15
    <div class="col-md-12 license">
      <div class="jumbotron jumboindex">
        <h1 class="text-center"><strong>SRCT</strong>&#8203;BOOKSHARE</h1>
16
        <h3 class="text-center">A place for Mason students to exchange textbooks.</h3>
17 18
      </div>
      <a href="https://creativecommons.org/licenses/by/4.0/" target="_blank"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/80x15.png" title="'Mason Statue Desktop' by Daniel Bond is licensed under a Creative Commons Attribution 4.0 International License."/></a>
19 20 21
    </div>
  </div>
</div>
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44

<hr />

<div class="row">
  <div class="col-sm-3 text-center">
    <h3><i class="fa fa-key fa-lg"></i></h3>
    <h4>Log in with your Mason credentials</h4>
  </div>
  <div class="col-sm-3 text-center">
    <h3><i class="fa fa-gift fa-lg"></i></h3>
    <h4>Exchange your used textbooks with Mason students</h4>
  </div>
  <div class="col-sm-3 text-center">
    <h3><i class="fa fa-book fa-lg"></i></h3>
    <h4>Search for textbooks by course and more</h4>
  </div>
  <div class="col-sm-3 text-center">
    <h3><i class="fa fa-eye fa-lg"></i></h3>
    <h4>Get updates when textbooks you want are posted</h4>
  </div>
</div>

{% else %}
45 46 47

{% load trades_extras %}

48 49
<h2>Welcome, {{ request.user.student.get_first_name_or_uname }}!</h2>

50 51 52 53
<legend class="text-center">
  <i class="fa fa-eye"></i> <strong>Your Lookouts</strong>
  <small>(<a href="{% url 'create_lookout' %}">Create</a>)</small>
</legend>
54

55 56
  {% if lookouts %}

57
    {% for lookout in lookouts %}
58 59 60
      <legend><i class="fa fa-book"></i>
        <a href="{{ lookout.get_absolute_url }}">{{ lookout.isbn|isbn_name|title }}</a>
      </legend>
61 62
      <div class="row">
        {% for listing in lookout.get_listings %}
63
          {% if not listing.cancelled or listing.exchanged %}
64 65 66
          <div class="col-md-6">
            {% include 'listing_preview_panel.html' %}
          </div>
67 68 69 70
          {% if forloop.counter|divisibleby:2 %}
          </div>
          <div class="row">
          {% endif %}
71
          {% endif %}
72 73
        {% endfor %}
      </div>
74 75 76 77
    {% endfor %}

  {% else %}
    <div class="row">
78
      <div class="col-md-8 col-md-offset-2">
79 80
        <div class="panel panel-warning">
          <div class="panel-body text-center">
Daniel W Bond's avatar
Daniel W Bond committed
81 82
            <div class="row">
              <div class="col-md-10 col-md-offset-1">
83 84 85
                <p>Lookouts are automatic searches for books you designate.</p>
                <p><a href="{% url 'create_lookout' %}">Save an ISBN</a>,
                and we'll immediately let you know when a book you want is listed.</p>
Daniel W Bond's avatar
Daniel W Bond committed
86 87
              </div>
            </div>
88 89 90 91 92
          </div>
        </div>
      </div>
    </div>
  {% endif %}
93

94
{% endif %}
95

96
<hr />
97 98 99 100

<div class="row">

  <div class="col-sm-5 col-sm-offset-1">
Daniel W Bond's avatar
Daniel W Bond committed
101
    <a href="{% url 'create_listing' %}" class="btn btn-primary btn-lg btn-block">I <em>have</em> a book</a>
102 103 104
  </div>

  <div class="col-sm-5">
Daniel W Bond's avatar
Daniel W Bond committed
105
    <a href="{% url 'list_listings' %}" class="btn btn-primary btn-lg btn-block">I <em>need</em> a book</a>
106 107 108 109
  </div>

</div>

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