profile.html 4.97 KB
Newer Older
1
{% extends 'layouts/base.html' %}
2
{% comment %} {% load website_extras %} {% endcomment %}
3
4

{% block title %}
5
SRCT Bookshare • {{ student.user.first_name }} {{ student.user.last_name }}
6
7
8
9
{% endblock %}

{% block content %}

10
11
{% load gravatar %}

12
<div class="page-header" id="banner">
13
  <legend>
14
  <div class="row">
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    <div class="col-md-1">
      <img class="img-circle img-responsive" src="{% gravatar_url student.user.email 75 %}">
    </div>
    <div class="col-lg-7 col-md-6">
      <h2><strong>{{ student.user.first_name }} {{ student.user.last_name }}</strong></h2>
    </div>
    <div class="col-lg-2 col-md-3">
      {% if student.rating %}
        <h3><a href="#students-ratings-history">
        <i class="fa fa-star"></i>
        <i class="fa fa-star"></i>
        <i class="fa fa-star"></i>
        <i class="fa fa-star-o"></i>
        <i class="fa fa-star-o"></i>
        </h3></a>
      {% else %}
31
        <!-- <em>{{ student.user.first_name }} has no ratings yet.</em> -->
32
      {% endif %}
33
34
35
    </div>
    <div class="col-md-2">
      <h3><a href="mailto:{{ student.user.email }}"><i class="fa fa-envelope"></i> {{ student.user.username }}</a></h3>
36
37
    </div>
  </div>
38
  </legend>
39
40
</div>

41

42
43
<div class="row">
  <div class="col-md-12">
44
45
    {% if student.user == request.user %}
    <legend><h3>Listings <small>(<a href="{% url 'create_listing' %}">Create</a>)</small></h3></legend>
46
47
48
49
50
    {% else %}
    <h3>Listings</h3>
    {% endif %}

    {% if listings %}
51
52
53
    <div class="table-responsive">
      <table class="table table-bordered table-hover">
        <thead>
54
55
56
57
          <th class="col-md-1 text-center"><h4>ISBN</h4></th>
          <th class="col-md-9 text-center"><h4>Title</h4></th>
          <th class="col-md-1 text-center"><h4>Price</h4></th>
          <th class="col-md-1 text-center"><h4>
58
59
60
61
            {% if student.user == request.user %}
            Action
            {% else %}
            Status
62
            {% endif %}</h4></th>
63
64
65
66
        </thead>
        {% for listing in listings %}
        <tbody>
          <tr>
67
68
69
            <td class="text-center"><h5>{{ listing.isbn }}</h5></td>
            <td class="text-center"><h5><a href="{{ listing.get_absolute_url }}">{{ listing.title }}</h5></a></td>
            <td class="text-center"><h5>
70
71
              {% if listing.sold %}
                ${{ listing.finalPrice }}
72
              {% else %}
73
                ${{ listing.price }}
74
              {% endif %}
75
76
            </h5></td>
            <td class="text-center"><h5>
77
78
              {% if listing.sold %}
                <span class="label label-danger">Sold</span>
79
80
81
                {% if student.user == request.user %}
                  <small>(<a href="{% url 'close_listing' listing.slug %}">Reopen</a>)</small>
                {% endif %}
82
83
84
85
86
              {% elif not listing.active %}
                <span class="label label-default">Closed</span>
              {% else %}
                {% if student.user == request.user %}
                  {% if listing.active %}
87
                    <a href="{% url 'close_listing' listing.slug %}">Mark Sold</a>
88
                  {% else %}
89
                    <a href="{% url 'update_listing' listing.slug %}">Reopen</a>
90
                  {% endif %}
91
                {% else %}
92
                  <span class="label label-success">Active</span>
93
                {% endif %}
94
              {% endif %}
95
            </h5></td>
96
          </tr>
97
98
99
100
        </tbody>
        {% endfor %}
      </table>
      {% if student.user == request.user %}
101
102
        <strong>Total Sales:</strong> {{ sales }} |
        <strong>Total Proceeds:</strong> ${{ proceeds }}
103
104
      {% endif %}
    </div>
105
    {% else %}
106
      {% if student.user == request.user %}
107
108
      You don't
      {% else %}
109
      {{ student.user.first_name }} doesn't
110
111
      {% endif %}
      have any listings posted yet.
112
113
114
      {% if student.user == request.user %}
      Consider listings your textbooks on SRCT Bookshare.
      {% endif %}
115
116
117
118
119
    {% endif %}
  </div>
</div>


120
{% if student.user == request.user %}
121
122
<div class="row">
  <div class="col-md-12">
123
124
125
    <legend><h3>Lookouts <small>(<a href="{% url 'create_lookout' %}">Create</a>)</small></h3></legend>
  </div>
</div>
126
{% endif %}
127

128
{% if lookouts %}
129
<div class="row">
130
131
132
133
134
  <div class="col-md-12">
    <div class="table-responsive">
      <table class="table table-bordered table-hover">
        <thead>
          <th class="col-md-1 text-center"><h4>ISBN</h4></th>
135
          <!-- <th class="col-md-1 text-center"><h4>Title</h4></th> -->
136
137
138
139
140
          <th class="col-md-1 text-center"><h4>Action</h4></th>
        </thead>
        <tbody>
        {% for lookout in lookouts %}
        <tr>
Daniel W Bond's avatar
Daniel W Bond committed
141
          <td class="text-center"><h5><a href="{{ lookout.get_absolute_url }}">{{ lookout.isbn }}</a></h5></td>
142
          <!-- <td class="text-center"><h5>ISBN templatetag filter still unverified</h5></td> -->
143
144
145
146
147
          <td class="text-center"><h5><a href="{% url 'delete_lookout' lookout.slug %}">Delete</a></h5></td>
        {% endfor %}
        </tbody>
      </table>
    </div>
148
149
150
151
152
  </div>
</div>
{% endif %}

{% endblock %}