{% extends 'layouts/base.html' %} {% block title %} SRCT Bookshare • {{ listing.title }} {% endblock title %} {% block social_metadata %} {% if listing.year %} {% if flag_count > 4 %} {% block javascript %} {% endblock javascript %} {% endif %} {% include 'messages.html' %} {% if listing.cancelled %}
This listing has been cancelled.
{% elif listing.exchanged %}
{% if listing.winning_bid.bidder.user == request.user %}
You exchanged this listing {{ listing.date_closed|timesince }} ago. {% if rating %} Edit your rating of this exchange. {% else %} Rate your experience with {{ listing.poster.user.first_name }} here. {% endif %} {% else %}
This listing has been exchanged. {% endif %}
{% elif not listing.active %}
Heads up, this listing is over a month old and we haven't seen the student who posted it around recently either. It may no longer be valid!
{% endif %} {% load trades_extras %}

{{ listing.title }}

{% if listing.exchanged %} Final ${{ listing.final_price }} {% else %} Asking ${{ listing.price }} {% endif %}

by {{ listing.author }} {% if listing.year %} ({{ listing.year|bc }}) {% endif %}

Listed {{ listing.created|date:"M d, 'y P" }} ({{ listing.created|naturaltime }})

ISBN {{ listing.isbn }}

{% if listing.edition %} {{ listing.edition|ordinal }} edition {% endif %}

{% if listing.course_abbr %}

Course {{ listing.course_abbr }}

{% else %} {% endif %}

Posted by {{ listing.poster.user.get_full_name }} {% if request.user == listing.poster.user %} (Me) {% endif %}

Condition {{ listing.condition }}

Access Code {{ listing.access_code }}

{% if request.user == listing.poster.user %} {% else %} {% if can_flag %}
Flag
{% else %}
Remove Flag
{% endif %} {% endif %}
{% if listing.description %}

Description/Comments {{ listing.description }} {% else %} {% endif %}

{% if request.user == listing.poster.user %}

{% if bid_count > 0 %} {% if not listing.exchanged and not listing.cancelled %} Exchange {% elif not listing.cancelled %} Cancel Exchange {% endif %} {% endif %}   {% if not listing.exchanged and not listing.cancelled %} Edit Listing {% endif %}   {% if not listing.cancelled and not listing.exchanged %} Cancel Listing {% elif listing.cancelled and not listing.exchanged %} Reopen Listing {% endif %}

{% else %}

Submit Your Bid

{% if not listing.cancelled and not listing.exchanged %}
{% crispy my_form %}
{% else %}
This listing has been {% if listing.cancelled %} cancelled {% elif listing.exchanged %} exchanged {% endif %} and is no longer accepting bids.
{% endif %}
{% endif %}
{% if bids %}
{% endif %} {% for bid in bids %}

{{ bid.created|naturaltime }}

{% if bid.text %} {{ bid.text }} {% else %} {% endif %}

{% if request.user == bid.bidder.user and not listing.exchanged and not listing.cancelled %}

Edit

{% endif %} {% if bid == listing.winning_bid %}

Winning Bid ${{ bid.price }}

{% else %}

${{ bid.price }}

{% endif %}

{% endfor %} {% if bids %}
{% endif %}
{% endblock content %}