acquired ebooks failed to show if wishlist empty [#59972462]

some complicated interaction with wishlists because this template
copies a user's
pull/1/head
eric 2013-11-01 14:33:52 -04:00
parent 6ce980810e
commit 143b24c368
2 changed files with 11 additions and 28 deletions

View File

@ -50,7 +50,7 @@ function highlightTarget(targetdiv) {
{% block topsection %} {% block topsection %}
<div id="locationhash">{{ activetab }}</div> <div id="locationhash">{% ifequal activetab '#3' %}#1{% else %}{{ activetab }}{% endifequal %}</div>
{% ifequal supporter request.user %} {% ifequal supporter request.user %}
<div class="launch_top pale">You are logged in as the administrator of {{ library.user.username }} <div class="launch_top pale">You are logged in as the administrator of {{ library.user.username }}
</div> </div>
@ -170,35 +170,16 @@ function highlightTarget(targetdiv) {
{% endif %} {% endif %}
{% if wishlist %} {% if wishlist %}
<div id="content-block-content"> <div id="content-block-content">
{% ifequal wishlist.works.all.count 0 %} {% if not works_active.count and not works_unglued.count %}
{% ifequal request.user supporter %} {% ifequal request.user supporter %}
<div class="empty-wishlist"> <div class="empty-wishlist">
<h2 style="padding-left:35px;">Your Unglue.it books will be listed here.</h2>
<div><h2 style="padding-left:35px;">Add a book to your list to get started.</h2><br /><br /></div> <p>The "Available" tab will show all the books you have licensed though Unglue.it.
The "Unglued" tab will show public domain, creative commons, and unglued titles that you add to your list of books</p>
<div id="js-slide">
<div class="js-main">
<div class="jsmodule">
{% include "slideshow.html" %}
</div>
</div>
</div>
<div id="js-maincontainer-bot-block">
<div id="js-search">
<label>What book would you give to the world? </label>
<form action="{% url search %}" method="get">
<input type="text" id="watermark" onfocus="imgfocus()" onblur="imgblur(0)" size="25" class="inputbox" name="q" value="{{ q }}">
<input type="submit" class="greenbutton" value="Search">
</form>
</div>
</div>
<br /><br /><hr />We'd also love to hear your <a href="/feedback">feedback</a>.
</div> </div>
{% else %} {% else %}
<div class="empty-wishlist"> <div class="empty-wishlist">
It looks like {{ library.user.username }} is just getting started, and hasn't added books just yet.<br /><br /> It looks like {{ library.user.username }} is just getting started, and isn't offering any books just yet.<br /><br />
{% endifequal %} {% endifequal %}
{% else %} {% else %}
@ -257,7 +238,7 @@ function highlightTarget(targetdiv) {
</div> </div>
{% endifequal %} {% endif %}
</div> </div>
</div> </div>
{% endif %} {% endif %}

View File

@ -1866,7 +1866,9 @@ def library(request,library_name):
context['library'] = library = authenticator.library context['library'] = library = authenticator.library
except Library.DoesNotExist: except Library.DoesNotExist:
raise Http404 raise Http404
context['works_active']= models.Work.objects.filter(acqs__user=library.user,acqs__license=LIBRARY).distinct() works_active= models.Work.objects.filter(acqs__user=library.user,acqs__license=LIBRARY).distinct()
if works_active.count()>0:
context['works_active'] = works_active
context['activetab'] = "#2" context['activetab'] = "#2"
context['ungluers'] = userlists.library_users(library, 5 ) context['ungluers'] = userlists.library_users(library, 5 )
return supporter(request,library_name,template_name='libraryauth/library.html', extra_context=context) return supporter(request,library_name,template_name='libraryauth/library.html', extra_context=context)