regluit/frontend/templates/book_panel_addbutton.html

43 lines
1.8 KiB
HTML

{% comment %}
status of book vis-a-vis user's wishlist.
Non-logged-in users should see login to add option.
Logged-in users, book on wishlist:
If they've pledged, that should be displayed, with no removal option.
If they're on their supporter page, they should have the option to remove it (except when pledged).
Elsewhere, they should see that it's on their wishlist.
Everyone else should have add-to-wishlist option.
(Needed ID for wishlist.js varies on search & supporter page.)
{% endcomment %}
{% if request.user.is_anonymous %}
<div class="moreinfo create-account">
<span title="{% if workid %}{% url work workid %}{% else %}{% url googlebooks googlebooks_id %}{% endif %}">Login to Add</span>
</div>
{% else %}{% if request.user.id in supporters %}
<div class="moreinfo on-wishlist">
<a href="{% url work workid %}">Pledged!</a>
</div>
{% else %}{% ifequal supporter request.user %}
{% if wishlist %}
<div class="moreinfo remove-wishlist">
<span id="p{{ workid }}">Un-wishlist</span>
</div>
{% else %}
{% comment %} on the empty-wishlist slideshow {% endcomment %}
<div class="moreinfo add-wishlist">
<span class="work_id" id="p{{ workid }}">Add&nbsp;to&nbsp;Wishlist</span>
</div>
{% endif %}
{% else %}{% if work in wishlist %}
<div class="moreinfo on-wishlist">
<a href="/#">On Wishlist!</a>
</div>
{% else %}
<div class="moreinfo add-wishlist">
{% if on_search_page %}
<span class="gb_id" id="p{{ googlebooks_id }}">Add&nbsp;to&nbsp;Wishlist</span>
{% else %}
<span class="work_id" id="p{{ workid }}">Add&nbsp;to&nbsp;Wishlist</span>
{% endif %}
</div>
{% endif %}{% endifequal %}{% endif %}{% endif %}