Commit 33311a93 authored by Daniel W Bond's avatar Daniel W Bond
Browse files

profile now has star ratings

parent c89b74a2
{% extends 'layouts/base.html' %}
{% comment %} {% load website_extras %} {% endcomment %}
{% block title %}
SRCT Bookshare • {{ student.user.first_name }} {{ student.user.last_name }}
......@@ -17,25 +16,27 @@ SRCT Bookshare • {{ student.user.first_name }} {{ student.user.last_name }}
<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">
<div class="col-md-6">
<h2><strong>{{ student.user.first_name }} {{ student.user.last_name }}</strong></h2>
</div>
<div class="col-lg-2 col-md-3">
{% comment %}
{% 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>
<div class="col-md-3 text-right">
{% if avg_stars %}
<h3><a href="{% url 'ratings' student.slug %}">
{% for star in avg_stars|full_stars %}
<i class="fa fa-star"></i>
{% endfor %}
{% if avg_stars|half_stars %}
<i class="fa fa-star-half-o"></i>
{% endif %}
{% for star in avg_stars|empty_stars %}
<i class="fa fa-star-o"></i>
{% endfor %}
</h3></a>
{% else %}
<em>{{ student.user.first_name }} has no ratings yet.</em>
<small>{{ student.user.first_name }} has no ratings yet.</small>
{% endif %}
{% endcomment %}
</div>
<div class="col-md-2">
<div class="col-md-2 text-right">
<h3><a href="mailto:{{ student.user.email }}"><i class="fa fa-envelope"></i> {{ student.user.username }}</a></h3>
</div>
</div>
......@@ -68,7 +69,7 @@ SRCT Bookshare &bull; {{ student.user.first_name }} {{ student.user.last_name }}
<tr>
{% endif %}
<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><a href="{{ listing.get_absolute_url }}">{{ listing.title|title }}</h5></a></td>
<td class="text-center"><h5>
{% if listing.sold %}
${{ listing.final_price }}
......
{% extends 'layouts/base.html' %}
{% comment %} {% load website_extras %} {% endcomment %}
{% block title %}
SRCT Bookshare &bull; {{ student.user.first_name }} {{ student.user.last_name }}
{% endblock %}
{% block content %}
{% load gravatar %}
<div class="page-header" id="banner">
<legend>
<div class="row">
<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>
{% endif %}
</div>
<div class="col-md-2">
<h3><a href="mailto:{{ student.user.email }}"><i class="fa fa-envelope"></i> {{ student.user.username }}</a></h3>
</div>
</div>
</legend>
</div>
<div class="row">
<div class="col-md-12">
{% if seller == request.user.seller %}
<h3>Listings <small>(<a href="{% url 'create_listing' %}">Create</a>)</small></h3>
{% else %}
<h3>Listings</h3>
{% endif %}
</div>
</div>
{% comment %}
{{ listings }}
{% if listings %}
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<th class="col-md-1 text-center">ISBN</th>
<th class="col-md-9">Title</th>
<th class="col-md-1 text-center">Price</th>
<th class="col-md-1 text-center">
{% if seller.user = request.user %}
Action
{% else %}
Status
{% endif %}
</th>
</thead>
{% for listing in listings %}
<tr>
<td class="text-center">{{ listing.isbn }}</td>
<td>
{% if listing.active %}
<a href="{{ listing.get_absolute_url }}">{{ listing.title }}</a>
{% else %}
{{ listing.title }}
{% endif %}
</td>
<td class="text-center">
{% if listing.sold %}
${{ listing.finalPrice }}
{% elif not listing.active %}
?
{% else %}
${{ listing.price }}
{% endif %}
</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 seller.user = request.user %}
<a href="#" onclick="insert_target('{{close_form.book_id.id_for_label}}', '{{ listing.pk }}');"
data-toggle="modal" data-target="#CloseConfirm">Close</a> /
<a href="#" onclick="insert_target('{{FinalPrice_form.book_id.id_for_label}}', '{{ listing.pk }}');"
data-toggle="modal" data-target="#FinalPrice">Sold</a>
{% else %}
<span class="label label-success">Unsold</span>
{% endif %}
{% endif %}
</td>
</tr>
{% endfor %}
{% endif %}
{% if seller.user = request.user %}
<tr>
<td class="text-center">-</td>
<td class="text-right"><strong>Total Proceeds:</strong></td>
<td class="text-center">${{ total_sold }}</td>
<td class="text-center">-</td>
</tr>
{% endif %}
</table>
</div>
{% else %}
{% if seller.user = request.user %}
You don't
{% else %}
{{ seller.user.first_name }} {{ seller.user.last_name }} doesn't
{% endif %}
have any listings posted yet.
{% endif %}
</div>
</div>
{% if seller.user = request.user %}
{% endcomment %}
<hr/>
<div class="row">
<div class="col-md-12">
<h3>Your Lookouts (<a data-toggle="modal" data-target="#CreateLookout"
href="#">Create</a>)</h3>
{% if lookouts %}
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<th class="col-md-1 text-center">ISBN</th>
<th class="col-md-10">Title</th>
<th class="col-md-1 text-center">Action</th>
</thead>
{% for lookout in lookouts %}
<tr>
<td class="text-center">{{lookout.isbn}}</td>
<td><!-- lookout.isbn|get_isbn_data:"title" --> {{ lookout.isbn }}</td>
<td class="text-center">
<a href="#" onclick="insert_target('{{DeleteLookout_form.lookout_id.id_for_label}}', '{{ lookout.pk }}');"
data-toggle="modal" data-target="#DeleteLookout">Delete</a>
</td>
</tr>
{% endfor %}
</table>
</div>
{% else %}
You don't have any lookouts set yet.
{% endif %}
</div>
</div>
{% endif %}
<!-- Final Price Modal -->
<div class="modal fade" id="FinalPrice" tabindex="-1" role="dialog"
aria-labelledby="FinalPriceLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<form class="form-horizontal" id="FinalPriceForm" method="post"
action="" role="form">
{%csrf_token%}
{{FinalPrice_form.book_id}}
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">&times;</button>
<h4 class="modal-title" id="FinalPriceLabel">Final Selling Price</h4>
</div>
<div class="modal-body">
<div class="form-group{%if FinalPrice_form.final_price.errors%} has-error{%endif%}">
<label class="col-lg-3 control-label" for="{{FinalPrice_form.final_price.id_for_label}}">
{{FinalPrice_form.final_price.label}}
</label>
<div class="col-lg-9">
<div class="input-group">
<span class="input-group-addon"> $ </span>
{{FinalPrice_form.final_price}}
</div>
</div>
<span class="help-block col-lg-9 col-lg-offset-3">
Enter the final price you sold your book for (optional).
</span>
</div>
</div>
<div class="modal-footer">
<a class="btn btn-default btn-sm" data-dismiss="modal">Close</a>
<input type="submit" class="btn btn-primary btn-sm"
value="Mark as Sold" name="sold" />
</div>
</form>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- Close Confirm Modal -->
<div class="modal fade" id="CloseConfirm" tabindex="-1" role="dialog"
aria-labelledby="CloseConfirmLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<form class="form-horizontal" id="CloseConfirmForm" method="post"
action="" role="form">
{%csrf_token%}
{{ close_form.book_id }}
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">&times;</button>
<h4 class="modal-title" id="CloseConfirmLabel">Confirm Listing Closure</h4>
</div>
<div class="modal-body text-center">
Are you sure? This action cannot be undone!
</div>
<div class="modal-footer">
<button class="btn btn-default btn-sm" data-dismiss="modal">
Cancel
</button>
<input type="submit" class="btn btn-primary btn-sm"
value="Close Listing" name="closed" />
</div>
</form>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- Delete Lookout Modal -->
<div class="modal fade" id="DeleteLookout" tabindex="-1" role="dialog"
aria-labelledby="DeleteLookoutLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<form class="form-horizontal" id="DeleteLookoutForm" method="post"
action="" role="form">
{%csrf_token%}
{{ DeleteLookout_form.lookout_id }}
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">&times;</button>
<h4 class="modal-title" id="DeleteLookoutLabel">Confirm Lookout Deletion</h4>
</div>
<div class="modal-body text-center">
Are you sure? This action cannot be undone!
</div>
<div class="modal-footer">
<button class="btn btn-default btn-sm" data-dismiss="modal">
Cancel
</button>
<input type="submit" class="btn btn-primary btn-sm"
value="Delete Lookout" name="lookout" />
</div>
</form>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
{% include 'create_lookout_modal.html' %}
{% endcomment %}
{% endblock %}
{% extends 'layouts/base.html' %}
{% block title %}
SRCT Bookshare &bull; {{ seller.name }}'s Listings
{% endblock %}
{% block content %}
<div class="container">
<h1>{{ seller.name }}'s Listings</h1>
{% if listings %}
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<th class="col-md-10">Title</th>
<th class="col-md-1 text-center">Status</th>
</thead>
{% for listing in listings %}
<tr>
<td><a href="{{ listing.get_absolute_url }}">{{ listing.title }}</a></td>
{% if listing.active %}
<td class="text-center"><span class="label label-success">Active</span></td>
{% else %}
<td class="text-center"><span class="label">Inactive</span></td>
{% endif %}
</tr>
{% endfor %}
</table>
</div>
{% else %}
{{ seller.name }} doesn't have any listings posted yet. Have you
considered listing your textbooks on Bookshare?
{% endif %}
</div>
{% endblock %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment