Merge branch 'fix_lockss'

pull/1/head
Andromeda Yelton 2012-09-12 10:37:29 -04:00
commit fb648bbb5c
2 changed files with 34 additions and 29 deletions

View File

@ -1,30 +1,35 @@
{% extends "base.html" %}
{% block content %}
<div style="width: 80%; margin: 15px auto;" class="clearfix"><img style="float:left; margin-right: 10px;" width="100" height="85" src="/static/images/LOCKSSpreserved.png"></span><span>We are partnering with LOCKSS to safeguard unglued ebooks. The LOCKSS Program (Lots of Copies Keep Stuff Safe) is an open source, cooperative, distributed system for preserving and providing access to digital content. For more information, see <a href="http://www.lockss.org/">the LOCKSS web site</a>.
</div>
<div style="width: 80%; margin: 15px auto;" >
{% if ebook %}
<I>{{ work.title }}</i><br />
{% if authors|length = 1 %}
{{ authors.0 }}
{% else %}
{% if authors|length = 2 %}
{{ authors.0 }} and {{ authors.1 }}
{% else % }
{% for author in authors %}
{% if forloop.last %} and {{ author }}{% else %}{{ author }}, {% endif %}
{% endfor %}
{% endif %}
{% endif %}
<p>
<a rel="license" href="{{ work.last_campaign.license_url }}"><img alt="Creative Commons License" style="border-width:0" src="{{ ebook.rights_badge }}" /></a><br />This work is licensed under a <a rel="license" href="{{ work.last_campaign.license_url }}">{{ work.last_campaign.license }} License</a>.
</p>
<p>
<a href="{{ ebook.url }}">Download.</a>
</p>
{% else %}
When an unglued ebook for <I>{{ work.title }}</I> is available, the LOCKSS harvester will be able to download it here.
{% endif %}
</div>
<div style="width: 80%; margin: 15px auto;" class="clearfix">
<img style="float:left; margin-right: 10px;" width="100" height="85" src="/static/images/LOCKSSpreserved.png"><span>We are partnering with LOCKSS to safeguard unglued ebooks. The LOCKSS Program (Lots of Copies Keep Stuff Safe) is an open source, cooperative, distributed system for preserving and providing access to digital content. For more information, see <a href="http://www.lockss.org/">the LOCKSS web site</a>.</span>
</div>
<div style="width: 80%; margin: 15px auto;">
{% if ebooks %}
{% for ebook in ebooks %}
<div>
<I>{{ work.title }}</i><br />
{% if authors|length = 1 %}
{{ authors.0 }}
{% else %}
{% if authors|length = 2 %}
{{ authors.0 }} and {{ authors.1 }}
{% else % }
{% for author in authors %}
{% if forloop.last %} and {{ author }}{% else %}{{ author }}, {% endif %}
{% endfor %}
{% endif %}
{% endif %}
<p>
<a rel="license" href="{{ work.last_campaign.license_url }}"><img alt="Creative Commons License" style="border-width:0" src="{{ ebook.rights_badge }}" /></a><br />This work is licensed under a <a rel="license" href="{{ work.last_campaign.license_url }}">{{ work.last_campaign.license }} License</a>.
</p>
<p>
<a href="{{ ebook.url }}">Download.</a>
</p>
</div>
{% endfor %}
{% else %}
When an unglued ebook for <I>{{ work.title }}</I> is available, the LOCKSS harvester will be able to download it here.
{% endif %}
</div>
{% endblock %}

View File

@ -2051,12 +2051,12 @@ def lockss(request, work_id):
"""
work = safe_get_work(work_id)
try:
ebook = work.ebooks().filter(unglued=True)[0]
ebooks = work.ebooks().filter(edition__unglued=True)
except:
ebook = None
ebooks = None
authors = list(models.Author.objects.filter(editions__work=work).all())
return render(request, "lockss.html", {'work':work, 'ebook':ebook, 'authors':authors})
return render(request, "lockss.html", {'work':work, 'ebooks':ebooks, 'authors':authors})
def download(request, work_id):
context = {}