regluit/frontend/templates/book_panel_addbutton.html

43 lines
1.9 KiB
HTML
Raw Normal View History

2015-04-28 03:24:02 +00:00
{% load url from future %}{% 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">
2015-04-28 03:24:02 +00:00
<span title="{% if workid %}{% url 'work' workid %}{% else %}{% url 'googlebooks' googlebooks_id %}{% endif %}">Login to Fave</span>
</div>
{% else %}{% if request.user.id in supporters %}
<div class="moreinfo on-wishlist">
2015-04-28 03:24:02 +00:00
<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-Fave</span>
</div>
{% else %}
{% comment %} on the empty-wishlist slideshow {% endcomment %}
<div class="moreinfo add-wishlist">
2014-04-10 19:52:25 +00:00
<span class="work_id" id="p{{ workid }}">Add&nbsp;to&nbsp;Faves</span>
</div>
{% endif %}
{% else %}{% if work in wishlist %}
<div class="moreinfo on-wishlist">
<a href="/#">A Fave!</a>
</div>
{% else %}
<div class="moreinfo add-wishlist">
{% if on_search_page %}
2014-04-10 19:52:25 +00:00
<span class="gb_id" id="p{{ googlebooks_id }}">Add&nbsp;to&nbsp;Faves</span>
{% else %}
2014-04-10 19:52:25 +00:00
<span class="work_id" id="p{{ workid }}">Add&nbsp;to&nbsp;Faves</span>
{% endif %}
</div>
{% endif %}{% endifequal %}{% endif %}{% endif %}