From b5e52effd932ab0fd9e5b557be650296afec45cd Mon Sep 17 00:00:00 2001 From: eric Date: Sat, 28 Oct 2017 18:33:58 -0400 Subject: [PATCH] optimize id access See https://docs.djangoproject.com/en/1.11/topics/db/optimization/#use-forei gn-key-values-directly --- api/resources.py | 2 +- api/tests.py | 4 ++-- core/admin.py | 6 +++--- core/bookloader.py | 18 ++++++++--------- core/loaders/doab.py | 2 +- .../commands/dedupe_ebooks_with_same_urls.py | 8 ++++---- core/models/__init__.py | 8 ++++---- core/models/bibmodels.py | 6 +++--- core/signals.py | 6 +++--- core/tests.py | 2 +- frontend/forms/bibforms.py | 2 +- frontend/templates/ebook_list.html | 2 +- frontend/templates/edit_edition.html | 12 +++++------ frontend/templates/edition_uploads.html | 4 ++-- frontend/templates/front_matter.html | 4 ++-- frontend/templates/home.html | 6 +++--- frontend/templates/lockss_manifest.html | 2 +- frontend/templates/manage_account.html | 4 ++-- frontend/templates/manage_campaign.html | 18 ++++++++--------- frontend/templates/manage_ebooks.html | 10 +++++----- frontend/templates/metrics.html | 4 ++-- .../notification/library_borrow/full.txt | 4 ++-- .../notification/library_borrow/notice.html | 6 +++--- .../notification/library_reserve/full.txt | 4 ++-- .../notification/library_reserve/notice.html | 6 +++--- .../notification/pledge_charged/full.txt | 2 +- .../notification/pledge_charged/notice.html | 6 +++--- .../notification/pledge_failed/full.txt | 2 +- .../notification/pledge_failed/notice.html | 6 +++--- .../pledge_status_change/full.txt | 2 +- .../pledge_status_change/notice.html | 2 +- .../templates/notification/pledge_summary.txt | 2 +- .../pledge_you_have_pledged/full.txt | 6 +++--- .../pledge_you_have_pledged/notice.html | 8 ++++---- .../notification/purchase_complete/full.txt | 6 +++--- .../purchase_complete/notice.html | 8 ++++---- .../notification/purchase_gift/full.txt | 2 +- .../notification/purchase_gift/notice.html | 6 +++--- .../purchase_gift_waiting/full.txt | 2 +- .../purchase_gift_waiting/notice.html | 6 +++--- .../purchase_got_gift/notice.html | 2 +- .../purchase_notgot_gift/notice.html | 2 +- .../notification/rights_holder_claim/full.txt | 6 +++--- .../rights_holder_claim/notice.html | 8 ++++---- .../notification/wishlist_active/full.txt | 10 +++++----- .../notification/wishlist_active/notice.html | 10 +++++----- .../wishlist_near_deadline/full.txt | 8 ++++---- .../wishlist_near_deadline/notice.html | 6 +++--- .../wishlist_near_target/full.txt | 6 +++--- .../wishlist_near_target/notice.html | 6 +++--- .../wishlist_premium_limited_supply/full.txt | 2 +- .../notice.html | 4 ++-- .../notification/wishlist_price_drop/full.txt | 6 +++--- .../wishlist_price_drop/notice.html | 6 +++--- .../notification/wishlist_successful/full.txt | 2 +- .../wishlist_successful/notice.html | 4 ++-- .../wishlist_unsuccessful/full.txt | 2 +- .../wishlist_unsuccessful/notice.html | 4 ++-- .../wishlist_unsuccessful_amazon/full.txt | 2 +- .../wishlist_unsuccessful_amazon/notice.html | 4 ++-- .../notification/wishlist_updated/full.txt | 2 +- .../notification/wishlist_updated/notice.html | 4 ++-- .../wishlist_work_claimed/full.txt | 2 +- .../wishlist_work_claimed/notice.html | 6 +++--- frontend/templates/rh_tools.html | 10 +++++----- frontend/templates/rights_holders.html | 4 ++-- frontend/views/__init__.py | 20 +++++++++---------- frontend/views/bibedit.py | 4 ++-- 68 files changed, 184 insertions(+), 184 deletions(-) diff --git a/api/resources.py b/api/resources.py index 9b8a59fb..bab1fc0d 100755 --- a/api/resources.py +++ b/api/resources.py @@ -86,7 +86,7 @@ class CampaignResource(ModelResource): wishlist_work_ids = [] for o in data['objects']: - o.data['in_wishlist'] = o.obj.work.id in wishlist_work_ids + o.data['in_wishlist'] = o.obj.work_id in wishlist_work_ids # there's probably a better place up the chain (where the Campaign objects are directly available) to grab the status c = models.Campaign.objects.get(id=o.data["id"]) o.data['status'] = c.status diff --git a/api/tests.py b/api/tests.py index 818ff78f..88581979 100755 --- a/api/tests.py +++ b/api/tests.py @@ -26,7 +26,7 @@ class ApiTests(TestCase): def setUp(self): edition = models.Edition.objects.get(pk=1) - self.work_id=edition.work.id + self.work_id=edition.work_id campaign = models.Campaign.objects.create( name=edition.work.title, work=edition.work, @@ -155,7 +155,7 @@ class FeedTests(TestCase): def setUp(self): edition = models.Edition.objects.get(pk=1) ebook = models.Ebook.objects.create(edition=edition, url='http://example.org/', format='epub', rights='CC BY') - self.test_work_id = edition.work.id + self.test_work_id = edition.work_id def test_opds(self): r = self.client.get('/api/opds/creative_commons/') diff --git a/core/admin.py b/core/admin.py index cc87246f..f95d1612 100644 --- a/core/admin.py +++ b/core/admin.py @@ -179,13 +179,13 @@ class EbookFileAdmin(ModelAdmin): readonly_fields = ('file', 'edition_link', 'ebook_link', 'ebook') def edition_link(self, obj): if obj.edition: - link = reverse("admin:core_edition_change", args=[obj.edition.id]) + link = reverse("admin:core_edition_change", args=[obj.edition_id]) return u'%s' % (link,obj.edition) else: return u'' def ebook_link(self, obj): if obj.ebook: - link = reverse("admin:core_ebook_change", args=[obj.ebook.id]) + link = reverse("admin:core_ebook_change", args=[obj.ebook_id]) return u'%s' % (link,obj.ebook) else: return u'' @@ -206,7 +206,7 @@ class GiftAdmin(ModelAdmin): search_fields = ('giver__username', 'to') readonly_fields = ('giver', 'acq',) def acq_admin_link(self, gift): - return "%s" % (gift.acq.id, gift.acq) + return "%s" % (gift.acq_id, gift.acq) acq_admin_link.allow_tags = True class CeleryTaskAdmin(ModelAdmin): diff --git a/core/bookloader.py b/core/bookloader.py index 8eaa6bd8..5623d381 100755 --- a/core/bookloader.py +++ b/core/bookloader.py @@ -410,8 +410,8 @@ def relate_isbn(isbn, cluster_size=1): if related_edition.work is None: related_edition.work = edition.work related_edition.save() - elif related_edition.work.id != edition.work.id: - logger.debug("merge_works path 1 %s %s", edition.work.id, related_edition.work.id ) + elif related_edition.work_id != edition.work_id: + logger.debug("merge_works path 1 %s %s", edition.work_id, related_edition.work_id ) merge_works(related_edition.work, edition.work) if related_edition.work.editions.count()>cluster_size: return related_edition.work @@ -449,8 +449,8 @@ def add_related(isbn): if related_edition.work is None: related_edition.work = work related_edition.save() - elif related_edition.work.id != work.id: - logger.debug("merge_works path 1 %s %s", work.id, related_edition.work.id ) + elif related_edition.work_id != work.id: + logger.debug("merge_works path 1 %s %s", work.id, related_edition.work_id ) work = merge_works(work, related_edition.work) else: if other_editions.has_key(related_language): @@ -460,14 +460,14 @@ def add_related(isbn): # group the other language editions together for lang_group in other_editions.itervalues(): - logger.debug("lang_group (ed, work): %s", [(ed.id, ed.work.id) for ed in lang_group]) + logger.debug("lang_group (ed, work): %s", [(ed.id, ed.work_id) for ed in lang_group]) if len(lang_group)>1: lang_edition = lang_group[0] logger.debug("lang_edition.id: %s", lang_edition.id) # compute the distinct set of works to merge into lang_edition.work works_to_merge = set([ed.work for ed in lang_group[1:]]) - set([lang_edition.work]) for w in works_to_merge: - logger.debug("merge_works path 2 %s %s", lang_edition.work.id, w.id ) + logger.debug("merge_works path 2 %s %s", lang_edition.work_id, w.id ) merged_work = merge_works(lang_edition.work, w) models.WorkRelation.objects.get_or_create( to_work=lang_group[0].work, @@ -749,7 +749,7 @@ def load_from_yaml(yaml_url, test_mode=False): for metadata in all_metadata.get_edition_list(): edition = loader.load_from_pandata(metadata) loader.load_ebooks(metadata, edition, test_mode) - return edition.work.id if edition else None + return edition.work_id if edition else None def edition_for_ident(id_type, id_value): #print 'returning edition for {}: {}'.format(id_type, id_value) @@ -820,9 +820,9 @@ class BasePandataLoader(object): value = value[0] if isinstance(value, list) else value try: id = models.Identifier.objects.get(type=id_code, value=value) - if work and id.work and id.work.id is not work.id: + if work and id.work and id.work_id is not work.id: # dangerous! merge newer into older - if work.id < id.work.id: + if work.id < id.work_id: merge_works(work, id.work) else: merge_works(id.work, work) diff --git a/core/loaders/doab.py b/core/loaders/doab.py index b6e887e1..8b863026 100644 --- a/core/loaders/doab.py +++ b/core/loaders/doab.py @@ -129,7 +129,7 @@ def add_all_isbns(isbns, work, language=None, title=None): edition = bookloader.add_by_isbn(isbn, work, language=language, title=title) if edition: first_edition = first_edition if first_edition else edition - if work and (edition.work.id != work.id): + if work and (edition.work_id != work.id): if work.created < edition.work.created: work = merge_works(work, edition.work) else: diff --git a/core/management/commands/dedupe_ebooks_with_same_urls.py b/core/management/commands/dedupe_ebooks_with_same_urls.py index 0a255616..e2d53ede 100644 --- a/core/management/commands/dedupe_ebooks_with_same_urls.py +++ b/core/management/commands/dedupe_ebooks_with_same_urls.py @@ -8,15 +8,15 @@ def delete_newest_ebooks(ebooks): """ for ebook in sorted(ebooks, key=lambda ebook: ebook.created)[1:]: print "deleting ebook.id {}, edition.id {} work.id {}".format(ebook.id, - ebook.edition.id, - ebook.edition.work.id) + ebook.edition_id, + ebook.edition.work_id) ebook.delete() intact = ebooks[0] print "leaving undeleted: ebook.id {}, edition.id {} work.id {}".format( intact.id, - intact.edition.id, - intact.edition.work.id + intact.edition_id, + intact.edition.work_id ) diff --git a/core/models/__init__.py b/core/models/__init__.py index 744e417f..54d6596d 100755 --- a/core/models/__init__.py +++ b/core/models/__init__.py @@ -344,7 +344,7 @@ class Acq(models.Model): 'exlibris':0, 'chapterfooter': 0, 'disclaimer':0, - 'referenceid': '%s:%s:%s' % (self.work.id, self.user.id, self.id) if do_watermark else 'N/A', + 'referenceid': '%s:%s:%s' % (self.work_id, self.user_id, self.id) if do_watermark else 'N/A', 'kf8mobi': True, 'epub': True, } @@ -355,7 +355,7 @@ class Acq(models.Model): return self.watermarked def _hash(self): - return hashlib.md5('%s:%s:%s:%s'%(settings.SOCIAL_AUTH_TWITTER_SECRET, self.user.id, self.work.id, self.created)).hexdigest() + return hashlib.md5('%s:%s:%s:%s'%(settings.SOCIAL_AUTH_TWITTER_SECRET, self.user_id, self.work_id, self.created)).hexdigest() def expire_in(self, delta): self.expires = (now() + delta) if delta else now() @@ -1080,7 +1080,7 @@ class Campaign(models.Model): format=format, rights=self.license, provider="Unglue.it", - url=settings.BASE_URL_SECURE + reverse('download_campaign', args=[self.work.id, format]), + url=settings.BASE_URL_SECURE + reverse('download_campaign', args=[self.work_id, format]), version='unglued', ) old_ebooks = Ebook.objects.exclude(pk=ebook.pk).filter( @@ -1105,7 +1105,7 @@ class Campaign(models.Model): 'exlibris':0, 'chapterfooter':0, 'disclaimer':0, - 'referenceid': '%s:%s:%s' % (self.work.id, self.id, self.license), + 'referenceid': '%s:%s:%s' % (self.work_id, self.id, self.license), 'kf8mobi': True, 'epub': True, } diff --git a/core/models/bibmodels.py b/core/models/bibmodels.py index 0ce8dc41..08cfb3b8 100644 --- a/core/models/bibmodels.py +++ b/core/models/bibmodels.py @@ -82,11 +82,11 @@ class Identifier(models.Model): identifier = Identifier.objects.create(type=type, value=value, work=work) else: identifier = Identifier.objects.create(type=type, value=value, work=work, edition=edition) - if identifier.work.id != work.id: + if identifier.work_id != work.id: identifier.work = work identifier.save() if identifier.edition and edition: - if identifier.edition.id != edition.id: + if identifier.edition_id != edition.id: identifier.edition = edition identifier.save() others = Identifier.objects.filter(type=type, work=work, edition=edition).exclude(value=value) @@ -961,7 +961,7 @@ class Edition(models.Model): return self.ebooks.filter(active=True) def download_via_url(self): - return settings.BASE_URL_SECURE + reverse('download', args=[self.work.id]) + return settings.BASE_URL_SECURE + reverse('download', args=[self.work_id]) def authnames(self): return [auth.last_name_first for auth in self.authors.all()] diff --git a/core/signals.py b/core/signals.py index debc118d..7134c1ba 100644 --- a/core/signals.py +++ b/core/signals.py @@ -107,8 +107,8 @@ from django_comments.signals import comment_was_posted def notify_comment(comment, request, **kwargs): logger.info('comment %s notifying' % comment.pk) - other_commenters = User.objects.filter(comment_comments__content_type=comment.content_type, comment_comments__object_pk=comment.object_pk).distinct().exclude(id=comment.user.id) - all_wishers = comment.content_object.wished_by().exclude(id=comment.user.id) + other_commenters = User.objects.filter(comment_comments__content_type=comment.content_type, comment_comments__object_pk=comment.object_pk).distinct().exclude(id=comment.user_id) + all_wishers = comment.content_object.wished_by().exclude(id=comment.user_id) other_wishers = all_wishers.exclude(id__in=other_commenters) domain = Site.objects.get_current().domain if comment.content_object.last_campaign() and comment.user in comment.content_object.last_campaign().managers.all(): @@ -177,7 +177,7 @@ def handle_transaction_charged(sender,transaction=None, **kwargs): if transaction.offer.license == LIBRARY: library = Library.objects.get(id=transaction.extra['library_id']) new_acq = Acq.objects.create(user=library.user,work=transaction.campaign.work,license= LIBRARY) - if transaction.user.id != library.user.id: # don't put it on reserve if purchased by the library + if transaction.user_id != library.user_id: # don't put it on reserve if purchased by the library reserve_acq = Acq.objects.create(user=transaction.user,work=transaction.campaign.work,license= RESERVE, lib_acq = new_acq) reserve_acq.expire_in(datetime.timedelta(hours=2)) copies = int(transaction.extra.get('copies',1)) diff --git a/core/tests.py b/core/tests.py index 2578d502..29e01483 100755 --- a/core/tests.py +++ b/core/tests.py @@ -230,7 +230,7 @@ class BookLoaderTests(TestCase): back_point = True to_works = [wr.to_work for wr in edition.work.works_related_from.all()] for to_work in to_works: - if edition.work.id not in [wr1.from_work.id for wr1 in to_work.works_related_to.all()]: + if edition.work_id not in [wr1.from_work.id for wr1 in to_work.works_related_to.all()]: back_point = False break self.assertTrue(back_point) diff --git a/frontend/forms/bibforms.py b/frontend/forms/bibforms.py index bb5fa70c..a5b43ee0 100644 --- a/frontend/forms/bibforms.py +++ b/frontend/forms/bibforms.py @@ -154,7 +154,7 @@ class EditionForm(forms.ModelForm): if id_value: identifier = Identifier.objects.filter(type=id_type, value=id_value) if identifier: - err_msg = "{} is a duplicate for work #{}.".format(identifier[0], identifier[0].work.id) + err_msg = "{} is a duplicate for work #{}.".format(identifier[0], identifier[0].work_id) self.add_error('id_value', forms.ValidationError(err_msg)) try: self.cleaned_data['value'] = identifier_cleaner(id_type)(id_value) diff --git a/frontend/templates/ebook_list.html b/frontend/templates/ebook_list.html index 4efa230b..aea67882 100644 --- a/frontend/templates/ebook_list.html +++ b/frontend/templates/ebook_list.html @@ -4,7 +4,7 @@ {% for ebook in work.ebooks_all %}
  • {{ ebook.format }}, {{ ebook.rights }}, created {{ ebook.created }}{% if ebook.user %}, -by {{ ebook.user }}{% endif %}. +by {{ ebook.user }}{% endif %}. {% if ebook.filesize %}{{ ebook.filesize }}{% else %}??{% endif %}B {% if ebook.version_label %}{{ ebook.version }}{% endif %} {% if ebook.active %}{% else %}{% endif %} diff --git a/frontend/templates/edit_edition.html b/frontend/templates/edit_edition.html index 81b71a98..21a457e7 100644 --- a/frontend/templates/edit_edition.html +++ b/frontend/templates/edit_edition.html @@ -59,7 +59,7 @@ ul.fancytree-container { // perform action {% if edition.work %} - jQuery.post('{% url 'kw_edit' edition.work.id %}', {'remove_kw': kw, 'csrfmiddlewaretoken': '{{ csrf_token }}' }, function(data) { + jQuery.post('{% url 'kw_edit' edition.work_id %}', {'remove_kw': kw, 'csrfmiddlewaretoken': '{{ csrf_token }}' }, function(data) { li.html('kw removed'); }); {% else %} @@ -88,7 +88,7 @@ ul.fancytree-container { {% block doccontent %} {% if admin %} {% if edition.pk %} -

    Edit Edition for {{ edition.work.title }}

    +

    Edit Edition for {{ edition.work.title }}

    {% else %}

    Create New Edition

    {% endif %} @@ -225,20 +225,20 @@ ul.fancytree-container {

    More Edition Management

    -
    Merge other works into this one
    -
    Remove editions from this work
    +
    Merge other works into this one
    +
    Remove editions from this work
    {% if edition.id %}
    Add ebooks for this edition
    {% endif %} {% if request.user.is_staff %} -
    Feature this work today
    +
    Feature this work today
    {% endif %}
    {% endif %} {% else %} {% if edition.work %} -

    {{ edition.work.title }} was added to Unglue.it on {{ edition.work.created }}

    +

    {{ edition.work.title }} was added to Unglue.it on {{ edition.work.created }}

    {% include 'edition_display.html' %}
    Are you the author or other rightsholder for this work? diff --git a/frontend/templates/edition_uploads.html b/frontend/templates/edition_uploads.html index bf7d5bc3..cc645a50 100644 --- a/frontend/templates/edition_uploads.html +++ b/frontend/templates/edition_uploads.html @@ -3,7 +3,7 @@ {% block doccontent %}
    - Title: {{ edition.title}}
    + Title: {{ edition.title}}
    Publisher : {{ edition.publisher_name }}
    Authors:
      @@ -93,7 +93,7 @@ For ePUB files, use the epubcheck<

      More Edition Management

      -
      + {% if edition.work.last_campaign %} diff --git a/frontend/templates/front_matter.html b/frontend/templates/front_matter.html index a325268a..a65239c4 100644 --- a/frontend/templates/front_matter.html +++ b/frontend/templates/front_matter.html @@ -28,7 +28,7 @@

      © {{ campaign.work.preferred_edition.publication_date }} by {{ campaign.work.authors_short }}

      ISBN: {{ campaign.work.preferred_edition.isbn_13 }} .

      -

      URI: https://unglue.it/work/{{ campaign.work.id }}/ (this work).

      +

      URI: https://unglue.it/work/{{ campaign.work_id }}/ (this work).

      unglue.it logo

      This unglued edition is distributed under the terms of the Creative Commons {{ campaign.license }} license. To view a copy of this license, visit {{ campaign.license_url }}. @@ -97,7 +97,7 @@

      If you're reading this book on an internet-connected device, you can also share it with your friends:

        - {% url 'work' campaign.work.id as work_url %} + {% url 'work' campaign.work_id as work_url %}
      • Email it
      • Tweet it
      • Share it on Facebook
      • diff --git a/frontend/templates/home.html b/frontend/templates/home.html index 285295cd..0e8839fd 100755 --- a/frontend/templates/home.html +++ b/frontend/templates/home.html @@ -238,7 +238,7 @@ function put_un_in_cookie2(){ {% elif object.campaign.type == 3 %} supported {% endif %}
        - {{ object.campaign.work.title }} + {{ object.campaign.work.title }} {% else %} @@ -247,7 +247,7 @@ function put_un_in_cookie2(){ Anonymous User
        supported
        - {{ object.campaign.work.title }} + {{ object.campaign.work.title }}
        {% endif %} {% elif event.2 == "comment" %} @@ -266,7 +266,7 @@ function put_un_in_cookie2(){ {{ object.wishlist.user.username }}
        faved
        - {{ object.work.title }} + {{ object.work.title }}
        {% endif %} {% endwith %} diff --git a/frontend/templates/lockss_manifest.html b/frontend/templates/lockss_manifest.html index a889662f..11ad357a 100644 --- a/frontend/templates/lockss_manifest.html +++ b/frontend/templates/lockss_manifest.html @@ -7,7 +7,7 @@ {% block content %} Books unglued in {{ year }} for the LOCKSS harvester to crawl.

        {% for ebook in ebooks %} - {{ ebook.work.title }}
        + {{ ebook.work.title }}
        {% endfor %} {% endblock %} diff --git a/frontend/templates/manage_account.html b/frontend/templates/manage_account.html index f3181444..2e5af3f3 100644 --- a/frontend/templates/manage_account.html +++ b/frontend/templates/manage_account.html @@ -92,8 +92,8 @@ You can complete your last transaction by Your Pledges
        {% for transaction in request.user.profile.pledges %} -
        {{ transaction.campaign.work.title }} - (modify pledge)
        +
        {{ transaction.campaign.work.title }} + (modify pledge)
        {% include "trans_summary.html" %}
        diff --git a/frontend/templates/manage_campaign.html b/frontend/templates/manage_campaign.html index 4cbd6a45..d4afbef8 100644 --- a/frontend/templates/manage_campaign.html +++ b/frontend/templates/manage_campaign.html @@ -94,9 +94,9 @@ Please fix the following before launching your campaign:
        {% ifequal campaign_status 'INITIALIZED' %} - Preview Your Campaign + Preview Your Campaign {% else %} - See Your Campaign + See Your Campaign {% endifequal %}
        @@ -136,7 +136,7 @@ Please fix the following before launching your campaign:

        Edition {{ edition.id }}:

          -
        • Edit this edition
        • +
        • Edit this edition
        • {% ifnotequal campaign.type 1 %} {% if campaign.rh.can_sell %} {% if edition.ebook_files.all.0 %} @@ -159,7 +159,7 @@ Please fix the following before launching your campaign: {% endif %} {% if campaign.work.epubfiles.0 %} {% for ebf in campaign.work.epubfiles %} -

          {% if ebf.active %}ACTIVE {% elif ebf.ebook.active %} MIRROR {% endif %}EPUB file: {{ebf.file}}
          created {{ebf.created}} for edition {{ebf.edition.id}} {% if ebf.asking %}(This file has had the campaign 'ask' added.){% endif %}
          {% if ebf.active %}{% ifequal action 'mademobi' %}A MOBI file is being generated. (Takes a minute or two.) {% else %}You can generate a MOBI file. {% endifequal %}{% endif %}

          +

          {% if ebf.active %}ACTIVE {% elif ebf.ebook.active %} MIRROR {% endif %}EPUB file: {{ebf.file}}
          created {{ebf.created}} for edition {{ebf.edition_id}} {% if ebf.asking %}(This file has had the campaign 'ask' added.){% endif %}
          {% if ebf.active %}{% ifequal action 'mademobi' %}A MOBI file is being generated. (Takes a minute or two.) {% else %}You can generate a MOBI file. {% endifequal %}{% endif %}

          {% endfor %} {% if campaign.work.test_acqs.0 %}
            @@ -170,12 +170,12 @@ Please fix the following before launching your campaign: {% endif %} {% if campaign.work.mobifiles.0 %} {% for ebf in campaign.work.mobifiles %} -

            {% if ebf.active %}ACTIVE {% endif %}MOBI file: {{ebf.file}}
            created {{ebf.created}} for edition {{ebf.edition.id}} {% if ebf.asking %}(This file has had the campaign 'ask' added.){% endif %}

            +

            {% if ebf.active %}ACTIVE {% endif %}MOBI file: {{ebf.file}}
            created {{ebf.created}} for edition {{ebf.edition_id}} {% if ebf.asking %}(This file has had the campaign 'ask' added.){% endif %}

            {% endfor %} {% endif %} {% if campaign.work.pdffiles.0 %} {% for ebf in campaign.work.pdffiles %} -

            {% if ebf.active %}ACTIVE {% endif %}PDF file: {{ebf.file}}
            created {{ebf.created}} for edition {{ebf.edition.id}} {% if ebf.asking %}(This file has had the campaign 'ask' added.){% endif %}

            +

            {% if ebf.active %}ACTIVE {% endif %}PDF file: {{ebf.file}}
            created {{ebf.created}} for edition {{ebf.edition_id}} {% if ebf.asking %}(This file has had the campaign 'ask' added.){% endif %}

            {% endfor %} {% endif %} {% ifnotequal campaign_status 'ACTIVE' %} @@ -294,7 +294,7 @@ Please fix the following before launching your campaign: Once the user has clicked a "Download" button or a "Read it Now" button, you have a chance for an "ask" - that's where a user can decide to also make a thank-you contribution. The "ask" will be displayed to a user who has clicked a "Download" button. It's your chance to ask for their support. The user can decide to make a contribution and go enter a credit card, or can scroll down to download. - To see your request in test mode, click here.

            + To see your request in test mode, click here.

            A strong ask/motivation combination:

            {% else %}

            This will be displayed in the Campaign tab for your work. It's your main pitch to supporters/purchasers, and your chance to share your passion for this work, and to inspire readers..

            @@ -485,7 +485,7 @@ Please fix the following before launching your campaign:

            Before you hit launch:

            If it doesn't look exactly the way you like, or you're having any trouble with your description, we're happy to help; please contact us.

            @@ -529,7 +529,7 @@ Please fix the following before launching your campaign: {% endif %} {% ifequal campaign.type 1 %}

            Acknowledgements

            -

            When you're logged in, the "Ungluers" tab on the campaign page will tell you a bit about each ungluer- when they last pledged, for example, and you can send individual messages to each ungluer. Use this tool with care! You can see who your biggest supporters are by looking at the sample acknowledgement page. +

            When you're logged in, the "Ungluers" tab on the campaign page will tell you a bit about each ungluer- when they last pledged, for example, and you can send individual messages to each ungluer. Use this tool with care! You can see who your biggest supporters are by looking at the sample acknowledgement page. After your campaign succeeds, you can used this page to generate epub code for the acknowledgements section of your unglued ebook.

            {% else %} diff --git a/frontend/templates/manage_ebooks.html b/frontend/templates/manage_ebooks.html index 715c69dd..157cf690 100644 --- a/frontend/templates/manage_ebooks.html +++ b/frontend/templates/manage_ebooks.html @@ -31,7 +31,7 @@ onload = function(){ {% block doccontent %} -

            Add Ebook Links for {{ edition.work.title }}

            +

            Add Ebook Links for {{ edition.work.title }}

            {% if edition.publisher %} Publisher: {{edition.publisher}}
            {% endif %} @@ -51,10 +51,10 @@ onload = function(){ {% if request.user.is_staff %}

            More Edition Management

            - - - - + + + + {% endif %}
            {% endblock %} diff --git a/frontend/templates/metrics.html b/frontend/templates/metrics.html index a55e4bd8..8ec59e9c 100644 --- a/frontend/templates/metrics.html +++ b/frontend/templates/metrics.html @@ -88,7 +88,7 @@
            • {{ ebooks.today.count }} have been added today. {% if ebooks.today.count %}They are {% endif %}
            • {{ ebooks.yesterday.count }} were added yesterday. @@ -118,7 +118,7 @@
            • {{ ebookfiles.days7.count }} have been added in the past 7 days.{% if request.user.is_staff %}
                {% for ebook_file in ebookfiles.days7 %}
              • {{ebook_file.edition.work.title}}: {{ebook_file.file}} created {{ebook_file.created}} by {{ebook_file.ebook.user}}
                - ({% if not ebook_file.ebook.active %}in{% endif %}active) edit + ({% if not ebook_file.ebook.active %}in{% endif %}active) edit
              • {% endfor %}
              {% endif %} diff --git a/frontend/templates/notification/library_borrow/full.txt b/frontend/templates/notification/library_borrow/full.txt index 4e661fda..8d5c3d8e 100644 --- a/frontend/templates/notification/library_borrow/full.txt +++ b/frontend/templates/notification/library_borrow/full.txt @@ -1,10 +1,10 @@ You have borrowed {{ acq.work.title }} from {{ acq.lib_acq.user.username }}. During the borrowing period, you can download the ebook at the book's download page: -https://{{ current_site.domain }}{% url 'download' acq.work.id %} +https://{{ current_site.domain }}{% url 'download' acq.work_id %} This ebook is made available to you by {{ acq.lib_acq.user.username }} for your personal use only, and a personal license has been embedded in the ebook file. You may download as many times as you need to until {{ acq.expires }}. If you want to use the ebook after that, please consider buying a copy for yourself. Doing so will bring closer the day when this ebook is free for everyone to read. For more information about the book, visit the book's unglue.it page at -https://{{ current_site.domain }}{% url 'work' acq.work.id %} +https://{{ current_site.domain }}{% url 'work' acq.work_id %} Thank you again for your support. diff --git a/frontend/templates/notification/library_borrow/notice.html b/frontend/templates/notification/library_borrow/notice.html index 420eaa23..d48e12ce 100644 --- a/frontend/templates/notification/library_borrow/notice.html +++ b/frontend/templates/notification/library_borrow/notice.html @@ -2,18 +2,18 @@ {% block comments_book %} - cover image for {{ acq.work.title }} + cover image for {{ acq.work.title }} {% endblock %} {% block comments_graphical %} - You have borrowed {{ acq.work.title }} from {{ acq.lib_acq.user.username }}. During the borrowing period, you can download the ebook at the book's download page. + You have borrowed {{ acq.work.title }} from {{ acq.lib_acq.user.username }}. During the borrowing period, you can download the ebook at the book's download page. {% endblock %} {% block comments_textual %}

              This ebook is made available to you by {{ acq.lib_acq.user.username }} for your personal use only, and a personal license has been embedded in the ebook file. You may download as many times as you need to until {{ acq.expires }}. If you want to use the ebook after that, please consider buying a copy for yourself. Doing so will bring closer the day when this ebook is free for everyone to read.

              -

              For more information about the book, visit the book's unglue.it page. +

              For more information about the book, visit the book's unglue.it page.

              {{ acq.lib_acq.user.username }} and the Unglue.it team

              diff --git a/frontend/templates/notification/library_reserve/full.txt b/frontend/templates/notification/library_reserve/full.txt index 39a8c3b6..1ec3c414 100644 --- a/frontend/templates/notification/library_reserve/full.txt +++ b/frontend/templates/notification/library_reserve/full.txt @@ -1,11 +1,11 @@ {{ acq.work.title }} is reserved for you from {{ acq.lib_acq.user.username }} until {{ acq.expires }}. You can borrow the ebook by downloading it from the book's download page: -https://{{ current_site.domain }}{% url 'download' acq.work.id %} +https://{{ current_site.domain }}{% url 'download' acq.work_id %} If you don't download the book before {{ acq.expires }}, other members of {{ acq.lib_acq.user.username }} will be able to use it instead. This ebook is made available to you by {{ acq.lib_acq.user.username }} for your personal use only, and a personal license will be embedded in the ebook file. If you do not download the ebook before then, the ebook may be borrowed by another {{ acq.lib_acq.user.username }} member. For more information about the book, visit the book's unglue.it page at -https://{{ current_site.domain }}{% url 'work' acq.work.id %} +https://{{ current_site.domain }}{% url 'work' acq.work_id %} {{ acq.lib_acq.user.username }} and the Unglue.it team \ No newline at end of file diff --git a/frontend/templates/notification/library_reserve/notice.html b/frontend/templates/notification/library_reserve/notice.html index 9074abc9..f5b2ac21 100644 --- a/frontend/templates/notification/library_reserve/notice.html +++ b/frontend/templates/notification/library_reserve/notice.html @@ -2,18 +2,18 @@ {% block comments_book %} - cover image for {{ acq.work.title }} + cover image for {{ acq.work.title }} {% endblock %} {% block comments_graphical %} - {{ acq.work.title }} is reserved for you from {{ acq.lib_acq.user.username }} until {{ acq.expires }}. Until then, you can borrow the ebook at the book's download page. + {{ acq.work.title }} is reserved for you from {{ acq.lib_acq.user.username }} until {{ acq.expires }}. Until then, you can borrow the ebook at the book's download page. {% endblock %} {% block comments_textual %}

              This ebook is made available to you by {{ acq.lib_acq.user.username }} for your personal use only, and a personal license will be embedded in the ebook file. If you do not download the ebook before then, the ebook may be borrowed by another {{ acq.lib_acq.user.username }} member.

              -

              For more information about the book, visit the book's unglue.it page. +

              For more information about the book, visit the book's unglue.it page.

              {{ acq.lib_acq.user.username }} and the Unglue.it team

              diff --git a/frontend/templates/notification/pledge_charged/full.txt b/frontend/templates/notification/pledge_charged/full.txt index f4427ebc..5d4ce7fd 100644 --- a/frontend/templates/notification/pledge_charged/full.txt +++ b/frontend/templates/notification/pledge_charged/full.txt @@ -8,7 +8,7 @@ Pledge summary We will notify you when the unglued ebook is available for you to read. If you've requested special premiums, the campaign manager, {{ transaction.campaign.rightsholder }}, will be in touch with you via email to request any information needed to deliver your premium. If you'd like to visit the campaign page, click here: -https://{{ current_site.domain }}{% url 'work' transaction.campaign.work.id %} +https://{{ current_site.domain }}{% url 'work' transaction.campaign.work_id %} Thank you again for your support. diff --git a/frontend/templates/notification/pledge_charged/notice.html b/frontend/templates/notification/pledge_charged/notice.html index fcb23ff8..7f623b8e 100644 --- a/frontend/templates/notification/pledge_charged/notice.html +++ b/frontend/templates/notification/pledge_charged/notice.html @@ -3,11 +3,11 @@ {% load humanize %} {% block comments_book %} - cover image for {{ transaction.campaign.work.title }} + cover image for {{ transaction.campaign.work.title }} {% endblock %} {% block comments_graphical %} - Hooray! The campaign for {{ transaction.campaign.work.title }} has succeeded. Your credit card has been charged ${{ transaction.amount|floatformat:2|intcomma }}. Thank you again for your help. + Hooray! The campaign for {{ transaction.campaign.work.title }} has succeeded. Your credit card has been charged ${{ transaction.amount|floatformat:2|intcomma }}. Thank you again for your help. {% endblock %} {% block comments_textual %} @@ -21,7 +21,7 @@

              We will notify you when the unglued ebook is available for you to read. If you've requested special premiums, the campaign manager, {{ transaction.campaign.rightsholder }}, will be in touch with you via email to request any information needed to deliver your premium.

              -

              For more information, visit the campaign page. +

              For more information, visit the campaign page.

              Thank you again for your support. diff --git a/frontend/templates/notification/pledge_failed/full.txt b/frontend/templates/notification/pledge_failed/full.txt index f5da3f23..0ef88f7d 100644 --- a/frontend/templates/notification/pledge_failed/full.txt +++ b/frontend/templates/notification/pledge_failed/full.txt @@ -11,7 +11,7 @@ Transaction summary {% endifequal %} {% include "notification/pledge_summary.txt" %} If you'd like to visit the campaign page, click here: -https://{{ current_site.domain }}{% url 'work' transaction.campaign.work.id %} +https://{{ current_site.domain }}{% url 'work' transaction.campaign.work_id %} Thank you again for your support. diff --git a/frontend/templates/notification/pledge_failed/notice.html b/frontend/templates/notification/pledge_failed/notice.html index a5d3b7b6..95f8f9bb 100644 --- a/frontend/templates/notification/pledge_failed/notice.html +++ b/frontend/templates/notification/pledge_failed/notice.html @@ -3,11 +3,11 @@ {% load humanize %} {% block comments_book %} - cover image for {{ transaction.campaign.work.title }} + cover image for {{ transaction.campaign.work.title }} {% endblock %} {% block comments_graphical %} - {% ifequal transaction.campaign.type 1 %}The campaign for {{ transaction.campaign.work.title }} has succeeded. However, our attempt to charge your pledge for ${{ transaction.amount|floatformat:2|intcomma }} to your credit card failed ({{transaction.error}}). Will you help us fix that?{% else %}Our attempt to charge a purchase of ${{ transaction.amount|floatformat:2|intcomma }} to your credit card failed ({{transaction.error}}).{% endifequal %} + {% ifequal transaction.campaign.type 1 %}The campaign for {{ transaction.campaign.work.title }} has succeeded. However, our attempt to charge your pledge for ${{ transaction.amount|floatformat:2|intcomma }} to your credit card failed ({{transaction.error}}). Will you help us fix that?{% else %}Our attempt to charge a purchase of ${{ transaction.amount|floatformat:2|intcomma }} to your credit card failed ({{transaction.error}}).{% endifequal %} {% endblock %} {% block comments_textual %} @@ -33,7 +33,7 @@ Amount of purchase: {{ transaction.amount|floatformat:2|intcomma }}

              {% endifequal %} -

              For more information, visit the campaign page. +

              For more information, visit the campaign page.

              Thank you again for your support. diff --git a/frontend/templates/notification/pledge_status_change/full.txt b/frontend/templates/notification/pledge_status_change/full.txt index bef4c585..446e48e2 100644 --- a/frontend/templates/notification/pledge_status_change/full.txt +++ b/frontend/templates/notification/pledge_status_change/full.txt @@ -11,7 +11,7 @@ Your new pledge summary {% endif %} If you'd like to visit the campaign page or make changes, click here: -https://{{current_site.domain}}{% url 'work' transaction.campaign.work.id %} +https://{{current_site.domain}}{% url 'work' transaction.campaign.work_id %} Thank you again for your support. diff --git a/frontend/templates/notification/pledge_status_change/notice.html b/frontend/templates/notification/pledge_status_change/notice.html index d32791cc..366b12ea 100644 --- a/frontend/templates/notification/pledge_status_change/notice.html +++ b/frontend/templates/notification/pledge_status_change/notice.html @@ -3,7 +3,7 @@ {% load humanize %} {% block comments_book %} - cover image for {{ transaction.campaign.work.title }} + cover image for {{ transaction.campaign.work.title }} {% endblock %} {% block comments_graphical %} diff --git a/frontend/templates/notification/pledge_summary.txt b/frontend/templates/notification/pledge_summary.txt index d7e87375..f94994fe 100644 --- a/frontend/templates/notification/pledge_summary.txt +++ b/frontend/templates/notification/pledge_summary.txt @@ -10,7 +10,7 @@ You will also be acknowledged as follows: - You will be listed in the ebook as a Bibliophile using the name "{{ transaction.extra.ack_name }}" with a link to your Unglue.it supporter page.{% endifequal %}{% endif %}{% ifequal transaction.tier 3 %}{% if transaction.extra.ack_dedication %} - The following dedication will be included in the ebook: {{ transaction.extra.ack_dedication }}{% else %} -- You were eligible to include a dedication in the unglued ebook, but did not choose to do so. If you like, you can change this at https://{{ current_site.domain }}{% url 'pledge_modify' work_id=transaction.campaign.work.id %}. +- You were eligible to include a dedication in the unglued ebook, but did not choose to do so. If you like, you can change this at https://{{ current_site.domain }}{% url 'pledge_modify' work_id=transaction.campaign.work_id %}. {% endif %}{% endifequal %}{% else %} Amount charged: ${{ transaction.amount|floatformat:2|intcomma }} diff --git a/frontend/templates/notification/pledge_you_have_pledged/full.txt b/frontend/templates/notification/pledge_you_have_pledged/full.txt index 10447942..b5be79bc 100644 --- a/frontend/templates/notification/pledge_you_have_pledged/full.txt +++ b/frontend/templates/notification/pledge_you_have_pledged/full.txt @@ -6,16 +6,16 @@ Pledge summary You can help even more by sharing this campaign with your friends. -Facebook: https://www.facebook.com/sharer.php?u=https://{{ current_site.domain }}{% url 'work' transaction.campaign.work.id %} +Facebook: https://www.facebook.com/sharer.php?u=https://{{ current_site.domain }}{% url 'work' transaction.campaign.work_id %} -Twitter: https://twitter.com/intent/tweet?url=https://{{ current_site.domain }}{% url 'work' transaction.campaign.work.id %}&text=I%27m%20ungluing%20{{ title|urlencode }}%20at%20%40unglueit.%20Join%20me%21" +Twitter: https://twitter.com/intent/tweet?url=https://{{ current_site.domain }}{% url 'work' transaction.campaign.work_id %}&text=I%27m%20ungluing%20{{ title|urlencode }}%20at%20%40unglueit.%20Join%20me%21" You can also embed a widget for {{ transaction.campaign.work.title }} in your web site by copy/pasting the following: Or the best idea: talk about it with those you love. We'll need lots of help from lots of people to make this a success. -If you want to change your pledge, just use the button at https://{{ current_site.domain }}{% url 'work' transaction.campaign.work.id %} +If you want to change your pledge, just use the button at https://{{ current_site.domain }}{% url 'work' transaction.campaign.work_id %} If you have any problems with your pledge, don't hesitate to contact us at support@gluejar.com diff --git a/frontend/templates/notification/pledge_you_have_pledged/notice.html b/frontend/templates/notification/pledge_you_have_pledged/notice.html index 9461a31d..c4601afb 100644 --- a/frontend/templates/notification/pledge_you_have_pledged/notice.html +++ b/frontend/templates/notification/pledge_you_have_pledged/notice.html @@ -3,19 +3,19 @@ {% load humanize %} {% block comments_book %} - cover image for {{ transaction.campaign.work.title }} + cover image for {{ transaction.campaign.work.title }} {% endblock %} {% block comments_graphical %} - You've just pledged ${{ transaction.amount|floatformat:2|intcomma }} to {{ transaction.campaign.work.title }}. + You've just pledged ${{ transaction.amount|floatformat:2|intcomma }} to {{ transaction.campaign.work.title }}. {% endblock %} {% block comments_textual %}

              Thank you, {{ transaction.user.username }}!

              -

              You've just pledged ${{ transaction.amount|floatformat:2|intcomma }} to {{ transaction.campaign.work.title }}. If it reaches its goal of ${{ transaction.campaign.target|intcomma }} by {{ transaction.campaign.deadline|date:"M d Y"}}, it will be unglued for all to enjoy.

              +

              You've just pledged ${{ transaction.amount|floatformat:2|intcomma }} to {{ transaction.campaign.work.title }}. If it reaches its goal of ${{ transaction.campaign.target|intcomma }} by {{ transaction.campaign.deadline|date:"M d Y"}}, it will be unglued for all to enjoy.

              You can help even more by sharing this campaign with your friends!

              - {% url 'work' transaction.campaign.work.id as work_url %} + {% url 'work' transaction.campaign.work_id as work_url %} {% include "notification/sharing_block.html" %}

              Thanks for being part of Unglue.it.

              diff --git a/frontend/templates/notification/purchase_complete/full.txt b/frontend/templates/notification/purchase_complete/full.txt index 9d3dafa5..9f177f99 100644 --- a/frontend/templates/notification/purchase_complete/full.txt +++ b/frontend/templates/notification/purchase_complete/full.txt @@ -10,19 +10,19 @@ https://{{ current_site.domain }}{% url 'receive_gift' gift.acq.nonce %} You can send the url yourself if there's been any problem with the email. {% else %}If you have not already done so, download your ebook at -https://{{ current_site.domain }}{% url 'download' transaction.campaign.work.id %} +https://{{ current_site.domain }}{% url 'download' transaction.campaign.work_id %} {% endif %}{% endifequal %}{% ifequal transaction.campaign.type 2 %}Thanks to you and other ungluers, {{ transaction.campaign.work.title }} will be eventually be released to the world in an unglued ebook edition. Thanks to your purchase, the ungluing date advanced {{ transaction.offer.days_per_copy|floatformat }}{% ifnotequal transaction.extra.copies 1 %} x {{ transaction.extra.copies }}{% endifnotequal %} days to {{ transaction.campaign.cc_date }}. {% ifequal transaction.offer.license 1 %}{% if not gift %} This ebook is licensed to you personally, and your personal license has been embedded in the ebook file. You may download as many times as you need to, but you can't make copies for the use of others until the ungluing date. You can make that date come sooner by encouraging your friends to buy a copy. {% endif %}{% else %} This ebook {% ifnotequal transaction.extra.copies 1 %}({{ transaction.extra.copies }} copies){% endifnotequal %} is licensed to your library and its license has been embedded in the ebook file. If you'd like to be the first to use it, please get your copy now at -https://{{ current_site.domain }}{% url 'borrow' transaction.campaign.work.id %} +https://{{ current_site.domain }}{% url 'borrow' transaction.campaign.work_id %} After an hour, the ebook will be available to all of your library's users on a one-user-per two weeks basis until the ungluing date, when it will be free to all. You can make that date come sooner by encouraging your friends to buy a copy.{% endifequal %}{% endifequal %}{% ifequal transaction.campaign.type 3 %}The creators of {{ transaction.campaign.work.title }} would like to thank you for showing your appreciation for making it free.{% endifequal %} For more information about the book, visit the book's unglue.it page at -https://{{ current_site.domain }}{% url 'work' transaction.campaign.work.id %} +https://{{ current_site.domain }}{% url 'work' transaction.campaign.work_id %} Thank you again for your support. diff --git a/frontend/templates/notification/purchase_complete/notice.html b/frontend/templates/notification/purchase_complete/notice.html index 5abb2b7f..36e4f3eb 100644 --- a/frontend/templates/notification/purchase_complete/notice.html +++ b/frontend/templates/notification/purchase_complete/notice.html @@ -3,7 +3,7 @@ {% load humanize %} {% block comments_book %} - cover image for {{ transaction.campaign.work.title }} + cover image for {{ transaction.campaign.work.title }} {% endblock %} {% block comments_graphical %} @@ -31,7 +31,7 @@ https://{{ current_site.domain }}{% url 'receive_gift' gift.acq.nonce %} You can send the url yourself if there's been any problem with the email. {% else %} -If you have not already done so, download your ebook at the book's download page. +If you have not already done so, download your ebook at the book's download page. {% endif %}{% endifequal %} {% endblock %} @@ -43,14 +43,14 @@ If you have not already done so, download your ebook at get your copy now. After an hour, the ebook will be available to all of your library's users on a one-user-per two weeks basis until the ungluing date, when it will be free to all. You can make that date come sooner by encouraging your friends to buy a copy.

              +

              This ebook {% ifnotequal transaction.extra.copies 1 %}({{ transaction.extra.copies }} copies){% endifnotequal %} is licensed to your library and its license has been embedded in the ebook file. If you'd like to be the first to use it, please get your copy now. After an hour, the ebook will be available to all of your library's users on a one-user-per two weeks basis until the ungluing date, when it will be free to all. You can make that date come sooner by encouraging your friends to buy a copy.

              {% endifequal %} {% endifequal %} {% ifequal transaction.campaign.type 3 %}

              The creators of {{ transaction.campaign.work.title }} would like to thank you for showing your appreciation for making it free.

              {% endifequal %} -

              For more information about the book, visit the book's unglue.it page. +

              For more information about the book, visit the book's unglue.it page.

              Thank you again for your support.

              diff --git a/frontend/templates/notification/purchase_gift/full.txt b/frontend/templates/notification/purchase_gift/full.txt index e92266cb..7a9e9a2b 100644 --- a/frontend/templates/notification/purchase_gift/full.txt +++ b/frontend/templates/notification/purchase_gift/full.txt @@ -16,7 +16,7 @@ Unglue.it is a website whose purpose is to help ebooks become free. Thanks to "{ For more information about the book, visit the book's unglue.it page at -https://{{ current_site.domain }}{% url 'work' gift.acq.work.id %} +https://{{ current_site.domain }}{% url 'work' gift.acq.work_id %} We hope enjoy your new ebook, and we hope you like Unglue.it! diff --git a/frontend/templates/notification/purchase_gift/notice.html b/frontend/templates/notification/purchase_gift/notice.html index e5d8fbae..ba68081b 100644 --- a/frontend/templates/notification/purchase_gift/notice.html +++ b/frontend/templates/notification/purchase_gift/notice.html @@ -3,7 +3,7 @@ {% load humanize %} {% block comments_book %} - cover image for {{ gift.acq.work.title }} + cover image for {{ gift.acq.work.title }} {% endblock %} {% block comments_graphical %} @@ -22,10 +22,10 @@ To pick up {{ gift.acq.work.title }}, the ebook that {{ gift.giver }} and other ungluers, {{ gift.acq.work.title }} will be eventually be released to the world in an unglued ebook edition. +Thanks to {{ gift.giver }} and other ungluers, {{ gift.acq.work.title }} will be eventually be released to the world in an unglued ebook edition.

              -For more information about the book, visit the book's unglue.it page +For more information about the book, visit the book's unglue.it page

              diff --git a/frontend/templates/notification/purchase_gift_waiting/full.txt b/frontend/templates/notification/purchase_gift_waiting/full.txt index e0a0f981..74c17a0c 100644 --- a/frontend/templates/notification/purchase_gift_waiting/full.txt +++ b/frontend/templates/notification/purchase_gift_waiting/full.txt @@ -16,7 +16,7 @@ The ebook will be licensed to you personally, and the license will be embedded i Unglue.it is a website whose purpose is to help ebooks become free. Thanks to "{{ gift.giver }}" and other "ungluers", "{{ gift.acq.work.title }}" will be eventually be released in an "unglued" ebook edition, i.e. free to everyone. Purchases of "{{ gift.acq.work.title }}" are helping to make that free edition financially possible. For more information about the book, visit the book's unglue.it page at -https://{{ current_site.domain }}{% url 'work' gift.acq.work.id %} +https://{{ current_site.domain }}{% url 'work' gift.acq.work_id %} We hope enjoy your new ebook, and we hope you like Unglue.it! diff --git a/frontend/templates/notification/purchase_gift_waiting/notice.html b/frontend/templates/notification/purchase_gift_waiting/notice.html index e5d8fbae..ba68081b 100644 --- a/frontend/templates/notification/purchase_gift_waiting/notice.html +++ b/frontend/templates/notification/purchase_gift_waiting/notice.html @@ -3,7 +3,7 @@ {% load humanize %} {% block comments_book %} - cover image for {{ gift.acq.work.title }} + cover image for {{ gift.acq.work.title }} {% endblock %} {% block comments_graphical %} @@ -22,10 +22,10 @@ To pick up {{ gift.acq.work.title }}, the ebook that {{ gift.giver }} and other ungluers, {{ gift.acq.work.title }} will be eventually be released to the world in an unglued ebook edition. +Thanks to {{ gift.giver }} and other ungluers, {{ gift.acq.work.title }} will be eventually be released to the world in an unglued ebook edition.

              -For more information about the book, visit the book's unglue.it page +For more information about the book, visit the book's unglue.it page

              diff --git a/frontend/templates/notification/purchase_got_gift/notice.html b/frontend/templates/notification/purchase_got_gift/notice.html index e86d0149..e0d734d1 100644 --- a/frontend/templates/notification/purchase_got_gift/notice.html +++ b/frontend/templates/notification/purchase_got_gift/notice.html @@ -3,7 +3,7 @@ {% load humanize %} {% block comments_book %} - cover image for {{ gift.acq.work.title }} + cover image for {{ gift.acq.work.title }} {% endblock %} {% block comments_graphical %} diff --git a/frontend/templates/notification/purchase_notgot_gift/notice.html b/frontend/templates/notification/purchase_notgot_gift/notice.html index a7d67c35..b58f25b3 100644 --- a/frontend/templates/notification/purchase_notgot_gift/notice.html +++ b/frontend/templates/notification/purchase_notgot_gift/notice.html @@ -3,7 +3,7 @@ {% load humanize %} {% block comments_book %} - cover image for {{ gift.acq.work.title }} + cover image for {{ gift.acq.work.title }} {% endblock %} {% block comments_graphical %} diff --git a/frontend/templates/notification/rights_holder_claim/full.txt b/frontend/templates/notification/rights_holder_claim/full.txt index b9d4bcc0..507b12bd 100644 --- a/frontend/templates/notification/rights_holder_claim/full.txt +++ b/frontend/templates/notification/rights_holder_claim/full.txt @@ -3,7 +3,7 @@ You are now free to start a campaign to sell or unglue your work. If you're logged in, you will see the option to open a campaign at https://{{ current_site.domain }}/rightsholders . (You can also find this page by clicking on "Rights Holder Tools" at the bottom of any Unglue.it page.) -To run a campaign, you'll need to set up campaign parameters. You'll also need to write a pitch. For Pledge-to-Unglue and Buy-to-Unglue campaigns, this will appear in the Description tab on your book's page (https://{{ current_site.domain }}{% url 'work' claim.work.id %}). Think about who your book's audience is, and remind them why they'll love this book -- your pitch is not a catalog page! We encourage video, audio, and links to make your pitch come alive. For Thanks-for-Ungluing, your pitch will occur when the user clicks a Download button. You should emphasize how the ungluer's support enables you to keep doing what you do. Feel free to email us (rights@gluejar.com) if you need any help with this. +To run a campaign, you'll need to set up campaign parameters. You'll also need to write a pitch. For Pledge-to-Unglue and Buy-to-Unglue campaigns, this will appear in the Description tab on your book's page (https://{{ current_site.domain }}{% url 'work' claim.work_id %}). Think about who your book's audience is, and remind them why they'll love this book -- your pitch is not a catalog page! We encourage video, audio, and links to make your pitch come alive. For Thanks-for-Ungluing, your pitch will occur when the user clicks a Download button. You should emphasize how the ungluer's support enables you to keep doing what you do. Feel free to email us (rights@gluejar.com) if you need any help with this. If you're running a Buy-to-Unglue or Thanks-for-Ungluing Campaign, now is the time to upload your digital files. For Buy-to-Unglue, you need to decide on revenue targets and pricing for individual and library licenses. @@ -14,10 +14,10 @@ Finally, think about how you're going to publicize your campaign: social media, We're thrilled to be working with you. {% endifequal %} {% ifequal claim.status 'pending' %} -{{ claim.rights_holder }}'s claim to {{ claim.work.title }} (https://{{ current_site.domain }}{% url 'work' claim.work.id %}) on Unglue.it has been entered. Our team will examine the claim and get back to you soon. +{{ claim.rights_holder }}'s claim to {{ claim.work.title }} (https://{{ current_site.domain }}{% url 'work' claim.work_id %}) on Unglue.it has been entered. Our team will examine the claim and get back to you soon. {% endifequal %} {% ifequal claim.status 'release' %} -{{ claim.rights_holder }}'s claim to {{ claim.work.title }} (https://{{ current_site.domain }}{% url 'work' claim.work.id %}) on Unglue.it has been released. email us (rights@gluejar.com) if you have any questions about this. +{{ claim.rights_holder }}'s claim to {{ claim.work.title }} (https://{{ current_site.domain }}{% url 'work' claim.work_id %}) on Unglue.it has been released. email us (rights@gluejar.com) if you have any questions about this. {% endifequal %} The Unglue.it team \ No newline at end of file diff --git a/frontend/templates/notification/rights_holder_claim/notice.html b/frontend/templates/notification/rights_holder_claim/notice.html index 63a14197..340844ee 100644 --- a/frontend/templates/notification/rights_holder_claim/notice.html +++ b/frontend/templates/notification/rights_holder_claim/notice.html @@ -2,7 +2,7 @@ {% block comments_book %} - cover image for {{ claim.work.title }} + cover image for {{ claim.work.title }} {% endblock %} {% block comments_graphical %} @@ -17,7 +17,7 @@

              You are now free to start a campaign to sell or unglue your work. If you're logged in, you can open a campaign. (You can also find this page by clicking on "Rights Holder Tools" at the bottom of any Unglue.it page.)

              -To run a campaign, you'll need to set up campaign parameters. You'll also need to write a pitch. For Pledge-to-Unglue and Buy-to-Unglue campaigns, this will appear in the Description tab on your book's work page. Think about who your book's audience is, and remind them why they'll love this book -- your pitch is not a catalog page! We encourage video, audio, and links to make your pitch come alive. For Thanks-for-Ungluing, your pitch will occur when the user clicks a Download button. You should emphasize how the ungluer's support enables you to keep doing what you do. Feel free to email us (rights@gluejar.com) if you need any help with this. +To run a campaign, you'll need to set up campaign parameters. You'll also need to write a pitch. For Pledge-to-Unglue and Buy-to-Unglue campaigns, this will appear in the Description tab on your book's work page. Think about who your book's audience is, and remind them why they'll love this book -- your pitch is not a catalog page! We encourage video, audio, and links to make your pitch come alive. For Thanks-for-Ungluing, your pitch will occur when the user clicks a Download button. You should emphasize how the ungluer's support enables you to keep doing what you do. Feel free to email us (rights@gluejar.com) if you need any help with this.

              If you're running a Buy-to-Unglue or Thanks-for-Ungluing Campaign, now is the time to upload your digital files. For Buy-to-Unglue, you need to decide on revenue targets and pricing for individual and library licenses.

              @@ -28,9 +28,9 @@ Finally, think about how you're going to publicize your campaign: social media, We're thrilled to be working with you. {% endifequal %} {% ifequal claim.status 'pending' %} - The claim for {{ claim.work.title }} will be examined, and we'll email you. Contact us if you need any help. + The claim for {{ claim.work.title }} will be examined, and we'll email you. Contact us if you need any help. {% endifequal %} {% ifequal claim.status 'release' %} - The claim for {{ claim.work.title }} has been released. Contact us at rights@gluejar.com if you have questions. + The claim for {{ claim.work.title }} has been released. Contact us at rights@gluejar.com if you have questions. {% endifequal %} {% endblock %} diff --git a/frontend/templates/notification/wishlist_active/full.txt b/frontend/templates/notification/wishlist_active/full.txt index 68cd3243..f5635255 100644 --- a/frontend/templates/notification/wishlist_active/full.txt +++ b/frontend/templates/notification/wishlist_active/full.txt @@ -2,22 +2,22 @@ You can help! -Pledge toward ungluing. https://{{ current_site.domain }}{% url 'pledge' work_id=campaign.work.id %} +Pledge toward ungluing. https://{{ current_site.domain }}{% url 'pledge' work_id=campaign.work_id %} {% endifequal %}{% ifequal campaign.type 2 %}Great, you wished for it, and now there is a campaign for {{ campaign.work.title }} to be unglued. Someday, the book will be released under a Creative Commons license for everyone to enjoy. Every copy purchased until then brings that day {{ campaign.day_per_copy|floatformat }} days sooner. You can help! -Buy a copy to help unglue the book. https://{{ current_site.domain }}{% url 'purchase' work_id=campaign.work.id %} +Buy a copy to help unglue the book. https://{{ current_site.domain }}{% url 'purchase' work_id=campaign.work_id %} {% endifequal %}{% ifequal campaign.type 3 %}There is a new "Thanks for Ungluing" campaign for {{ campaign.work.title }} one of your Creative Commons license favorites. -Join us in thanking the creators! Download a copy and leave a contribution. https://{{ current_site.domain }}{% url 'download' work_id=campaign.work.id %} +Join us in thanking the creators! Download a copy and leave a contribution. https://{{ current_site.domain }}{% url 'download' work_id=campaign.work_id %} {% endifequal %} -Tell your friends -- there are handy share options on the campaign page. There's even a widget you can put on your blog or home page. https://{{ current_site.domain }}{% url 'work' campaign.work.id %} +Tell your friends -- there are handy share options on the campaign page. There's even a widget you can put on your blog or home page. https://{{ current_site.domain }}{% url 'work' campaign.work_id %} -Join the discussion: share why you love {{ campaign.work.title }} and the world will too. https://{{ current_site.domain }}{% url 'work' campaign.work.id %}?tab=2 +Join the discussion: share why you love {{ campaign.work.title }} and the world will too. https://{{ current_site.domain }}{% url 'work' campaign.work_id %}?tab=2 Thank you! diff --git a/frontend/templates/notification/wishlist_active/notice.html b/frontend/templates/notification/wishlist_active/notice.html index cf6ae3d4..14bed6b9 100644 --- a/frontend/templates/notification/wishlist_active/notice.html +++ b/frontend/templates/notification/wishlist_active/notice.html @@ -3,24 +3,24 @@ {% load humanize %} {% block comments_book %} - cover image for {{ campaign.work.title }} + cover image for {{ campaign.work.title }} {% endblock %} {% block comments_graphical %} - The rights holder, {{ campaign.rightsholder }}, has launched a campaign for {{ campaign.work.title }}! + The rights holder, {{ campaign.rightsholder }}, has launched a campaign for {{ campaign.work.title }}! {% endblock %} {% block comments_textual %} {% ifequal campaign.type 1 %}

              Congratulations! You wished for a campaign, and here it is. If ungluers like you pledge {{ campaign.target|intcomma }} by {{ campaign.deadline|date:"M d, Y" }}, {{ campaign.work.title }} will be released under a Creative Commons license for all to enjoy.
              -
              You can help! Pledge any amount, and use the sharing options on the campaign page to tell your friends.
              +
              You can help! Pledge any amount, and use the sharing options on the campaign page to tell your friends.
              {% endifequal %} {% ifequal campaign.type 2 %}
              Great! You wished for a campaign, and here it is. Someday, the book will be released under a Creative Commons license for everyone to enjoy. Every copy purchased brings that day {{ campaign.days_per_copy|floatformat }} days sooner.
              -
              You can help! Purchase a copy, and use the sharing options on the campaign page to tell your friends.
              +
              You can help! Purchase a copy, and use the sharing options on the campaign page to tell your friends.
              {% endifequal %} {% ifequal campaign.type 3 %}
              There is a new "Thanks for Ungluing" campaign for {{ campaign.work.title }} one of your Creative Commons license favorites.
              -
              Please join us! Download a copy, leave a contribution, and use the sharing options on the campaign page to tell your friends.
              +
              Please join us! Download a copy, leave a contribution, and use the sharing options on the campaign page to tell your friends.
              {% endifequal %} {% endblock %} \ No newline at end of file diff --git a/frontend/templates/notification/wishlist_near_deadline/full.txt b/frontend/templates/notification/wishlist_near_deadline/full.txt index 04acd65e..3d0ceb14 100644 --- a/frontend/templates/notification/wishlist_near_deadline/full.txt +++ b/frontend/templates/notification/wishlist_near_deadline/full.txt @@ -1,11 +1,11 @@ {% load humanize %}{% if campaign.left > 0 %} The campaign to unglue a book you've faved, {{ campaign.work.title}}, is almost out of time. We need to raise ${{ campaign.left|intcomma }} more by {{ campaign.deadline }} in order to give this book to the world. {% if pledged %} - Your pledge is helping {{ campaign.work.title }} to reach its goal, but we can only unglue this book if the campaign succeeds. You can help your pledge go farther by sharing the campaign ({{ domain }}{% url 'work' work_id=campaign.work.id %}) with your friends through your favorite media: tweet, Facebook, Tumblr, blog, G+, Pinterest, email, carrier pigeon, or good old-fashioned conversation. + Your pledge is helping {{ campaign.work.title }} to reach its goal, but we can only unglue this book if the campaign succeeds. You can help your pledge go farther by sharing the campaign ({{ domain }}{% url 'work' work_id=campaign.work_id %}) with your friends through your favorite media: tweet, Facebook, Tumblr, blog, G+, Pinterest, email, carrier pigeon, or good old-fashioned conversation. {% else %} - If you've been meaning to get around to pledging, now's your chance. Any amount helps. You can chip in towards giving this book to the world at {{ domain }}{% url 'pledge' work_id=campaign.work.id %} . + If you've been meaning to get around to pledging, now's your chance. Any amount helps. You can chip in towards giving this book to the world at {{ domain }}{% url 'pledge' work_id=campaign.work_id %} . - You can also help by sharing the campaign ({{ domain }}{% url 'work' work_id=campaign.work.id %}) with your friends through your favorite media: tweet, Facebook, Tumblr, blog, G+, Pinterest, email, carrier pigeon, or good old-fashioned conversation. + You can also help by sharing the campaign ({{ domain }}{% url 'work' work_id=campaign.work_id %}) with your friends through your favorite media: tweet, Facebook, Tumblr, blog, G+, Pinterest, email, carrier pigeon, or good old-fashioned conversation. {% endif %} Thank you! @@ -16,7 +16,7 @@ {% if pledged %} Your pledge is helping us give this book to the world. Thank you! When the campaign closes, we'll be in touch about how and when you'll receive your premiums. {% else %} - If you wanted to support this campaign, this is your last chance. Pledge by midnight (Eastern US time) if you want to help the campaign or receive any premiums: {{ domain }}{% url 'pledge' work_id=campaign.work.id %} + If you wanted to support this campaign, this is your last chance. Pledge by midnight (Eastern US time) if you want to help the campaign or receive any premiums: {{ domain }}{% url 'pledge' work_id=campaign.work_id %} {% endif %} Thanks to ungluers like you, we'll soon be able to give this book to the world together. Hooray! diff --git a/frontend/templates/notification/wishlist_near_deadline/notice.html b/frontend/templates/notification/wishlist_near_deadline/notice.html index 6a5f00d6..b43b0e5f 100644 --- a/frontend/templates/notification/wishlist_near_deadline/notice.html +++ b/frontend/templates/notification/wishlist_near_deadline/notice.html @@ -2,7 +2,7 @@ {% block comments_book %} - cover image for {{ campaign.work.title }} + cover image for {{ campaign.work.title }} {% endblock %} {% block comments_graphical %} @@ -16,10 +16,10 @@ Your pledge is helping us reach that goal. Will you help again by sharing this campaign with your friends? {% else %} - If you've been meaning to pledge, now's your chance. You can also help by sharing this campaign with your friends. + If you've been meaning to pledge, now's your chance. You can also help by sharing this campaign with your friends. {% endif %} - {% url 'work' campaign.work.id as work_url %} + {% url 'work' campaign.work_id as work_url %} {% include "notification/sharing_block.html" %} Thank you! diff --git a/frontend/templates/notification/wishlist_near_target/full.txt b/frontend/templates/notification/wishlist_near_target/full.txt index 4fe82bd0..add608fa 100644 --- a/frontend/templates/notification/wishlist_near_target/full.txt +++ b/frontend/templates/notification/wishlist_near_target/full.txt @@ -1,11 +1,11 @@ {% load humanize %}The campaign to unglue a book you've faved, {{ campaign.work.title}}, is close to succeeding! We only need to raise ${{ campaign.left|intcomma }} more by {{ campaign.deadline }} in order to give this book to the world. {% if pledged %} - Your pledge of {{ amount|intcomma }} is helping {{ campaign.work.title }} to reach its goal, but we can only unglue this book if the campaign succeeds. You can tip the balance by sharing the campaign (https://{{ current_site.domain }}{% url 'work' work_id=campaign.work.id %}) with your friends through your favorite media: tweet, Facebook, Tumblr, blog, G+, Pinterest, email, carrier pigeon, or good old-fashioned conversation. + Your pledge of {{ amount|intcomma }} is helping {{ campaign.work.title }} to reach its goal, but we can only unglue this book if the campaign succeeds. You can tip the balance by sharing the campaign (https://{{ current_site.domain }}{% url 'work' work_id=campaign.work_id %}) with your friends through your favorite media: tweet, Facebook, Tumblr, blog, G+, Pinterest, email, carrier pigeon, or good old-fashioned conversation. {% else %} - We need your pledge to reach this target. Any amount helps. You can chip in towards giving this book to the world at https://{{ current_site.domain }}{% url 'pledge' work_id=campaign.work.id %} . + We need your pledge to reach this target. Any amount helps. You can chip in towards giving this book to the world at https://{{ current_site.domain }}{% url 'pledge' work_id=campaign.work_id %} . - You can also help by sharing the campaign (https://{{ current_site.domain }}{% url 'work' work_id=campaign.work.id %}) with your friends through your favorite media: tweet, Facebook, Tumblr, blog, G+, Pinterest, email, carrier pigeon, or good old-fashioned conversation. + You can also help by sharing the campaign (https://{{ current_site.domain }}{% url 'work' work_id=campaign.work_id %}) with your friends through your favorite media: tweet, Facebook, Tumblr, blog, G+, Pinterest, email, carrier pigeon, or good old-fashioned conversation. {% endif %} Thank you! diff --git a/frontend/templates/notification/wishlist_near_target/notice.html b/frontend/templates/notification/wishlist_near_target/notice.html index e10f5f79..ba7e6678 100644 --- a/frontend/templates/notification/wishlist_near_target/notice.html +++ b/frontend/templates/notification/wishlist_near_target/notice.html @@ -3,7 +3,7 @@ {% load humanize %} {% block comments_book %} - cover image for {{ campaign.work.title }} + cover image for {{ campaign.work.title }} {% endblock %} {% block comments_graphical %} @@ -15,10 +15,10 @@ {% if pledged %} Your pledge is helping us reach the campaign's target price of {{ campaign.target }}. Will you help again by sharing this campaign with your friends? {% else %} - You can help us give this book to the world by pledging or by sharing this campaign with your friends. + You can help us give this book to the world by pledging or by sharing this campaign with your friends. {% endif %} - {% url 'work' campaign.work.id as work_url %} + {% url 'work' campaign.work_id as work_url %} {% include "notification/sharing_block.html" %} Thank you! diff --git a/frontend/templates/notification/wishlist_premium_limited_supply/full.txt b/frontend/templates/notification/wishlist_premium_limited_supply/full.txt index 3b21258d..9f0dbece 100644 --- a/frontend/templates/notification/wishlist_premium_limited_supply/full.txt +++ b/frontend/templates/notification/wishlist_premium_limited_supply/full.txt @@ -3,6 +3,6 @@ Premium: {{ premium.description }} Minimum pledge: {{ premium.amount|intcomma }} -If you'd like to claim the last one, pledge here: https://{{ current_site.domain }}{% url 'pledge' work_id=campaign.work.id %} +If you'd like to claim the last one, pledge here: https://{{ current_site.domain }}{% url 'pledge' work_id=campaign.work_id %} {{ campaign.rightsholder }} (rights holder for {{ campaign.work.title }}) and the Unglue.it team \ No newline at end of file diff --git a/frontend/templates/notification/wishlist_premium_limited_supply/notice.html b/frontend/templates/notification/wishlist_premium_limited_supply/notice.html index db0c1728..c2c92250 100644 --- a/frontend/templates/notification/wishlist_premium_limited_supply/notice.html +++ b/frontend/templates/notification/wishlist_premium_limited_supply/notice.html @@ -3,7 +3,7 @@ {% load humanize %} {% block comments_book %} - cover image for {{ campaign.work.title }} + cover image for {{ campaign.work.title }} {% endblock %} {% block comments_graphical %} @@ -16,5 +16,5 @@ Premium: {{ premium.description }} Minimum pledge: {{ premium.amount|intcomma }} - If you'd like to claim the last one, pledge here: https://{{ current_site.domain }}{% url 'pledge' work_id=campaign.work.id %} + If you'd like to claim the last one, pledge here: https://{{ current_site.domain }}{% url 'pledge' work_id=campaign.work_id %} {% endblock %} diff --git a/frontend/templates/notification/wishlist_price_drop/full.txt b/frontend/templates/notification/wishlist_price_drop/full.txt index b0aa3f75..e7f51688 100644 --- a/frontend/templates/notification/wishlist_price_drop/full.txt +++ b/frontend/templates/notification/wishlist_price_drop/full.txt @@ -1,11 +1,11 @@ {% load humanize %}Good news! The rights holder, {{ campaign.rightsholder }}, has lowered the target price to ${{ campaign.target|intcomma }} for {{ campaign.work.title }}. Now we only need to raise ${{ campaign.left|intcomma }} by {{ campaign.deadline }} in order to give this book to the world. {% if pledged %} - Your pledge of {{ amount|intcomma }} is now going even farther toward helping {{ campaign.work.title }} to reach its goal. Still, we can only unglue this book if the campaign succeeds. You can help by sharing the campaign (https://{{ current_site.domain }}{% url 'work' work_id=campaign.work.id %}) with your friends through your favorite media: tweet, Facebook, Tumblr, blog, G+, Pinterest, email, carrier pigeon, or good old-fashioned conversation. + Your pledge of {{ amount|intcomma }} is now going even farther toward helping {{ campaign.work.title }} to reach its goal. Still, we can only unglue this book if the campaign succeeds. You can help by sharing the campaign (https://{{ current_site.domain }}{% url 'work' work_id=campaign.work_id %}) with your friends through your favorite media: tweet, Facebook, Tumblr, blog, G+, Pinterest, email, carrier pigeon, or good old-fashioned conversation. {% else %} - The target may be lower, but we still need your help to reach it. Pledges of any amount help. You can chip in towards giving this book to the world at https://{{ current_site.domain }}{% url 'pledge' work_id=campaign.work.id %} . + The target may be lower, but we still need your help to reach it. Pledges of any amount help. You can chip in towards giving this book to the world at https://{{ current_site.domain }}{% url 'pledge' work_id=campaign.work_id %} . - You can also help by sharing the campaign (https://{{ current_site.domain }}{% url 'work' work_id=campaign.work.id %}) with your friends through your favorite media: tweet, Facebook, Tumblr, blog, G+, Pinterest, email, carrier pigeon, or good old-fashioned conversation. + You can also help by sharing the campaign (https://{{ current_site.domain }}{% url 'work' work_id=campaign.work_id %}) with your friends through your favorite media: tweet, Facebook, Tumblr, blog, G+, Pinterest, email, carrier pigeon, or good old-fashioned conversation. {% endif %} Thank you! diff --git a/frontend/templates/notification/wishlist_price_drop/notice.html b/frontend/templates/notification/wishlist_price_drop/notice.html index 91a359e5..2f6b063d 100644 --- a/frontend/templates/notification/wishlist_price_drop/notice.html +++ b/frontend/templates/notification/wishlist_price_drop/notice.html @@ -3,7 +3,7 @@ {% load humanize %} {% block comments_book %} - cover image for {{ campaign.work.title }} + cover image for {{ campaign.work.title }} {% endblock %} {% block comments_graphical %} @@ -14,9 +14,9 @@ {% if pledged %} Your pledge of {{ amount|intcomma }} is now going even farther toward helping {{ campaign.work.title }} to reach its goal. Still, we can only unglue this book if the campaign succeeds. You can help again by sharing this campaign: {% else %} - The target may be lower, but we still need your help to reach it. Pledges of any amount help. You can chip in towards giving this book to the world at https://{{ current_site.domain }}{% url 'pledge' campaign.work.id %} . You can also help by sharing this campaign: + The target may be lower, but we still need your help to reach it. Pledges of any amount help. You can chip in towards giving this book to the world at https://{{ current_site.domain }}{% url 'pledge' campaign.work_id %} . You can also help by sharing this campaign: {% endif %} - {% url 'work' campaign.work.id as work_url %} + {% url 'work' campaign.work_id as work_url %} {% include "notification/sharing_block.html" %} {% endblock %} \ No newline at end of file diff --git a/frontend/templates/notification/wishlist_successful/full.txt b/frontend/templates/notification/wishlist_successful/full.txt index 0270a716..7d466908 100644 --- a/frontend/templates/notification/wishlist_successful/full.txt +++ b/frontend/templates/notification/wishlist_successful/full.txt @@ -1,4 +1,4 @@ -{% if pledged %}You pledged toward it{% else %}You put it on your list{% endif %}, and now the campaign for {{ campaign.work.title}} (https://{{current_site.domain}}{% url 'work' campaign.work.id %}) has succeeded. +{% if pledged %}You pledged toward it{% else %}You put it on your list{% endif %}, and now the campaign for {{ campaign.work.title}} (https://{{current_site.domain}}{% url 'work' campaign.work_id %}) has succeeded. {% ifequal campaign.type 1 %} You will notified when an Unglued ebook edition is available, within 90 days. {% if pledged %} diff --git a/frontend/templates/notification/wishlist_successful/notice.html b/frontend/templates/notification/wishlist_successful/notice.html index f68808c2..13870185 100644 --- a/frontend/templates/notification/wishlist_successful/notice.html +++ b/frontend/templates/notification/wishlist_successful/notice.html @@ -2,11 +2,11 @@ {% block comments_book %} - cover image for {{ campaign.work.title }} + cover image for {{ campaign.work.title }} {% endblock %} {% block comments_graphical %} -The campaign to unglue {{ campaign.work.title }} has succeeded! +The campaign to unglue {{ campaign.work.title }} has succeeded! {% endblock %} {% block comments_textual %} diff --git a/frontend/templates/notification/wishlist_unsuccessful/full.txt b/frontend/templates/notification/wishlist_unsuccessful/full.txt index 7fe33e04..cc0c7733 100644 --- a/frontend/templates/notification/wishlist_unsuccessful/full.txt +++ b/frontend/templates/notification/wishlist_unsuccessful/full.txt @@ -1,4 +1,4 @@ -Alas. The campaign to unglue {{ campaign.work.title }} (https://{{current_site.domain}}{% url 'work' campaign.work.id %}) has not succeeded. +Alas. The campaign to unglue {{ campaign.work.title }} (https://{{current_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. diff --git a/frontend/templates/notification/wishlist_unsuccessful/notice.html b/frontend/templates/notification/wishlist_unsuccessful/notice.html index 6052670c..2498cdce 100644 --- a/frontend/templates/notification/wishlist_unsuccessful/notice.html +++ b/frontend/templates/notification/wishlist_unsuccessful/notice.html @@ -2,11 +2,11 @@ {% block comments_book %} - cover image for {{ campaign.work.title }} + cover image for {{ campaign.work.title }} {% endblock %} {% block comments_graphical %} - Alas. The campaign to unglue {{ campaign.work.title }} did not succeed. + Alas. The campaign to unglue {{ campaign.work.title }} did not succeed. {% endblock %} {% block comments_textual %} diff --git a/frontend/templates/notification/wishlist_unsuccessful_amazon/full.txt b/frontend/templates/notification/wishlist_unsuccessful_amazon/full.txt index a8bd5db5..b7aa4420 100644 --- a/frontend/templates/notification/wishlist_unsuccessful_amazon/full.txt +++ b/frontend/templates/notification/wishlist_unsuccessful_amazon/full.txt @@ -1,4 +1,4 @@ -Amazon Payments has informed us that they will no longer process pledge payments for new crowdfunding companies, including Unglue.it. Therefore the campaign to unglue {{ campaign.work.title }} (https://{{current_site.domain}}{% url 'work' campaign.work.id %}) has been closed. +Amazon Payments has informed us that they will no longer process pledge payments for new crowdfunding companies, including Unglue.it. Therefore the campaign to unglue {{ campaign.work.title }} (https://{{current_site.domain}}{% url 'work' campaign.work_id %}) has been closed. 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. diff --git a/frontend/templates/notification/wishlist_unsuccessful_amazon/notice.html b/frontend/templates/notification/wishlist_unsuccessful_amazon/notice.html index b988125e..6fc39d5d 100644 --- a/frontend/templates/notification/wishlist_unsuccessful_amazon/notice.html +++ b/frontend/templates/notification/wishlist_unsuccessful_amazon/notice.html @@ -2,11 +2,11 @@ {% block comments_book %} - cover image for {{ campaign.work.title }} + cover image for {{ campaign.work.title }} {% endblock %} {% block comments_graphical %} - Amazon has shut off payment processing for new crowdfunding companies. Therefore the campaign to unglue {{ campaign.work.title }} has been closed. + Amazon has shut off payment processing for new crowdfunding companies. Therefore the campaign to unglue {{ campaign.work.title }} has been closed. {% endblock %} {% block comments_textual %} diff --git a/frontend/templates/notification/wishlist_updated/full.txt b/frontend/templates/notification/wishlist_updated/full.txt index a0b4f411..dfd7205a 100644 --- a/frontend/templates/notification/wishlist_updated/full.txt +++ b/frontend/templates/notification/wishlist_updated/full.txt @@ -1,3 +1,3 @@ -There's new information about a work on your wishlist! {{ campaign.rightsholder }}, the rights holder for {{ campaign.work.title}}, has updated the campaign. See the details at https://{{current_site.domain}}{% url 'work' campaign.work.id %}. +There's new information about a work on your wishlist! {{ campaign.rightsholder }}, the rights holder for {{ campaign.work.title}}, has updated the campaign. See the details at https://{{current_site.domain}}{% url 'work' campaign.work_id %}. {{ campaign.rightsholder }} and the Unglue.it team \ No newline at end of file diff --git a/frontend/templates/notification/wishlist_updated/notice.html b/frontend/templates/notification/wishlist_updated/notice.html index 8d833c18..c5bc59da 100644 --- a/frontend/templates/notification/wishlist_updated/notice.html +++ b/frontend/templates/notification/wishlist_updated/notice.html @@ -2,9 +2,9 @@ {% block comments_book %} - cover image for {{ cmapaign.work.title }} + cover image for {{ cmapaign.work.title }} {% endblock %} {% block comments_graphical %} - The rights holder, {{ campaign.rightsholder }}, has updated the campaign to unglue {{ campaign.work.title }}. For details, see the campaign page. + The rights holder, {{ campaign.rightsholder }}, has updated the campaign to unglue {{ campaign.work.title }}. For details, see the campaign page. {% endblock %} \ No newline at end of file diff --git a/frontend/templates/notification/wishlist_work_claimed/full.txt b/frontend/templates/notification/wishlist_work_claimed/full.txt index 4698e459..e4dcd258 100644 --- a/frontend/templates/notification/wishlist_work_claimed/full.txt +++ b/frontend/templates/notification/wishlist_work_claimed/full.txt @@ -2,7 +2,7 @@ Hooray! A rights holder, {{ rightsholder }}, has claimed {{ claim.work.title }} What does this mean for you? Rights holders are the people who are legally authorized to license works. This means they're the only people who can run campaigns on Unglue.it. -{{ rightsholder }} may be running a campaign soon, or later, but isn't obligated to. Want to make that campaign happen? Leave a comment (https://{{current_site.domain}}{% url 'work' campaign.work.id %}?tab=2) and tell your friends: make sure {{ rightsholder }} knows how much you want to give this book to the world. +{{ rightsholder }} may be running a campaign soon, or later, but isn't obligated to. Want to make that campaign happen? Leave a comment (https://{{current_site.domain}}{% url 'work' campaign.work_id %}?tab=2) and tell your friends: make sure {{ rightsholder }} knows how much you want to give this book to the world. Thanks for your help! diff --git a/frontend/templates/notification/wishlist_work_claimed/notice.html b/frontend/templates/notification/wishlist_work_claimed/notice.html index b4acb260..6d447d53 100644 --- a/frontend/templates/notification/wishlist_work_claimed/notice.html +++ b/frontend/templates/notification/wishlist_work_claimed/notice.html @@ -2,7 +2,7 @@ {% block comments_book %} - cover image for {{ claim.work.title }} + cover image for {{ claim.work.title }} {% endblock %} {% block comments_graphical %} @@ -12,9 +12,9 @@ {% block comments_textual %} What does this mean for you? Rights holders are the people who are legally authorized to license works. This means they're the only people who can run campaigns on Unglue.it. - {{ rightsholder }} may be running a campaign soon, or later, but isn't obligated to. Want to make that campaign happen? Leave a comment and tell your friends: + {{ rightsholder }} may be running a campaign soon, or later, but isn't obligated to. Want to make that campaign happen? Leave a comment and tell your friends: - {% url 'work' claim.work.id as work_url %} + {% url 'work' claim.work_id as work_url %} {% include "notification/sharing_block.html" %} Make sure {{ rightsholder }} knows how much you want to give this book to the world. diff --git a/frontend/templates/rh_tools.html b/frontend/templates/rh_tools.html index b81f5428..a9ceb449 100644 --- a/frontend/templates/rh_tools.html +++ b/frontend/templates/rh_tools.html @@ -50,7 +50,7 @@ If you're an author, publisher, or other rights holder, you can participate more

              Campaigns You Manage

              {% for campaign in campaigns %} -
              {{campaign.name }}
              +
              {{campaign.name }}
              @@ -66,7 +66,7 @@ If you're an author, publisher, or other rights holder, you can participate more Created: {{ campaign.created }}
              ${{ campaign.current_total }} sold. ${{ campaign.target }} to go. Ungluing Date: {{ campaign.cc_date }}
              {% with campaign.work.preferred_edition as edition %} - Edit the preferred edition
              + Edit the preferred edition
              You can also Load a file for this edition.
              {% endwith %} {% endifequal %} @@ -76,7 +76,7 @@ If you're an author, publisher, or other rights holder, you can participate more Created: {{ campaign.created }}
              ${{ campaign.current_total }} raised from {{ campaign.supporters_count }} ungluers, {{ campaign.anon_count }} others. {% with campaign.work.preferred_edition as edition %} - Edit the preferred edition
              + Edit the preferred edition
              You can also Load a file for this edition.
              {% endwith %} {% endifequal %} @@ -104,7 +104,7 @@ If you're an author, publisher, or other rights holder, you can participate more

              Works You Have Claimed

              {% for claim in claims %} -
              Title: {{claim.work.title }}   (work #{{ claim.work.id }})
              +
              Title: {{claim.work.title }}   (work #{{ claim.work_id }})
              Author: {{claim.work.authors_short }}
              On Behalf of: {{ claim.rights_holder.rights_holder_name }}
              PSA #: {{ claim.rights_holder.id }} @@ -189,7 +189,7 @@ If you're an author, publisher, or other rights holder, you can participate more
                {% for ebook in claim.work.ebooks_all %} -
              • edition #{{ebook.edition.id}} {{ ebook.format }} {% if not ebook.active %}(inactive){% endif %} +
              • edition #{{ebook.edition_id}} {{ ebook.format }} {% if not ebook.active %}(inactive){% endif %} {{ ebook.download_count }} downloads
              • {% endfor %} diff --git a/frontend/templates/rights_holders.html b/frontend/templates/rights_holders.html index 6a0248a7..e47c1452 100644 --- a/frontend/templates/rights_holders.html +++ b/frontend/templates/rights_holders.html @@ -54,7 +54,7 @@ {% csrf_token %}
                {% for claim, claim_form in pending %} -
                Title: {{claim.work.title }}
                +
                Title: {{claim.work.title }}
                Author: {{claim.work.authors_short }}
                By: {{ claim.user.username }}
                On Behalf of: {{ claim.rights_holder.rights_holder_name }}
                @@ -72,7 +72,7 @@

                Active Claims: {{ active_data.count }}

                {% for claim in active_data %} -
                Title: {{claim.work.title }}
                +
                Title: {{claim.work.title }}
                Author: {{claim.work.authors_short }}
                By: {{ claim.user.username }}
                On Behalf of: {{ claim.rights_holder.rights_holder_name }}
                diff --git a/frontend/views/__init__.py b/frontend/views/__init__.py index 2f15e624..d86d274f 100755 --- a/frontend/views/__init__.py +++ b/frontend/views/__init__.py @@ -650,7 +650,7 @@ def googlebooks(request, googlebooks_id): return HttpResponseNotFound("failed looking up googlebooks id %s" % googlebooks_id) if not edition: return HttpResponseNotFound("invalid googlebooks id") - work_url = reverse('work', kwargs={'work_id': edition.work.id}) + work_url = reverse('work', kwargs={'work_id': edition.work_id}) # process waiting add request if not request.user.is_anonymous() and request.session.has_key("add_wishlist"): @@ -1273,7 +1273,7 @@ class FundView(FormView): data.update( {'preapproval_amount':self.transaction.needed_amount, 'username':self.request.user.username if self.request.user.is_authenticated() else None, - 'work_id':self.transaction.campaign.work.id if self.transaction.campaign else None, + 'work_id':self.transaction.campaign.work_id if self.transaction.campaign else None, 'title':self.transaction.campaign.work.title if self.transaction.campaign else COMPANY_TITLE} ) return kwargs @@ -1466,7 +1466,7 @@ class FundCompleteView(TemplateView): if self.user_is_ok(): return self.render_to_response(context) else: - return HttpResponseRedirect(reverse('work', kwargs={'work_id': self.transaction.campaign.work.id})) + return HttpResponseRedirect(reverse('work', kwargs={'work_id': self.transaction.campaign.work_id})) else: return redirect_to_login(request.get_full_path()) else: @@ -1479,7 +1479,7 @@ class FundCompleteView(TemplateView): # to handle anonymous donors- leakage not an issue return True else: - return self.request.user.id == self.transaction.user.id + return self.request.user.id == self.transaction.user_id @@ -1625,7 +1625,7 @@ class PledgeCancelView(FormView): from regluit.payment.signals import pledge_modified pledge_modified.send(sender=self, transaction=transaction, up_or_down="canceled") logger.info("pledge_modified notice for cancellation: sender {0}, transaction {1}".format(self, transaction)) - return HttpResponseRedirect(reverse('work', kwargs={'work_id': campaign.work.id})) + return HttpResponseRedirect(reverse('work', kwargs={'work_id': campaign.work_id})) else: logger.error("Attempt to cancel transaction id {0} failed".format(transaction.id)) return HttpResponse("Our attempt to cancel your transaction failed. We have logged this error.") @@ -1731,7 +1731,7 @@ def new_survey(request, work_id): if form.is_valid(): if not work and form.work: for my_work in my_works: - print '{} {}'.format(my_work.id, form.work.id) + print '{} {}'.format(my_work.id, form.work_id) if my_work == form.work: work = form.work break @@ -1760,7 +1760,7 @@ def rh_tools(request): return render(request, "rh_tools.html") for claim in claims: if claim.can_open_new: - if request.method == 'POST' and request.POST.has_key('cl_%s-work' % claim.id) and int(request.POST['cl_%s-work' % claim.id]) == claim.work.id : + if request.method == 'POST' and request.POST.has_key('cl_%s-work' % claim.id) and int(request.POST['cl_%s-work' % claim.id]) == claim.work_id : claim.campaign_form = OpenCampaignForm(data = request.POST, prefix = 'cl_'+str(claim.id),) if claim.campaign_form.is_valid(): new_campaign = claim.campaign_form.save(commit=False) @@ -2680,7 +2680,7 @@ def ask_rh(request, campaign_id): campaign = get_object_or_404(models.Campaign, id=campaign_id) return feedback(request, recipient=campaign.email, template="ask_rh.html", message_template="ask_rh.txt", - redirect_url = reverse('work', args=[campaign.work.id]), + redirect_url = reverse('work', args=[campaign.work_id]), extra_context={'campaign':campaign, 'subject':campaign }) def feedback(request, recipient='support@gluejar.com', template='feedback.html', message_template='feedback.txt', extra_context=None, redirect_url=None): @@ -3018,7 +3018,7 @@ def receive_gift(request, nonce): if gift.used: if request.user.is_authenticated(): #check that user hasn't redeemed the gift themselves - if (gift.acq.user.id == request.user.id) and not gift.acq.expired: + if (gift.acq.user_id == request.user.id) and not gift.acq.expired: return HttpResponseRedirect(reverse('display_gift', args=[gift.id,'existing'])) return render(request, 'gift_error.html', context) if request.user.is_authenticated(): @@ -3069,7 +3069,7 @@ def display_gift(request, gift_id, message): gift = models.Gift.objects.get(id=gift_id) except models.Gift.DoesNotExist: return render(request, 'gift_error.html',) - if request.user.id != gift.acq.user.id : + if request.user.id != gift.acq.user_id : return HttpResponse("this is not your gift") redeemed_gift = request.session.get('gift_nonce', None) == gift.acq.nonce context = {'gift': gift, 'work': gift.acq.work , 'message':message } diff --git a/frontend/views/bibedit.py b/frontend/views/bibedit.py index d1de2a33..de7da4e3 100644 --- a/frontend/views/bibedit.py +++ b/frontend/views/bibedit.py @@ -163,7 +163,7 @@ def new_edition(request, by=None): return HttpResponseRedirect( reverse('new_edition', kwargs={ - 'work_id': edition.work.id, + 'work_id': edition.work_id, 'edition_id': edition.id }) ) @@ -310,7 +310,7 @@ def edit_edition(request, work_id, edition_id, by=None): bisacsh = bisacsh.parent for subject_name in edition.new_subjects: add_subject(subject_name, work) - work_url = reverse('work', kwargs={'work_id': edition.work.id}) + work_url = reverse('work', kwargs={'work_id': edition.work_id}) cover_file = form.cleaned_data.get("coverfile", None) if cover_file: # save it