Merge branch 'master' into pledged_badges

pull/1/head
eric 2012-10-01 15:38:52 -04:00
commit 33e652881c
31 changed files with 509 additions and 221 deletions

View File

@ -124,6 +124,13 @@ Configure Terminal to automatically notice this at startup:
Terminal > Preferences > Settings > Shell
Click "run command"; add `source ~/.bashrc`
If you get 'EnvironmentError: mysql_config not found'
edit the line ~/.virtualenvs/regluit/build/MySQL-python/setup_posix.py
1. mysql_config.path = "mysql_config"
to be (using a path that exists on your system)
1. mysql_config.path = "/usr/local/mysql-5.5.20-osx10.6-x86_64/bin/mysql_config"
Selenium Install
---------------

View File

@ -168,7 +168,7 @@ class GoodreadsClient(object):
if r.status_code != httplib.OK:
raise GoodreadsException('Error in review_list_unauth, http status_code: {0}'.format(r.status_code))
else:
doc = ET.fromstring(r.content.encode('utf-8'))
doc = ET.fromstring(r.content)
# for the moment convert to a iterable of book data presented as dict -- one the way to paging through all results
reviews = doc.findall('reviews/review')
for review in reviews:
@ -250,7 +250,7 @@ class GoodreadsClient(object):
raise GoodreadsException('Error in shelves_list: %s ' % (r.headers))
else:
logger.info('headers: %s' % (r.headers))
doc = ET.fromstring(r.content.encode('utf-8'))
doc = ET.fromstring(r.content)
shelves = doc.find('shelves')
# do a simple parsing to a dictionary

View File

@ -210,6 +210,47 @@ class Campaign(models.Model):
except:
return u"Campaign %s (no associated work)" % self.name
def clone(self):
"""use a previous UNSUCCESSFUL campaign's data as the basis for a new campaign"""
if self.clonable():
old_managers= self.managers.all()
# copy custom premiums
new_premiums= self.premiums.filter(type='CU')
# setting pk to None will insert new copy http://stackoverflow.com/a/4736172/7782
self.pk = None
self.status = 'INITIALIZED'
# set deadline far in future -- presumably RH will set deadline to proper value before campaign launched
self.deadline = date_today() + timedelta(days=int(settings.UNGLUEIT_LONGEST_DEADLINE))
# allow created, activated dates to be autoset by db
self.created = None
self.name = 'copy of %s' % self.name
self.activated = None
self.update_left()
self.save()
self.managers=old_managers
# clone associated premiums
for premium in new_premiums:
premium.pk=None
premium.created = None
premium.campaign = self
premium.save()
return self
else:
return None
def clonable(self):
"""campaign clonable if it's UNSUCCESSFUL and is the last campaign associated with a Work"""
if self.status == 'UNSUCCESSFUL' and self.work.last_campaign().id==self.id:
return True
else:
return False
@property
def launchable(self):
may_launch=True
@ -341,7 +382,9 @@ class Campaign(models.Model):
@property
def supporters_count(self):
# avoid transmitting the whole list if you don't need to; let the db do the count.
return self.transactions().filter(status=TRANSACTION_STATUS_ACTIVE).values_list('user', flat=True).distinct().count()
active = self.transactions().filter(status=TRANSACTION_STATUS_ACTIVE).values_list('user', flat=True).distinct().count()
complete = self.transactions().filter(status=TRANSACTION_STATUS_COMPLETE).values_list('user', flat=True).distinct().count()
return active+complete
def transaction_to_recharge(self, user):
"""given a user, return the transaction to be recharged if there is one -- None otherwise"""
@ -453,6 +496,24 @@ class Identifier(models.Model):
class Meta:
unique_together = ("type", "value")
@staticmethod
def set(type=None, value=None, edition=None, work=None):
# if there's already an id of this type for this work and edition, change it
# if not, create it. if the id exists and points to something else, change it.
identifier= Identifier.get_or_add(type=type, value=value, edition = edition, work=work)
if identifier.work.id != work.id:
identifier.work=work
identifier.save()
if identifier.edition and edition:
if identifier.edition.id != edition.id:
identifier.edition = edition
identifier.save()
others= Identifier.objects.filter(type=type, work=work, edition=edition).exclude(value=value)
if others.count()>0:
for other in others:
other.delete()
return identifier
@staticmethod
def get_or_add( type='goog', value=None, edition=None, work=None):
@ -653,6 +714,15 @@ class Work(models.Model):
self.num_wishes = Wishes.objects.filter(work=self).count()
self.save()
def first_oclc(self):
preferred_id=self.preferred_edition.oclc
if preferred_id:
return preferred_id
try:
return self.identifiers.filter(type='oclc')[0].value
except IndexError:
return ''
def first_isbn_13(self):
preferred_id=self.preferred_edition.isbn_13
if preferred_id:

View File

@ -223,7 +223,8 @@ def handle_wishlist_added(supporter, work, **kwargs):
if claim:
notification.queue([claim[0].user], "new_wisher", {
'supporter': supporter,
'work': work
'work': work,
'base_url': settings.BASE_URL,
}, True)
from regluit.core.tasks import emit_notifications

View File

@ -14,7 +14,7 @@ from django.contrib.sites.models import Site
from django.http import Http404
from regluit.payment.models import Transaction
from regluit.core.models import Campaign, Work, UnglueitError, Edition, RightsHolder, Claim, Key, Ebook
from regluit.core.models import Campaign, Work, UnglueitError, Edition, RightsHolder, Claim, Key, Ebook, Premium
from regluit.core import bookloader, models, search, goodreads, librarything
from regluit.core import isbn
from regluit.payment.parameters import PAYMENT_TYPE_AUTHORIZATION
@ -388,6 +388,8 @@ class CampaignTests(TestCase):
w = Work()
w.save()
w2 = Work()
w2.save()
# INITIALIZED
c1 = Campaign(target=D('1000.00'),deadline=datetime(2013,1,1),work=w)
c1.save()
@ -402,6 +404,8 @@ class CampaignTests(TestCase):
rh.save()
cl = Claim(rights_holder = rh, work = w, user = u, status = 'active')
cl.save()
cl2 = Claim(rights_holder = rh, work = w2, user = u, status = 'active')
cl2.save()
c2.activate()
self.assertEqual(c2.status, 'ACTIVE')
# SUSPENDED
@ -414,14 +418,25 @@ class CampaignTests(TestCase):
# should not let me suspend a campaign that hasn't been initialized
self.assertRaises(UnglueitError, c1.suspend, "for testing")
# UNSUCCESSFUL
c3 = Campaign(target=D('1000.00'),deadline=now() - timedelta(days=1),work=w)
c3 = Campaign(target=D('1000.00'),deadline=now() - timedelta(days=1),work=w2)
c3.save()
c3.activate()
self.assertEqual(c3.status, 'ACTIVE')
# at this point, since the deadline has passed, the status should change and be UNSUCCESSFUL
self.assertTrue(c3.update_status())
self.assertEqual(c3.status, 'UNSUCCESSFUL')
# premiums
pr1= Premium(type='CU', campaign=c3, amount=10, description='botsnack', limit=1)
pr1.save()
self.assertEqual(pr1.premium_remaining,1)
#cloning (note we changed c3 to w2 to make it clonable)
c7= c3.clone()
self.assertEqual(c7.status, 'INITIALIZED')
self.assertEqual(c7.premiums.all()[0].description , 'botsnack')
# SUCCESSFUL
c4 = Campaign(target=D('1000.00'),deadline=now() - timedelta(days=1),work=w)
c4.save()
@ -615,6 +630,7 @@ class DownloadPageTest(TestCase):
e1 = models.Edition()
e1.work = w
e1.unglued = True
e2 = models.Edition()
e2.work = w
e1.save()
@ -623,16 +639,17 @@ class DownloadPageTest(TestCase):
eb1 = models.Ebook()
eb1.url = "http://example.com"
eb1.edition = e1
eb1.unglued = True
eb1.format = 'epub'
eb2 = models.Ebook()
eb2.url = "http://example2.com"
eb2.edition = e2
eb2.format = 'mobi'
eb1.save()
eb2.save()
anon_client = Client()
response = anon_client.get("/work/%s/download/" % w.id)
self.assertContains(response, "http://example.com", count=2)
self.assertContains(response, "http://example2.com", count=2)
self.assertContains(response, "http://example.com", count=4)
self.assertContains(response, "http://example2.com", count=3)

