2016-05-11 14:41:50 +00:00
|
|
|
{% comment %}
|
2013-03-11 19:38:04 +00:00
|
|
|
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>
|
2013-03-11 19:38:04 +00:00
|
|
|
</div>
|
2016-07-25 18:50:19 +00:00
|
|
|
{% elif request.user.id in supporters %}
|
2013-03-11 19:38:04 +00:00
|
|
|
<div class="moreinfo on-wishlist">
|
2015-04-28 03:24:02 +00:00
|
|
|
<a href="{% url 'work' workid %}">Pledged!</a>
|
2013-03-11 19:38:04 +00:00
|
|
|
</div>
|
2016-07-25 18:50:19 +00:00
|
|
|
{% elif supporter == request.user %}
|
2013-03-12 14:35:27 +00:00
|
|
|
{% if wishlist %}
|
|
|
|
<div class="moreinfo remove-wishlist">
|
2014-02-11 16:37:39 +00:00
|
|
|
<span id="p{{ workid }}">Un-Fave</span>
|
2013-03-12 14:35:27 +00:00
|
|
|
</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 to Faves</span>
|
2013-03-12 14:35:27 +00:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
2016-07-25 18:50:19 +00:00
|
|
|
{% elif work in wishlist %}
|
2013-03-11 19:38:04 +00:00
|
|
|
<div class="moreinfo on-wishlist">
|
2014-02-11 16:37:39 +00:00
|
|
|
<a href="/#">A Fave!</a>
|
2013-03-11 19:38:04 +00:00
|
|
|
</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 to Faves</span>
|
2013-03-11 19:38:04 +00:00
|
|
|
{% else %}
|
2014-04-10 19:52:25 +00:00
|
|
|
<span class="work_id" id="p{{ workid }}">Add to Faves</span>
|
2013-03-11 19:38:04 +00:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
2016-07-25 18:50:19 +00:00
|
|
|
{% endif %}
|