Commit 8b52b94a authored by Daniel W Bond's avatar Daniel W Bond
Browse files

broke main templates dir into apps

parent cfefa7cf
{% extends 'layouts/base.html' %}
{% load website_extras %}
{% block title %}
GMU Bookshare • Seller Profile
{% endblock %}
{% block content %}
<script>
function insert_target( source, target ){
var element = document.getElementById( source );
element.setAttribute("value", target);
}
</script>
<div class="page-header" id="banner">
<div class="row">
<div class="col-lg-12">
<h1>{{ seller.user.first_name }} {{ seller.user.last_name }}
{% if seller.user = request.user %}
(me)
{% endif %}
<span class="pull-right">
<a href="mailto:{{ seller.user.email }}">{ contact }</a>
</span></h1>
<p class="lead">
{% if seller.rating %}
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star-empty"></span>
<span class="glyphicon glyphicon-star-empty"></span>
{% else %}
No ratings yet.
{% endif %}
</p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
{% if seller == request.user.seller %}
<h3>Listings (<a href="{%url 'create_listing'%}">Create</a>)</h3>
{% else %}
<h3>Listings</h3>
{% endif %}
{% 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 %}
$0
{% 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 %}
{% 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 %}
<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"}}</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' %}
{% endblock %}
{% extends 'layouts/base.html' %}
{% block title %}
GMU 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