View File

@ -36,6 +36,15 @@ class EditionForm(forms.ModelForm):
'required': _("Yes, we need an ISBN."),
}
)
oclcnum = forms.RegexField(
label=_("OCLCnum"),
regex=r'^\d\d\d\d\d\d\d\d\d*$',
required = False,
help_text = _("8 or more digits."),
error_messages = {
'invalid': _("This value must be 8 or more digits."),
}
)
language = forms.ChoiceField(choices=LANGUAGES)
description = forms.CharField( required=False, widget= forms.Textarea(attrs={'cols': 80, 'rows': 2}))
class Meta:
@ -164,6 +173,9 @@ class UserData(forms.Form):
return username
raise forms.ValidationError(_("Your username is already "+username))
class CloneCampaignForm(forms.Form):
campaign_id = forms.IntegerField(required = True, widget = forms.HiddenInput)
class OpenCampaignForm(forms.ModelForm):
managers = AutoCompleteSelectMultipleField(
OwnerLookup,
@ -228,9 +240,9 @@ def getManageCampaignForm ( instance, data=None, *args, **kwargs ):
class ManageCampaignForm(forms.ModelForm):
paypal_receiver = forms.EmailField(
label=_("email address to collect Paypal funds"),
label=_("contact email address for this campaign"),
max_length=100,
error_messages={'required': 'You must enter the email associated with your Paypal account.'},
error_messages={'required': 'You must enter the email we should contact you at for this campaign.'},
)
target = forms.DecimalField( min_value= D(settings.UNGLUEIT_MINIMUM_TARGET), error_messages={'required': 'Please specify a target price.'} )
edition = forms.ModelChoiceField(get_queryset(), widget=RadioSelect(),empty_label='no edition selected',required = False,)

View File

@ -99,12 +99,16 @@
</div>
</div>
{% block news %}
<div class="launch_top">
It's here: our first unglued edition. You can now <a href="/work/81724/">download <I>Oral Literature in Africa</I></a>.<br /><br />Campaigns to unglue more books <a href="http://blog.unglue.it/2012/09/13/update-on-unglue-it-relaunch/">will relaunch soon</a>.
It's here: our first unglued edition. You can now download <a href="/work/81724/"><I>Oral Literature in Africa</I></a>.<br /><br />Campaigns to unglue more books <a href="http://blog.unglue.it/2012/09/13/update-on-unglue-it-relaunch/">will relaunch soon</a>.
</div>
{% endblock %}
{% block topsection %}{% endblock %}
{% block content %}{% endblock %}
</div>
{% block footer %}
<div id="footer">
<div class="js-main">
<div class="column">
@ -151,6 +155,7 @@ It's here: our first unglued edition. You can now <a href="/work/81724/">downlo
</div>
</div>
</div>
{% endblock %}
{% block counter %}
<script type="text/javascript">
@ -164,7 +169,8 @@ It's here: our first unglued edition. You can now <a href="/work/81724/">downlo
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>{% endblock %}
</script>
{% endblock %}
</body>
</html>

View File

@ -1,40 +0,0 @@
{% extends "base.html" %}
{% load humanize %}
{% url privacy as privacyurl %}
{% block content %}
<h2>Campaign: {{campaign.name}}</h2>
<!-- url for work: -->
<p>Work: <a href="{% url work work_id=campaign.work.id %}">{{campaign.work}}</a></p>
<p>Target: {{campaign.target|floatformat:0|intcomma}}</p>
<p>Deadline: {{campaign.deadline}}</p>
<p>Status: {{campaign.status}}</p>
<p>ISBN: {{campaign.work.first_isbn_13}} </p>
<p><a href="{% url widget isbn=campaign.work.first_isbn_13 %}">Widget Link</a></p>
<p>Embed a widget:</p>
<textarea rows="2" cols="80">&lt;iframe src="{{base_url}}/api/widget/{{campaign.work.first_isbn_13}}/" width="152" height="325" frameborder="0"&gt;</iframe></textarea>
<p>PayPal receiver: {{campaign.paypal_receiver}}</p>
<p>Current total (pledged/authorized): {{campaign.current_total|floatformat:0|intcomma}}</p>
<form method="POST" action="{% url campaign_by_id pk=campaign.id %}" onsubmit="test()">
{% csrf_token %}
{{form.as_p}}
<input type="submit" value="Pledge" id="pledgeBtn" />
</form>
<!-- All associated transactions -->
{% if campaign.transactions %}
<p>Associated transactions:</p>
<ul>
{% for transaction in campaign.transactions %}
<li>id:{{transaction.id}} | type:{{transaction.type}} | {{transaction.status}} | {{transaction.user}} | amount:{{transaction.amount}}</li>
{% endfor %}
</ul>
{% else %}
<p>No associated transactions</p>
{% endif %}
{% endblock %}

View File

@ -19,6 +19,7 @@ You have a balance of {{ user.credit.balance }} donation credits. <br />
You have pledged {{ user.credit.pledged }} donation credits to ungluing campaigns.<br />
You have {{ user.credit.available }} donation credits available to pledge or transfer.<br />
</p>
<div class="clearfix">
<h2>Donation Credit Transfers</h2>
{% if transfer_message %}
<p>{{ transfer_message }}
@ -36,6 +37,25 @@ You may transfer up to {{ user.credit.available }} donation credits to another U
{{ transfer_form.as_p }}
<input id="transfer_submit" type="submit" name="transfer" value="Transfer Credits" />
</form>
</div>
<div class="clearfix">
<h2>About Donation Credits</h2>
{% if nonprofit.is_on %}
<p>Unglue.it uses donation credits to cooperate with a non-profit charity, {{ nonprofit.name }} in the ungluing of books. When you make a donation to {{ nonprofit.name }}, you can get credits for your donation. Then you can direct how {{ nonprofit.name }} uses your donation in support of ungluing campaigns. You can also transfer your credits to other ungluers. To make a donation, and receive credits, click the button!
</p>
<div id="donate_charity">
<form method="GET" action="{{nonprofit.link}}">
{{ donate_form.non_field_errors }}
{{donate_form}}
<input name="donate_submit" type="submit" value="Go Donate!" id="donate_submit" />
</form>
</div>
</div>
{% else %}
<p>Donation credits are not turned on yet.</p>
{% endif %}
{% endblock %}

View File

@ -6,7 +6,7 @@
{% endblock %}
{% block extra_js %}
<script type="text/javascript" src="/static/js/wishlist.js"></script>
<script type="text/javascript" src="/static/js/readmill.js"></script>
{% endblock %}
{% block content %}
@ -19,13 +19,13 @@
<h3>Read the unglued edition!</h3>
<div class="ebook_download">
{% for ebook in unglued_ebooks %}
{% with ebook.url as url %}
<a href="{{ url }}"><img src="{{ ebook.rights_badge }}"></a>
<a href="{{ url }}">{{ ebook.format }}</a>
{% ifequal ebook.format 'mobi' %} (use for Kindle){% endifequal %}
{% ifequal ebook.format 'epub' %} (use for Nook, Apple, Sony){% endifequal %}
{% if not forloop.last %}<br /><br />{% endif %}
{% endwith %}
<a href="{{ ebook.url }}">
<img src="{{ ebook.rights_badge }}" alt="{{ ebook.rights}}" title="{{ ebook.rights}}" /></a>
<a href="{{ ebook.url }}"><img src="/static/images/{{ ebook.format }}32.png" height="32" alt="{{ ebook.format }}" title="{{ ebook.format }}" /></a>
<a href="{{ ebook.url }}">{{ ebook.format }}</a>
{% ifequal ebook.format 'mobi' %} (use for Kindle){% endifequal %}
{% ifequal ebook.format 'epub' %} (use for Nook, Apple, Sony){% endifequal %}
{% if not forloop.last %}<br /><br />{% endif %}
{% endfor %}
</div>
</div>
@ -38,20 +38,20 @@
<h4>Freely available editions</h4>
{% endif %}
{% for ebook in other_ebooks %}
{% with ebook.url as url %}
<a href="{{ url }}"><img src="{{ ebook.rights_badge }}"></a>
<a href="{{ url }}">{{ ebook.format }}</a>
{% ifequal ebook.format 'mobi' %} (use for Kindle){% endifequal %}
{% ifequal ebook.format 'epub' %} (use for Nook, Apple, Sony){% endifequal %}
{% if not forloop.last %}<br /><br />{% endif %}
{% endwith %}
<a href="{{ ebook.url }}">
<img src="{{ ebook.rights_badge }}" alt="{{ ebook.rights}}" title="{{ ebook.rights}}" /></a>
<a href="{{ ebook.url }}"><img src="/static/images/{{ ebook.format }}32.png" height="32" alt="{{ ebook.format }} at {{ebook.provider}}" title="{{ ebook.format }} at {{ebook.provider}}" /></a>
<a href="{{ ebook.url }}">{{ ebook.format }} at {{ebook.provider}}</a>
{% ifequal ebook.format 'mobi' %} (use for Kindle){% endifequal %}
{% ifequal ebook.format 'epub' %} (use for Nook, Apple, Sony){% endifequal %}
{% if not forloop.last %}<br /><br />{% endif %}
{% endfor %}
</div>
{% endif %}
</div>
{% if unglued_ebooks or other_ebooks %}
<div class="border">
<h3>How to download</h3>
<a href="http://www.defectivebydesign.org/drm-free" style="float:right;"><img src="https://static.fsf.org/dbd/DRM-free/DRM-free150.png" alt="DefectiveByDesign.org" width="150" height="150" border="0" align="middle" /></a><h3>How to download</h3>
<p>Ebooks you find at Unglue.it may be read on any device, and you're welcome to convert them to whatever electronic format is most useful to you. While we can't cover every possible combination of readers, software, and formats you might use, here's some help for the most common cases.</p>
<h4>Any device</h4>
@ -59,8 +59,13 @@
<p>If this doesn't work, use the instructions below for your device.</p>
{% if readmill_epub_url %}
<h4>Readmill users</h4>
<p>If you're a <a href="http://readmill.com/">Readmill</a> member, you can send unglued ebooks to your iPad with one click. Here you go:</p>
<div class="send-to-readmill" data-download-url="{{ readmill_epub_url }}" data-buy-url="{{ base_url }}{% url work work.id %}" data-display="small"></div>
{% endif %}
<h4>Android devices</h4>
<p class="ebook_download logo"><img src="/static/images/aldiko_logo.png">Aldiko</p>
<p class="ebook_download logo"><img src="/static/images/aldiko_logo.png" alt="Aldiko Logo" />Aldiko</p>
<ul>
<li><a href="http://www.aldiko.com/download.html">Download the free Aldiko app.</a></li>
@ -72,7 +77,7 @@
{% endcomment %}
<h4>iOS devices</h4>
<p class="ebook_download logo"><img src="/static/images/ibooks_logo.jpeg">iBooks</p>
<p class="ebook_download logo"><img src="/static/images/ibooks_logo.jpeg" alt="iBooks Logo" />iBooks</p>
{% comment %}test{% endcomment %}
<ul>
<li><a href="http://itunes.apple.com/us/app/ibooks/id364709193?mt=8">Download the free iBooks app</a> from the App Store.</li>
@ -81,7 +86,7 @@
</ul>
<h4>PC, Mac, or Linux</h4>
<p class="ebook_download logo"><img src="/static/images/calibre_logo.png">Calibre</p>
<p class="ebook_download logo"><img src="/static/images/calibre_logo.png" alt="Calibre Logo" />Calibre</p>
<ul>
<li><a href="http://calibre-ebook.com/download">Download the free Calibre app.</a></li>
<li>Download your book from this page using your device's web browser.</li>
@ -114,9 +119,11 @@
<p>Need help with something not listed here? Email us at <a href="mailto:support@gluejar.com?Subject=Ebook%20downloading%20help">support@gluejar.com</a>.</p>
</div>
{% else %}
<p id="content-block">There are no freely available downloads of <I>{{ work.title }}</I> right now. {% if not work in request.user.wishlist.works.all %}Would you like there to be? <a class="add-wishlist"><span class="work_id" id="w{{ work.id }}">Add this book to your wishlist.</span></a>{% else %}Ask your friends to add it to their wishlists!{% endif %}</p>
<p>If you know of a Creative-Commons-licensed or US public domain edition of this book, you can add it through the <a href="{% url work work.id %}?tab=4">Rights tab of the book page</a>.</p>
<div class="border">
<p id="content-block">There are no freely available downloads of <I>{{ work.title }}</I> right now. {% if not work in request.user.wishlist.works.all %}Would you like there to be? <a class="add-wishlist"><span class="work_id" id="w{{ work.id }}">Add this book to your wishlist.</span></a>{% else %}Ask your friends to add it to their wishlists!{% endif %}</p>
<p>If you know of a Creative-Commons-licensed or US public domain edition of this book, you can add it through the <a href="{% url work work.id %}?tab=4">Rights tab of the book page</a>.</p>
</div>
{% endif %}
</div>
</div>

View File

@ -218,9 +218,9 @@ If you want to find an interesting campaign and don't have a specific book in mi
{% if sublocation == 'supporting' or sublocation == 'all' %}
<h4>Supporting Campaigns</h4>
<dl>
<dt>How do I pledge? Do I need an Amazon account?</dt>
<dt>How do I pledge?</dt>
<dd>There's a Support button on all campaign pages, or you can just click on the premium you'd like to receive. You'll be asked to select your premium and specify your pledge amount, and then you'll be taken to Amazon to complete the transaction. At this time, you need an Amazon Account in order to pledge.</dd>
<dd>There's a Support button on all campaign pages, or you can just click on the premium you'd like to receive. You'll be asked to select your premium and specify your pledge amount, and then enter your credit card information.</dd>
<dt>When will I be charged?</dt>
@ -272,7 +272,7 @@ Rights holders are encouraged to offer additional premiums to engage supporters'
<dt>Is there a minimum or maximum for how much a premium can cost?</dt>
<dd>There's a $1 minimum and a $2000 maximum (due to transaction size limits imposed by our payment processor).</dd>
<dd>There's a $1 minimum and a $2000 maximum.</dd>
</dl>
{% endif %}
{% endif %}
@ -389,11 +389,31 @@ Unglue.it signs agreements assuring the copyright status of every work we unglue
<dl>
<dt>What do I need to do to become an authorized Rights Holder on Unglue.it?</dt>
<dd>Contact our Rights Holder Relations team, <a href="mailto:rights@gluejar.com">rights@gluejar.com</a>, to discuss signing our Platform Services Agreement. This is the first step in being able to make an offer to license, set a monetary goal, and run a campaign on Unglue.it.</dd>
<dd>Contact our Rights Holder Relations team, <a href="mailto:rights@gluejar.com">rights@gluejar.com</a>, to discuss signing our Platform Services Agreement (PSA), setting a monetary goal, and running a campaign on Unglue.it to release your book under a <a href="http://creativecommons.org">Creative Commons</a> license.<br /><br />
The more Unglue.it knows about you and your books, the faster your campaign can be up and running.<br /><br />
For example, it would help to have you tell us the following in your initial query:<br /><br />
<em>About your books:</e><br />
Title(s) for which you hold the rights and which you might want to unglue. (ISBNs help too!)<br />
How long have print and/or ebook editions of these titles been for sale?<br />
Where are your books sold?<br />
If your title went out of print, how many copies had it sold until then?<br /><br />
<em>About the ebook rights:</em><br />
Have rights reverted, or have you already requested reversion?<br />
Have you self-published?<br /><br />
<em>About you as an author and marketer:</em><br />
What social media (blog, Twitter, Facebook, Goodreads, etc.) do you currently use?<br />
How have you worked with libraries to promote your books in the past?<br />
Where do you think your key supporters will come from? -- a community of fans you're already in touch with, fans who read your genre, readers who have yet to discover your work, scholars or students, readers who support the open access movement or free culture?
</dd>
<dt>Do I need to know the exact titles I might want to unglue before I sign the Platform Services Agreement?</dt>
<dd>No. You only need to agree to the terms under which you will use Unglue.it to raise money to release an ebook using a <a href="http://creativecommons.org">Creative Commons</a> license. You can decide which specific titles you wish to make available for licensing later. You can run campaigns for as many, or as few, titles at a time as you like.</dd>
<dd>No. You only need to agree to the terms under which you will use Unglue.it to raise money to release an ebook using a <a href="http://creativecommons.org">Creative Commons</a> license. You can decide which specific titles you wish to make available for licensing later. However, before you start a campaign, you must claim a specific title (through the Rights tab of its book page) and plan how you will attract ungluers to pledge toward your goal.</dd>
<dt>Can I run more than one campaign?</dt>
<dd>You can run campaigns for as many, or as few, titles at a time as you like. We encourage you to start with one at a time.</dd>
</dl>
{% endif %}
{% if sublocation == 'campaigns' or sublocation == 'all' %}
@ -498,16 +518,6 @@ Need more ideas? We're happy to work with rights holders personally to craft a
{% if sublocation == 'funding' or sublocation == 'all' %}
<h4>Funding</h4>
<dt>Is a PayPal account required to launch a campaign?</dt>
<dd>At this time, Unglue.it requires that rights holders have PayPal accounts as it will simplify the process of paying you when a campaign succeeds. </dd>
<dt>Is an Amazon account required to launch a campaign?</dt>
<dd>No. When Unglue.it receives funds pledged through Amazon, we can cut a check to rights holders when a campaign succeeds.</dd>
<dt>Why does this FAQ mention both Amazon and Paypal? Who's the payment processor?</dt>
<dd>For more information on Unglue.it's decision-making process with regard to payment processors, please read <a href="http://blog.unglue.it/2012/05/03/unglue-it-payment-options-amazon-vs-paypal/">our blog post on Amazon and Paypal</a>.</dd>
<dt>Are a funding goal and deadline required?</dt>
<dd>Yes.</dd>
@ -552,7 +562,7 @@ If you're concerned a campaign may not reach its goal you have several options.
<dt>What fees does Unglue.it charge?</dt>
<dd>When a campaign succeeds, Unglue.it will deduct a 6% commission on the funds raised. Our payment processor also charges a small percentage fee on each transaction, plus (where relevant) currency conversion costs. If you do not have a suitable ePub version of your book available, you will also need to cover ebook conversion costs; please price this into your goal for a campaign. Details are spelled out in the Platform Services Agreement that rights holders must sign before launching an Unglue.it campaign.</dd>
<dd>When a campaign succeeds, Unglue.it will deduct a 6% commission on the funds raised. Our payment processor also charges a small fee on each transaction, plus (where relevant) currency conversion costs. If you do not have a suitable ePub version of your book available, you will also need to cover ebook conversion costs; please price this into your goal for a campaign. Details are spelled out in the Platform Services Agreement that rights holders must sign before launching an Unglue.it campaign.</dd>
<dt>Does it cost money to start a campaign on Unglue.it?</dt>

View File

@ -20,13 +20,19 @@
<div class="jsmod-content">
<div><h2>Funding Your Pledge</h2>
<div>We're so happy that you've decided to {% if modified %}increase your pledge{% else %}join{% endif %} this campaign. We have two ways we can fund your pledge of ${{preapproval_amount}}.
<div>We're so happy that you've decided to {% if modified %}increase your pledge{% else %}join{% endif %} this campaign.
{% if nonprofit.is_on %}
We have two ways we can fund your pledge of ${{preapproval_amount}}.
<ol>
<li>You can <a href="#donate">make a donation now</a> to {{nonprofit.name}}, a non-profit charity that's working with Unglue.it to give books to the world.</li>
<li>You can <a href="#authorize">give us your credit card</a> information now; we'll charge your card only if the campaign succeeds.</li>
</ol>
{% else %}
To fund your pledge of ${{preapproval_amount}}, you can <a href="#authorize">give us your credit card</a> information now; we'll charge your card only if the campaign succeeds.
{% endif %}
</div>
</div>
{% if nonprofit.is_on %}
<div id="donate" class="clearfix">
<h3>Donate to Charity</h3>
{% if request.user.credit.balance %}You have a donation credit of ${{ request.user.credit.balance }}. The amount that's uncommitted is ${{ request.user.credit.available }}, so you need to add at least ${{ needed }}.{% endif %}
@ -42,6 +48,7 @@
</div>
</div>
{% endif %}
<div id="authorize" class="clearfix">
<h3>Pledge by Credit Card</h3>
<p>Unglue.it uses Stripe to securely manage your Credit Card information.
@ -52,7 +59,7 @@
<form action="" method="post" id="payment-form">
{% csrf_token %}
{{ form.non_field_errors }}
{{form}}
{{ form.as_p }}
<payment key="{{STRIPE_PK}}"></payment>
<input name="cc_submit" type="submit" value="Verify Credit Card" id="cc_submit" />
</form>

View File

@ -0,0 +1,14 @@
{% extends "base.html" %}
{% block news %}
{% endblock %}
{% block content %}
Books unglued in {{ year }} for the LOCKSS harvester to crawl.<br /><br />
{% for ebook in ebooks %}
<a href="{% url lockss ebook.work.id %}">{{ ebook.work.title }}</a><br />
{% endfor %}
{% endblock %}
{% block footer %}
{% endblock %}

View File

@ -175,7 +175,7 @@ Please fix the following before launching your campaign:
{% ifnotequal campaign_status 'ACTIVE' %}
<h3>Target Price</h3>
<p>This is the target price for your campaign. The <i>mimimum</i> target is ${{form.minimum_target|intcomma}}.</p>
<p>This is the target price for your campaign. The <i>minimum</i> target is ${{form.minimum_target|intcomma}}.</p>
<p>Your target should be high enough to compensate you for potential lost future revenue from sales of this edition and reflect well on your brand, but low enough to seem realistic to supporters; people are more likely to back campaigns that they think will succeed.</p>
@ -208,20 +208,22 @@ Please fix the following before launching your campaign:
{{ form.deadline.errors }}<span style="display: none">{{ form.deadline }}</span>
{% endifnotequal %}
<h3>Paypal collection address</h3>
<p>Enter the email address associated with your PayPal account.</p>
<h3>e-mail contact address</h3>
<p>Enter the email address where notifications about this campaign should be sent. If your campaign succeeds, this email needs to work if you want to get paid!</p>
<p>We don't support PayPal yet; if your campaign succeeds we'll be paying you by check. However, we've applied PayPal for a merchant account, and should that application be approved PayPal expects us to have this information.</p>
<p>{{ form.paypal_receiver.errors }}{{ form.paypal_receiver }}</p>
{% ifequal campaign_status 'ACTIVE' %}
<div class="yikes">When you click this button, your changes will be visible to supporters immediately. Make sure to proofread!</div><br />
<input type="submit" name="save" value="Modify Campaign" />
{% else %}
<br /><br /><input type="submit" name="save" value="Save Campaign" />
{% endifequal %}
{% if campaign_status == 'INITIALIZED' %}
<input id="campaign_launcher" type="submit" name="launch" value="Launch Campaign" />
{% if not is_preview or request.user.is_staff %}
{% ifequal campaign_status 'ACTIVE' %}
<div class="yikes">When you click this button, your changes will be visible to supporters immediately. Make sure to proofread!</div><br />
<input type="submit" name="save" value="Modify Campaign" />
{% else %}
<br /><br /><input type="submit" name="save" value="Save Campaign" />
{% endifequal %}
{% if campaign_status == 'INITIALIZED' %}
<input id="campaign_launcher" type="submit" name="launch" value="Launch Campaign" />
{% endif %}
{% endif %}
</form>
</div>
@ -266,20 +268,24 @@ Please fix the following before launching your campaign:
{% ifequal campaign_status 'INITIALIZED' %}
<div class="tabs-3">
{% if campaign.description and campaign.target and campaign.deadline %}
<p>Before you hit launch:</p>
<ul>
<li>Have you proofread your campaign? (Make sure to spellcheck!)</li>
<li>Have you <a href="{% url work_preview campaign.work.id %}">previewed your campaign</a>? Does it look how you want it to?</li>
</ul>
{% if not is_preview or request.user.is_staff %}
{% if campaign.description and campaign.target and campaign.deadline %}
<p>Before you hit launch:</p>
<ul>
<li>Have you proofread your campaign? (Make sure to spellcheck!)</li>
<li>Have you <a href="{% url work_preview campaign.work.id %}">previewed your campaign</a>? Does it look how you want it to?</li>
</ul>
<p>If it doesn't look exactly the way you like, or you're having any trouble with your description or premiums, we're happy to help; please email unglue.it support (<a href="mailto:support@gluejar.com">support@gluejar.com</a>).</p>
<p>If it doesn't look exactly the way you like, or you're having any trouble with your description or premiums, we're happy to help; please email unglue.it support (<a href="mailto:support@gluejar.com">support@gluejar.com</a>).</p>
<p>If you're happy with your campaign, here's your moment of truth!</p>
<div id="launchme"><a href="#" class="manage">Launch Campaign</a></div>
<p>If you're happy with your campaign, here's your moment of truth!</p>
<div id="launchme"><a href="#" class="manage">Launch Campaign</a></div>
{% else %}
<p>Please make sure you've selected your campaign's edition and entered its description, target, deadline, and premiums, and previewed your campaign, before launching.</p>
{% endif %}
{% else %}
<p>Please make sure you've selected your campaign's edition and entered its description, target, deadline, and premiums, and previewed your campaign, before launching.</p>
While you're free to edit your campaign, it won't be launchable until we've fully tested our new payment processor.
{% endif %}
</div>

View File

@ -46,6 +46,7 @@
<p><b>Language</b>: {{ form.language.errors }}{{ form.language }}</p>
<p><b>ISBN-13</b>: {{ form.isbn_13.errors }}{{ form.isbn_13 }}</p>
<p><b>OCLC Number</b>: {{ form.oclcnum.errors }}{{ form.oclcnum }}</p>
<p><b>Description</b>: <br />
{{ form.description.errors }}{{ form.description }}<br />

View File

@ -1,4 +1,4 @@
{{ supporter }} has wished for a work you hold rights to, {{ work.title }}. Hooray! There are now {{ work.num_wishes }} people wishing for this work.
{{ supporter }} ({{ base_url }}{% url supporter supporter.username %}) has wished for a work you hold rights to, {{ work.title }} ({{ base_url }}{% url work work.id %}). Hooray! {% with work.num_wishes as num_wishes %}{% if num_wishes = 1 %}Your first ungluer!{% else %}There are now {{ num_wishes }} people wishing for this work.{% endif %}{% endwith %}
The Unglue.it team

View File

@ -1,6 +1,6 @@
Alas. The campaign to unglue {{ campaign.work.title }} (https://{{site.domain}}{% url work campaign.work.id %}) has not succeeded.
If you pledged toward this work, your pledge will expire shortly and your credit card will not be charged, nor will you receive any premiums. You'll also receive an email from Amazon notifying you that your payment to Gluejar has been cancelled.
If you pledged toward this work, your pledge will expire shortly and your credit card will not be charged, nor will you receive any premiums.
Still want to give {{ campaign.work.title }} to the world? Don't despair. Keep it on your wishlist and tell everyone why you love this book. The rights holder, {{ campaign.rightsholder }}, may run a campaign with different terms in the future. With your help, we may yet be able to unglue {{ campaign.work.title }}.

View File

@ -181,6 +181,14 @@ Creative Commons offers a variety of other licenses, many of them with even less
<a id="blogs"></a><h2>Blog Coverage (Highlights)</h2>
<div class="pressarticles">
<div>
<a href="http://boingboing.net/2012/09/20/words-on-the-water.html">Words on the Water</a><br />
Boing Boing - September 20, 2012<br />
</div>
<div>
<a href="http://openfolklore.org/news/world-oral-literature-project-open-book-publishers-and-unglueit-release-new-open-edition-oral-l">First Book Comes Unglued</a><br />
Open Folklore - September 12, 2012<br />
</div>
<div>
<a href="http://www.thedigitalshift.com/2012/09/roy-tennant-digital-libraries/first-book-comes-unglued/">First Book Comes Unglued</a><br />
The Digital Shift (Library Journal/School Library Journal) - September 12, 2012<br />

View File

@ -20,21 +20,33 @@
Any questions not covered here? Please email us at <a href="mailto:rights@gluejar.com">rights@gluejar.com</a>.
</div></div>
{% if request.user.campaigns.all %}
{% if campaigns %}
<h2>Campaigns You Manage</h2>
<dl>
{% for campaign in request.user.campaigns.all %}
{% for campaign in campaigns %}
<dt>Work: <a href="{% url work work_id=campaign.work.id %}">{{campaign.work.title }}</a></dt>
<dd>
<div class="work_campaigns clearfix">
<div class="campaign_info">
Campaign: {{ campaign.name }}<br />
Campaign status: {{ campaign.status }} <br />
Created: {{ campaign.created }}
</div>
<div>
<a href="{% url manage_campaign campaign.id %}" class="manage">Manage This Campaign</a>
Created: {{ campaign.created }}<br />
${{ campaign.current_total }} pledged of ${{ campaign.target }}, {{ campaign.supporters_count }} supporters
</div>
{% if campaign.status = 'ACTIVE' or campaign.status = 'INITIALIZED' %}
<div>
<a href="{% url manage_campaign campaign.id %}" class="manage">Manage This Campaign</a>
</div>
{% endif %}
{% if campaign.clone_form %}
<div>
<form method="POST" action="#">
{% csrf_token %}
{{ campaign.clone_form }}{{ campaign.clone_form.errors }}
<input type="submit" name="clone" value="Clone this Campaign">
</form>
</div>
{% endif %}
</div>
</dd>
{% endfor %}
@ -51,7 +63,7 @@ Any questions not covered here? Please email us at <a href="mailto:rights@gluej
<br />Date of Claim : {{ claim.created }}
<br />Status of Claim: {{ claim.get_status_display }}
{% if claim.can_open_new %}
<h3>Open a campaign for this work</h3>
<h3>Open a blank campaign for this work</h3>
<form method="POST" action="#">
{% csrf_token %}
<p>Name the Campaign: {{ claim.campaign_form.name }}{{ claim.campaign_form.name.errors }}</p>
@ -67,20 +79,30 @@ Any questions not covered here? Please email us at <a href="mailto:rights@gluej
<h3>Campaigns for this work</h3>
{% for campaign in claim.campaigns %}
<div class="work_campaigns clearfix">
<div class="campaign_info">
Name: Your campaign, "{{ campaign.name }}", is {{ campaign.status }}<br />
Created: {{ campaign.created }}<br />
Manager(s): {% for user in campaign.managers.all %} <a href="{% url supporter user.username %}">{{ user.username }} </a> {% endfor %}
<form method="POST" action="#">{% csrf_token %}
Add/Remove Managers: {{ campaign.edit_managers_form.managers }}{{ campaign.edit_managers_form.managers.errors }}
<input type="submit" name="edit_managers_{{campaign.id}}" value="Save Managers">
</form>
</div>
{% if request.user in campaign.managers.all %}
<div>
<a href="{% url manage_campaign campaign.id %}" class="manage">Manage This Campaign</a>
</div>
{% endif %}
{% if campaign.status = 'ACTIVE' or campaign.status = 'INITIALIZED' %}
<div class="campaign_info">
Name: Your campaign, "{{ campaign.name }}", is {{ campaign.status }}<br />
Created: {{ campaign.created }}<br />
Manager(s): {% for user in campaign.managers.all %} <a href="{% url supporter user.username %}">{{ user.username }} </a> {% endfor %}
<form method="POST" action="#">{% csrf_token %}
Add/Remove Managers: {{ campaign.edit_managers_form.managers }}{{ campaign.edit_managers_form.managers.errors }}
<input type="submit" name="edit_managers_{{campaign.id}}" value="Save Managers">
</form>
</div>
{% if request.user in campaign.managers.all %}
<div>
<a href="{% url manage_campaign campaign.id %}" class="manage">Manage This Campaign</a>
</div>
{% endif %}
{% else %}
<div class="campaign_info">
Name: Your campaign, "{{ campaign.name }}", is {{ campaign.status }}<br />
Created: {{ campaign.created }}<br />
Manager(s): {% for user in campaign.managers.all %} <a href="{% url supporter user.username %}">{{ user.username }} </a> {% endfor %}
<br />
${{ campaign.current_total }} pledged of ${{ campaign.target }}, {{ campaign.supporters_count }} supporters
</div>
{% endif %}
</div>
{% endfor %}
{% endif %}
@ -138,20 +160,19 @@ Any questions not covered here? Please email us at <a href="mailto:rights@gluej
</li>
</ol>
<h2>Rightsholder social media tools</h2>
Needs to be written. What would you find helpful in a social media toolkit? <a href="/feedback">Send us feedback.</a>
<h2>Rewards</h2>
<p>Campaigns have rewards as a way to thank supporters. unglue.it includes a standard set of rewards in all campaigns. You are encouraged to add additional sweeteners to motivate people to contribute.</p>
<p>Campaigns can have rewards as a way to motivate and thank supporters. You are strongly encouraged to add rewards - they are given special prominence on the campaign page.</p>
<p>Here are the standard rewards:</p>
<p>What should you add as rewards? Anything you think you can reasonably deliver that will get supporters excited about the book. For example: other books, whether electronic or physical; artwork or multimedia relating to the book, its author, or its themes; in-person or online chats with the author; memorabilia.</p>
<h2>Acknowledgements</h2>
<p>Here are the standard acknowledgements. These automatically combine with your rewards. For example, if you offer a $30 reward, ungluers who pledge $30 will receive the $25 acknowledgement as well.</p>
<ul class="terms">
<li><em>Any level ($1 minimum)</em> &#8212; The unglued ebook delivered to your inbox</li>
<li><em>$25</em> &#8212; Your username under "supporters" in the acknowledgements section</li>
<li><em>$50</em> &#8212; Your name &amp; profile link under "benefactors"</li>
<li><em>$100</em> &#8212; Your name, profile link, &amp; profile tagline under "bibliophiles"</li>
<li><em>Any amount</em> &#8212; The unglued ebook</li>
<li><em>$25 and above</em> &#8212; Their name in the acknowledgements section under "supporters"</li>
<li><em>$50 and above</em> &#8212; Their name &amp; profile link under "benefactors"</li>
<li><em>$100 and above</em> &#8212; Their name, profile link, &amp; a dedication under "bibliophiles"</li>
</ul>
<h2>More Questions</h2>

View File

@ -7,8 +7,7 @@
<link type="text/css" rel="stylesheet" href="/static/css/campaign.css" />
{% endblock %}
{% block base_js %}
<script type="text/javascript" src="{{ jquery_home }}"></script>
{% block extra_js %}
<script type="text/javascript" src="{{ jquery_ui_home }}"></script>
<script type="text/javascript" src="/static/js/wishlist.js"></script>
<script type="text/javascript" src="/static/js/tabs4.js"></script>
@ -72,27 +71,41 @@ $j(document).ready(function(){
Campaign suspended. <br />See <a href="/faq">FAQ</a>.
{% else %}{% if status == 'WITHDRAWN' %}
Campaign withdrawn. <br />See <a href="/faq">FAQ</a>.
{% else %}{% if wishers == 0 %}
<span class="findtheungluers">No ungluers are wishing yet.</span>
<br />
Be the first!
{% else %}{% if wishers == 1 %}
<span class="findtheungluers">{{ wishers }} Ungluer is wishing</span>
<br />
You can too!
{% else %}
<span class="findtheungluers">{{ wishers }} Ungluers are wishing</span>
{% endif %}
<br />
You can too!
{% endif %}{% endif %}{% endif %}{% endif %}
<br />
You can too!
{% endif %}{% endif %}{% endif %}{% endif %}{% endif %}{% endif %}
{% endif %}
{% else %}
<span class="findtheungluers">
{% if wishers == 1 %}
{{ wishers }} Ungluer is wishing
{% if wishers == 0 %}
<span class="findtheungluers">
No ungluers are wishing yet.
</span>
<br />
Be the first!
{% else %}{% if wishers == 1 %}
<span class="findtheungluers">
{{ wishers }} Ungluer is wishing
</span>
<br />
You can too!
{% else %}
{{ wishers }} Ungluers are wishing
{% endif %}
</span>
<br />
You can too!
<span class="findtheungluers">
{{ wishers }} Ungluers are wishing
</span>
<br />
You can too!
{% endif %}{% endif %}
{% endif %}{% endif %}
</span>
</div>
</div>
{% include "explore.html" %}
@ -139,6 +152,9 @@ $j(document).ready(function(){
{% if work.googlebooks_id %}
<a id="find-google" href="{{ work.googlebooks_url }}"><img src="/static/images/supporter_icons/googlebooks_square.png" title="Find on Google Books" alt="Find on Google Books" /></a>
{% endif %}
{% if work.first_oclc %}
<a rel="nofollow" id="find-oclc" href="http://www.worldcat.org/oclc/{{ work.first_oclc }}"><img src="/static/images/supporter_icons/worldcat_square.png" title="Find on Worldcat" alt="Find on Worldcat" /></a>
{% endif %}
<a rel="nofollow" class="find-openlibrary" href="{% url work_openlibrary work_id %}"><img src="/static/images/supporter_icons/openlibrary_square.png" title="Find on OpenLibrary" alt="Find on OpenLibrary" /></a>
{% if not request.user.is_anonymous %}
{% if request.user.profile.goodreads_user_link %}

View File

@ -46,6 +46,7 @@ urlpatterns = patterns(
url(r"^work/(?P<work_id>\d+)/preview/$", "work", {'action': 'preview'}, name="work_preview"),
url(r"^work/(?P<work_id>\d+)/acks/$", "work", {'action': 'acks'}, name="work_acks"),
url(r"^work/(?P<work_id>\d+)/lockss/$", "lockss", name="lockss"),
url(r"^lockss/(?P<year>\d+)/$", "lockss_manifest", name="lockss_manifest"),
url(r"^work/(?P<work_id>\d+)/download/$", "download", name="download"),
url(r"^work/\d+/acks/images/(?P<file_name>[\w\.]*)$", "static_redirect_view",{'dir': 'images'}),
url(r"^work/(?P<work_id>\d+)/librarything/$", "work_librarything", name="work_librarything"),

View File

@ -4,7 +4,7 @@ import json
import logging
import urllib
from datetime import timedelta
from datetime import timedelta, date
from regluit.utils.localdatetime import now, date_today
from random import randint
@ -48,7 +48,7 @@ from regluit.frontend.forms import UserData, UserEmail, ProfileForm, CampaignPle
from regluit.frontend.forms import RightsHolderForm, UserClaimForm, LibraryThingForm, OpenCampaignForm
from regluit.frontend.forms import getManageCampaignForm, DonateForm, CampaignAdminForm, EmailShareForm, FeedbackForm
from regluit.frontend.forms import EbookForm, CustomPremiumForm, EditManagersForm, EditionForm, PledgeCancelForm
from regluit.frontend.forms import getTransferCreditForm, CCForm
from regluit.frontend.forms import getTransferCreditForm, CCForm, CloneCampaignForm
from regluit.payment.manager import PaymentManager
from regluit.payment.models import Transaction, Account
from regluit.payment.parameters import TRANSACTION_STATUS_ACTIVE, TRANSACTION_STATUS_COMPLETE, TRANSACTION_STATUS_CANCELED, TRANSACTION_STATUS_ERROR, TRANSACTION_STATUS_FAILED, TRANSACTION_STATUS_INCOMPLETE, TRANSACTION_STATUS_NONE, TRANSACTION_STATUS_MODIFIED
@ -249,7 +249,7 @@ def work(request, work_id, action='display'):
'claimstatus': claimstatus,
'rights_holder_name': rights_holder_name,
'countdown': countdown,
})
})
def new_edition(request, work_id, edition_id, by=None):
if not request.user.is_authenticated() :
@ -324,7 +324,13 @@ def new_edition(request, work_id, edition_id, by=None):
work.description=form.cleaned_data['description']
work.title=form.cleaned_data['title']
work.save()
models.Identifier.get_or_add(type='isbn', value=form.cleaned_data['isbn_13'], edition=edition, work=work)
# note: this is very powerful. it can steal an isbn from another edition/work, and it will wipe the changed isbn from the db
models.Identifier.set(type='isbn', value=form.cleaned_data['isbn_13'], edition=edition, work=work)
if form.cleaned_data['oclcnum']:
# note: this is very powerful.(same comment as for isbn) use with care!
models.Identifier.set(type='oclc', value=form.cleaned_data['oclcnum'], edition=edition, work=work)
for author_name in edition.new_author_names:
try:
author= models.Author.objects.get(name=author_name)
@ -343,6 +349,7 @@ def new_edition(request, work_id, edition_id, by=None):
form = EditionForm(instance=edition, initial={
'language':language,
'isbn_13':edition.isbn_13,
'oclcnum':edition.oclc,
'description':description,
'title': title
})
@ -386,7 +393,7 @@ def manage_campaign(request, id):
alerts.append(_('Campaign data has NOT been saved'))
if 'launch' in request.POST.keys():
activetab = '#3'
if (campaign.launchable and form.is_valid()):
if (campaign.launchable and form.is_valid()) and (not settings.IS_PREVIEW or request.user.is_staff):
campaign.activate()
alerts.append(_('Campaign has been launched'))
else:
@ -419,6 +426,7 @@ def manage_campaign(request, id):
'premium_form' : new_premium_form,
'work': work,
'activetab': activetab,
'is_preview': settings.IS_PREVIEW
})
def googlebooks(request, googlebooks_id):
@ -588,7 +596,8 @@ class DonationView(TemplateView):
return self.render_to_response(context)
def get_context_data(self, *args, **kwargs):
context = {'user' : self.request.user}
context = {'user' : self.request.user,'nonprofit': settings.NONPROFIT}
context['donate_form'] = DonateForm(initial={'username':self.request.user.username})
return context
class PledgeView(FormView):
@ -1152,7 +1161,7 @@ def rh_tools(request):
claim.campaigns = claim.work.campaigns.all()
else:
claim.campaigns = []
claim.can_open_new=True
claim.can_open_new=False if claim.work.last_campaign_status in ['ACTIVE','INITIALIZED'] else True
for campaign in claim.campaigns:
if campaign.status in ['ACTIVE','INITIALIZED']:
claim.can_open_new=False
@ -1177,7 +1186,17 @@ def rh_tools(request):
claim.campaign_form = OpenCampaignForm(data={'work': claim.work, 'name': claim.work.title, 'userid': request.user.id, 'managers_1': request.user.id})
else:
claim.can_open_new=False
return render(request, "rh_tools.html", {'claims': claims ,})
campaigns = request.user.campaigns.all()
new_campaign = None
for campaign in campaigns:
if campaign.clonable():
if request.method == 'POST' and request.POST.has_key('c%s-campaign_id'% campaign.id):
clone_form= CloneCampaignForm(data=request.POST, prefix = 'c%s' % campaign.id)
if clone_form.is_valid():
campaign.clone()
else:
campaign.clone_form= CloneCampaignForm(initial={'campaign_id':campaign.id}, prefix = 'c%s' % campaign.id)
return render(request, "rh_tools.html", {'claims': claims ,'campaigns': campaigns})
def rh_admin(request):
if not request.user.is_authenticated() :
@ -1990,7 +2009,7 @@ def campaign_archive_js(request):
def lockss(request, work_id):
"""
manifest pages for lockss harvester
manifest pages for lockss harvester -- individual works
"""
work = safe_get_work(work_id)
try:
@ -2001,6 +2020,22 @@ def lockss(request, work_id):
return render(request, "lockss.html", {'work':work, 'ebooks':ebooks, 'authors':authors})
def lockss_manifest(request, year):
"""
manifest pages for lockss harvester -- yearly indices
(lockss needs pages listing all books unglued by year, with
programmatically determinable URLs)
"""
year = int(year)
start_date = date(year, 1, 1)
end_date = date(year, 12, 31)
try:
ebooks = models.Edition.objects.filter(unglued=True).filter(created__range=(start_date, end_date))
except:
ebooks = None
return render(request, "lockss_manifest.html", {'ebooks':ebooks, 'year': year})
def download(request, work_id):
context = {}
work = safe_get_work(work_id)
@ -2008,10 +2043,16 @@ def download(request, work_id):
unglued_ebooks = work.ebooks().filter(edition__unglued=True)
other_ebooks = work.ebooks().filter(edition__unglued=False)
try:
readmill_epub_url = work.ebooks().filter(format='epub').exclude(provider='Google Books')[0].url
except:
readmill_epub_url = None
context.update({
'unglued_ebooks': unglued_ebooks,
'other_ebooks': other_ebooks
'other_ebooks': other_ebooks,
'readmill_epub_url': readmill_epub_url,
'base_url': settings.BASE_URL
})
return render(request, "download.html", context)

View File

@ -3,9 +3,11 @@ import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from django.contrib.auth.models import User
class Migration(SchemaMigration):
no_dry_run = True
def forwards(self, orm):
# Adding model 'Credit'
@ -17,6 +19,10 @@ class Migration(SchemaMigration):
('last_activity', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
))
db.send_create_signal('payment', ['Credit'])
users = orm['auth.User'].objects.all()
for user in users:
orm.Credit(user=user).save()
# Adding model 'CreditLog'
db.create_table('payment_creditlog', (

View File

@ -24,7 +24,7 @@ https://github.com/aladagemre/django-notification/tarball/master
fabric
paramiko
pyasn1
pycrypto
pycrypto==2.5
django-maintenancemode
django-smtp-ssl
django-ckeditor

52
requirements_relaunch.pip Normal file
View File

@ -0,0 +1,52 @@
Django==1.4.1
Fabric==1.4.3
MySQL-python==1.2.3
Pillow==1.7.7
Pyzotero==0.9.51
South==0.7.6
amqplib==1.0.2
anyjson==0.3.3
billiard==2.7.3.12
#boto==2.3.0
git+ssh://git@github.com/Gluejar/boto.git@2.3.0
celery==3.0.9
distribute==0.6.28
django-celery==3.0.9
django-ckeditor==3.6.2.1
django-endless-pagination==1.1
django-extensions==0.9
django-kombu==0.9.4
django-maintenancemode==0.10
django-nose-selenium==0.7.3
#django-notification==0.2
git+git://github.com/aladagemre/django-notification.git@2927346f4c513a217ac8ad076e494dd1adbf70e1
django-registration==0.8
django-selectable==0.5.2
django-smtp-ssl==1.0
django-social-auth==0.7.5
django-tastypie==0.9.11
feedparser==5.1.2
freebase==1.0.8
httplib2==0.7.5
kombu==2.4.5
lxml==2.3.5
mechanize==0.2.5
mimeparse==0.1.3
nose==1.1.2
oauth2==1.5.211
paramiko==1.7.7.2
pyasn1==0.1.4
pycrypto==2.6
python-dateutil==2.1
python-openid==2.2.5
pytz==2012d
rdflib==2.4.0
redis==2.6.2
requests==0.14.0
selenium==2.25.0
six==1.2.0
ssh==1.7.14
stripe==1.7.4
virtualenv==1.4.9
virtualenvwrapper==3.6
wsgiref==0.1.2

View File

@ -1,57 +1,52 @@
# requirements.pip does not specify versions of the libraries. Here's a modified version of the output from pip freeze
# on March 7, 2012 for which the tests run successfully for https://github.com/Gluejar/regluit/commit/000d78dbd0e377d2b1688a4a1a333df49a0dd11b
# If you were to run pip install -r requirements.pip anew, the tests no longer run perfectly because of the use of
# some later libraries
Django==1.4.1
Fabric==1.4.3
MySQL-python==1.2.3
Pillow==1.7.7
Pyzotero==0.9.51
South==0.7.6
amqplib==1.0.2
anyjson==0.3.1
boto==2.3.0
celery==2.4.6
certifi==0.0.6
django-celery==2.4.2
anyjson==0.3.3
billiard==2.7.3.12
#boto==2.3.0
git+ssh://git@github.com/Gluejar/boto.git@2.3.0
celery==3.0.9
distribute==0.6.28
django-celery==3.0.9
django-ckeditor==3.6.2.1
django-debug-toolbar==0.8.5
django-endless-pagination==1.1
django-extensions==0.7.1
django-extensions==0.9
django-kombu==0.9.4
django-maintenancemode==0.10
django-nose-selenium==0.7.3
django-notification==0.2
django-picklefield==0.1.9
django-profiles==0.2
https://bitbucket.org/ubernostrum/django-registration/get/tip.tar.gz
#django-registration==0.8-alpha-1
django-selectable==0.2
#django-notification==0.2
git+git://github.com/aladagemre/django-notification.git@2927346f4c513a217ac8ad076e494dd1adbf70e1
django-registration==0.8
django-selectable==0.5.2
django-smtp-ssl==1.0
django-social-auth==0.6.1
#https://github.com/toastdriven/django-tastypie/tarball/master
django-social-auth==0.7.5
django-tastypie==0.9.11
Django==1.3.1
Fabric==1.4.1
feedparser==5.1
feedparser==5.1.2
freebase==1.0.8
httplib2==0.7.2
kombu==1.5.1
# lxml requires special handling to install properly
#lxml==2.3.1
httplib2==0.7.5
kombu==2.4.5
lxml==2.3.5
mechanize==0.2.5
mimeparse==0.1.3
MySQL-python==1.2.3
nose==1.1.2
oauth2==1.5.211
paramiko==1.7.7.1
pyasn1==0.1.3
pycrypto==2.5
pyparsing==1.5.6
python-dateutil==1.5
python-digest==1.7
paramiko==1.7.7.2
pyasn1==0.1.4
pycrypto==2.6
python-dateutil==2.1
python-openid==2.2.5
pytz==2012b
Pyzotero==0.9.4
rdflib==3.1.0
redis==2.4.11
requests==0.9.1
selenium==2.24.0
South==0.7.3
ssh==1.7.13
pytz==2012d
rdflib==2.4.0
redis==2.6.2
requests==0.14.0
selenium==2.25.0
six==1.2.0
ssh==1.7.14
stripe==1.7.4
virtualenv==1.4.9
virtualenvwrapper==3.6
wsgiref==0.1.2

View File

@ -284,5 +284,6 @@ MAINTENANCE_MODE = False
MAINTENANCE_IGNORE_URLS = {}
class NONPROFIT:
is_on = True
name = 'Library Renewal'
link = 'http://127.0.0.1:8000/donate_to_campaign/'

View File

@ -3,7 +3,7 @@ from regluit.settings.common import *
DEBUG = False
TEMPLATE_DEBUG = DEBUG
# we are launched!
IS_PREVIEW = False
IS_PREVIEW = True
SITE_ID = 1

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -8,6 +8,10 @@ $j(document).ready(function() {
event.preventDefault();
$j("#lightbox").load( $j(this).attr("href") + " #lightbox_content");
if ($j(this).attr("href").substr(-9,8) == "download") {
jQuery.getScript('https://platform.readmill.com/send.js');
}
// fade-out rest of page elements on expand
$j('#js-topsection').css({"opacity": "0.07"});
$j('.launch_top').css({"opacity": "0.07"});

5
static/js/readmill.js Normal file
View File

@ -0,0 +1,5 @@
(function() {
var st = document.createElement('script'); st.type = 'text/javascript'; st.async = true;
st.src = 'https://platform.readmill.com/send.js';
var p = document.getElementsByTagName('script')[0]; p.parentNode.insertBefore(st, p);
})();