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


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

124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<div class="row">
  <div class="table-responsive">
    <table class="table table-bordered table-hover">
      <thead>
        <th class="col-md-1 text-center">ISBN</th>
        <th class="col-md-10">Title</th>
        <th class="col-md-1">Action</th>
      </thead>
      {% for lookout in lookouts %}
      <tr>
        <td class="text-center">{{ lookout.isbn }}</td>
        <td class="text-center">A Title</td>
        <td class="text-center"><a href="#">Delete</a></td>
      {% endfor %}
    </table>
139
140
141
142
143
  </div>
</div>
{% endif %}

{% endblock %}