Merge branch 'master' into ssl_redirect
commit
b6e17b6fcf
11
admin.py
11
admin.py
|
@ -85,7 +85,7 @@ class RightsHolderAdmin(ModelAdmin):
|
|||
form = RightsHolderAdminForm
|
||||
|
||||
class AcqAdmin(ModelAdmin):
|
||||
fields = ("expires", "refreshes", )
|
||||
readonly_fields = ('work', 'user', 'lib_acq', 'watermarked')
|
||||
search_fields = ['user__username']
|
||||
date_hierarchy = 'created'
|
||||
|
||||
|
@ -176,6 +176,14 @@ class UserProfileAdmin(ModelAdmin):
|
|||
date_hierarchy = 'created'
|
||||
exclude = ('user',)
|
||||
|
||||
class GiftAdmin(ModelAdmin):
|
||||
list_display = ('to', 'acq_admin_link', 'giver', )
|
||||
search_fields = ('giver__username', 'to')
|
||||
readonly_fields = ('giver', 'acq',)
|
||||
def acq_admin_link(self, gift):
|
||||
return "<a href='/admin/core/acq/%s/'>%s</a>" % (gift.acq.id, gift.acq)
|
||||
acq_admin_link.allow_tags = True
|
||||
|
||||
class CeleryTaskAdmin(ModelAdmin):
|
||||
pass
|
||||
|
||||
|
@ -244,6 +252,7 @@ admin_site.register(models.Wishlist, WishlistAdmin)
|
|||
admin_site.register(models.UserProfile, UserProfileAdmin)
|
||||
admin_site.register(models.CeleryTask, CeleryTaskAdmin)
|
||||
admin_site.register(models.Press, PressAdmin)
|
||||
admin_site.register(models.Gift, GiftAdmin)
|
||||
admin_site.register(MARCRecord, MARCRecordAdmin)
|
||||
|
||||
# payments
|
||||
|
|
|
@ -174,8 +174,7 @@ class active_campaigns(Facet):
|
|||
"""
|
||||
title = "Unglue.it Catalog: Books under Active Campaign"
|
||||
feed_path = "active_campaigns"
|
||||
works = models.Work.objects.filter(campaigns__status='ACTIVE',
|
||||
editions__ebooks__isnull=False).distinct()
|
||||
works = models.Work.objects.filter(campaigns__status='ACTIVE', is_free = True)
|
||||
description= "With your help we're raising money to make these books free to the world."
|
||||
|
||||
def opds_feed_for_works(the_facet, page=None, order_by='newest'):
|
||||
|
|
|
@ -474,6 +474,8 @@ def merge_works(w1, w2, user=None):
|
|||
w1.description = w2.description
|
||||
if w2.featured and not w1.featured:
|
||||
w1.featured = w2.featured
|
||||
if w2.is_free and not w1.is_free:
|
||||
w1.is_free = True
|
||||
w1.save()
|
||||
for wishlist in models.Wishlist.objects.filter(works__in=[w2]):
|
||||
w2source = wishlist.work_source(w2)
|
||||
|
|
|
@ -13,7 +13,7 @@ class BaseFacet(object):
|
|||
if self.outer_facet:
|
||||
return self.outer_facet.get_query_set()
|
||||
else:
|
||||
return self.model.objects.filter(editions__ebooks__isnull=False)
|
||||
return self.model.objects.filter(is_free=True)
|
||||
|
||||
def __unicode__(self):
|
||||
if self.facet_name == 'all':
|
||||
|
|
|
@ -0,0 +1,345 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import datetime
|
||||
from south.db import db
|
||||
from south.v2 import SchemaMigration
|
||||
from django.db import models
|
||||
|
||||
|
||||
class Migration(SchemaMigration):
|
||||
|
||||
def forwards(self, orm):
|
||||
# Adding field 'Work.is_free'
|
||||
db.add_column('core_work', 'is_free',
|
||||
self.gf('django.db.models.fields.BooleanField')(default=False),
|
||||
keep_default=False)
|
||||
if not db.dry_run:
|
||||
for work in orm.Work.objects.all():
|
||||
if orm.Ebook.objects.filter(edition__work=work).count()>0:
|
||||
work.is_free = True
|
||||
work.save()
|
||||
|
||||
|
||||
def backwards(self, orm):
|
||||
# Deleting field 'Work.is_free'
|
||||
db.delete_column('core_work', 'is_free')
|
||||
|
||||
|
||||
models = {
|
||||
'auth.group': {
|
||||
'Meta': {'object_name': 'Group'},
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
|
||||
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
|
||||
},
|
||||
'auth.permission': {
|
||||
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
|
||||
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
|
||||
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
|
||||
},
|
||||
'auth.user': {
|
||||
'Meta': {'object_name': 'User'},
|
||||
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
|
||||
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
|
||||
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
|
||||
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
|
||||
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
|
||||
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
|
||||
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
|
||||
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
|
||||
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
|
||||
},
|
||||
'booxtream.boox': {
|
||||
'Meta': {'object_name': 'Boox'},
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'download_link_epub': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True'}),
|
||||
'download_link_mobi': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True'}),
|
||||
'downloads_remaining': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0'}),
|
||||
'expirydays': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'referenceid': ('django.db.models.fields.CharField', [], {'max_length': '32'})
|
||||
},
|
||||
'contenttypes.contenttype': {
|
||||
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
|
||||
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
|
||||
},
|
||||
'core.acq': {
|
||||
'Meta': {'object_name': 'Acq'},
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
|
||||
'expires': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'lib_acq': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'loans'", 'null': 'True', 'to': "orm['core.Acq']"}),
|
||||
'license': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '1'}),
|
||||
'nonce': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
|
||||
'refreshed': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
|
||||
'refreshes': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 12, 11, 0, 0)', 'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'acqs'", 'to': "orm['auth.User']"}),
|
||||
'watermarked': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['booxtream.Boox']", 'null': 'True'}),
|
||||
'work': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'acqs'", 'to': "orm['core.Work']"})
|
||||
},
|
||||
'core.author': {
|
||||
'Meta': {'object_name': 'Author'},
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'editions': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'authors'", 'symmetrical': 'False', 'to': "orm['core.Edition']"}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'max_length': '500'})
|
||||
},
|
||||
'core.badge': {
|
||||
'Meta': {'object_name': 'Badge'},
|
||||
'description': ('django.db.models.fields.TextField', [], {'default': "''", 'null': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'max_length': '72', 'blank': 'True'})
|
||||
},
|
||||
'core.campaign': {
|
||||
'Meta': {'object_name': 'Campaign'},
|
||||
'activated': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}),
|
||||
'amazon_receiver': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
|
||||
'cc_date_initial': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'deadline': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}),
|
||||
'description': ('ckeditor.fields.RichTextField', [], {'null': 'True'}),
|
||||
'details': ('ckeditor.fields.RichTextField', [], {'null': 'True', 'blank': 'True'}),
|
||||
'do_watermark': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
|
||||
'dollar_per_day': ('django.db.models.fields.FloatField', [], {'null': 'True'}),
|
||||
'edition': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'campaigns'", 'null': 'True', 'to': "orm['core.Edition']"}),
|
||||
'email': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'left': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '14', 'decimal_places': '2', 'db_index': 'True'}),
|
||||
'license': ('django.db.models.fields.CharField', [], {'default': "'CC BY-NC-ND'", 'max_length': '255'}),
|
||||
'managers': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'campaigns'", 'symmetrical': 'False', 'to': "orm['auth.User']"}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True'}),
|
||||
'paypal_receiver': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
|
||||
'publisher': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'campaigns'", 'null': 'True', 'to': "orm['core.Publisher']"}),
|
||||
'status': ('django.db.models.fields.CharField', [], {'default': "'INITIALIZED'", 'max_length': '15', 'null': 'True', 'db_index': 'True'}),
|
||||
'target': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'null': 'True', 'max_digits': '14', 'decimal_places': '2'}),
|
||||
'type': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '1'}),
|
||||
'use_add_ask': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
|
||||
'work': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'campaigns'", 'to': "orm['core.Work']"})
|
||||
},
|
||||
'core.campaignaction': {
|
||||
'Meta': {'object_name': 'CampaignAction'},
|
||||
'campaign': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'actions'", 'to': "orm['core.Campaign']"}),
|
||||
'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'timestamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'type': ('django.db.models.fields.CharField', [], {'max_length': '15'})
|
||||
},
|
||||
'core.celerytask': {
|
||||
'Meta': {'object_name': 'CeleryTask'},
|
||||
'active': ('django.db.models.fields.NullBooleanField', [], {'default': 'True', 'null': 'True', 'blank': 'True'}),
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 12, 11, 0, 0)', 'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'description': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'null': 'True'}),
|
||||
'function_args': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
|
||||
'function_name': ('django.db.models.fields.CharField', [], {'max_length': '1024'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'task_id': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
|
||||
'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'tasks'", 'null': 'True', 'to': "orm['auth.User']"})
|
||||
},
|
||||
'core.claim': {
|
||||
'Meta': {'object_name': 'Claim'},
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'rights_holder': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'claim'", 'to': "orm['core.RightsHolder']"}),
|
||||
'status': ('django.db.models.fields.CharField', [], {'default': "'active'", 'max_length': '7'}),
|
||||
'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'claim'", 'to': "orm['auth.User']"}),
|
||||
'work': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'claim'", 'to': "orm['core.Work']"})
|
||||
},
|
||||
'core.ebook': {
|
||||
'Meta': {'object_name': 'Ebook'},
|
||||
'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
|
||||
'download_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
|
||||
'edition': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'ebooks'", 'to': "orm['core.Edition']"}),
|
||||
'format': ('django.db.models.fields.CharField', [], {'max_length': '25'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'provider': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
|
||||
'rights': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_index': 'True'}),
|
||||
'url': ('django.db.models.fields.URLField', [], {'max_length': '1024'}),
|
||||
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'})
|
||||
},
|
||||
'core.ebookfile': {
|
||||
'Meta': {'object_name': 'EbookFile'},
|
||||
'asking': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'edition': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'ebook_files'", 'to': "orm['core.Edition']"}),
|
||||
'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
|
||||
'format': ('django.db.models.fields.CharField', [], {'max_length': '25'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
|
||||
},
|
||||
'core.edition': {
|
||||
'Meta': {'object_name': 'Edition'},
|
||||
'cover_image': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'publication_date': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '50', 'null': 'True', 'blank': 'True'}),
|
||||
'publisher_name': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'editions'", 'null': 'True', 'to': "orm['core.PublisherName']"}),
|
||||
'title': ('django.db.models.fields.CharField', [], {'max_length': '1000'}),
|
||||
'unglued': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'work': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'editions'", 'null': 'True', 'to': "orm['core.Work']"})
|
||||
},
|
||||
'core.hold': {
|
||||
'Meta': {'object_name': 'Hold'},
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'library': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'holds'", 'to': "orm['libraryauth.Library']"}),
|
||||
'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'holds'", 'to': "orm['auth.User']"}),
|
||||
'work': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'holds'", 'to': "orm['core.Work']"})
|
||||
},
|
||||
'core.identifier': {
|
||||
'Meta': {'unique_together': "(('type', 'value'),)", 'object_name': 'Identifier'},
|
||||
'edition': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'identifiers'", 'null': 'True', 'to': "orm['core.Edition']"}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'type': ('django.db.models.fields.CharField', [], {'max_length': '4'}),
|
||||
'value': ('django.db.models.fields.CharField', [], {'max_length': '250'}),
|
||||
'work': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'identifiers'", 'to': "orm['core.Work']"})
|
||||
},
|
||||
'core.key': {
|
||||
'Meta': {'object_name': 'Key'},
|
||||
'encrypted_value': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'})
|
||||
},
|
||||
'core.libpref': {
|
||||
'Meta': {'object_name': 'Libpref'},
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'marc_link_target': ('django.db.models.fields.CharField', [], {'default': "'UNGLUE'", 'max_length': '6'}),
|
||||
'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'libpref'", 'unique': 'True', 'to': "orm['auth.User']"})
|
||||
},
|
||||
'core.offer': {
|
||||
'Meta': {'object_name': 'Offer'},
|
||||
'active': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'license': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '1'}),
|
||||
'price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '6', 'decimal_places': '2'}),
|
||||
'work': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'offers'", 'to': "orm['core.Work']"})
|
||||
},
|
||||
'core.premium': {
|
||||
'Meta': {'object_name': 'Premium'},
|
||||
'amount': ('django.db.models.fields.DecimalField', [], {'max_digits': '10', 'decimal_places': '0'}),
|
||||
'campaign': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'premiums'", 'null': 'True', 'to': "orm['core.Campaign']"}),
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'description': ('django.db.models.fields.TextField', [], {'null': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'limit': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
|
||||
'type': ('django.db.models.fields.CharField', [], {'max_length': '2'})
|
||||
},
|
||||
'core.press': {
|
||||
'Meta': {'object_name': 'Press'},
|
||||
'date': ('django.db.models.fields.DateField', [], {'db_index': 'True'}),
|
||||
'highlight': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'language': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}),
|
||||
'note': ('django.db.models.fields.CharField', [], {'max_length': '140', 'blank': 'True'}),
|
||||
'source': ('django.db.models.fields.CharField', [], {'max_length': '140'}),
|
||||
'title': ('django.db.models.fields.CharField', [], {'max_length': '140'}),
|
||||
'url': ('django.db.models.fields.URLField', [], {'max_length': '200'})
|
||||
},
|
||||
'core.publisher': {
|
||||
'Meta': {'object_name': 'Publisher'},
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'description': ('django.db.models.fields.TextField', [], {'default': "''", 'null': 'True', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'logo_url': ('django.db.models.fields.URLField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}),
|
||||
'name': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'key_publisher'", 'to': "orm['core.PublisherName']"}),
|
||||
'url': ('django.db.models.fields.URLField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'})
|
||||
},
|
||||
'core.publishername': {
|
||||
'Meta': {'object_name': 'PublisherName'},
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
|
||||
'publisher': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'alternate_names'", 'null': 'True', 'to': "orm['core.Publisher']"})
|
||||
},
|
||||
'core.rightsholder': {
|
||||
'Meta': {'object_name': 'RightsHolder'},
|
||||
'can_sell': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'email': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'rights_holder'", 'to': "orm['auth.User']"}),
|
||||
'rights_holder_name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
|
||||
},
|
||||
'core.subject': {
|
||||
'Meta': {'ordering': "['name']", 'object_name': 'Subject'},
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '200'}),
|
||||
'works': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'subjects'", 'symmetrical': 'False', 'to': "orm['core.Work']"})
|
||||
},
|
||||
'core.userprofile': {
|
||||
'Meta': {'object_name': 'UserProfile'},
|
||||
'avatar_source': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '4', 'null': 'True'}),
|
||||
'badges': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'holders'", 'symmetrical': 'False', 'to': "orm['core.Badge']"}),
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'facebook_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'}),
|
||||
'goodreads_auth_secret': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
|
||||
'goodreads_auth_token': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
|
||||
'goodreads_user_id': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
|
||||
'goodreads_user_link': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
|
||||
'goodreads_user_name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
|
||||
'home_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'kindle_email': ('django.db.models.fields.EmailField', [], {'max_length': '254', 'blank': 'True'}),
|
||||
'librarything_id': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}),
|
||||
'pic_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
|
||||
'tagline': ('django.db.models.fields.CharField', [], {'max_length': '140', 'blank': 'True'}),
|
||||
'twitter_id': ('django.db.models.fields.CharField', [], {'max_length': '15', 'blank': 'True'}),
|
||||
'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"})
|
||||
},
|
||||
'core.waswork': {
|
||||
'Meta': {'object_name': 'WasWork'},
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'moved': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}),
|
||||
'was': ('django.db.models.fields.IntegerField', [], {'unique': 'True'}),
|
||||
'work': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['core.Work']"})
|
||||
},
|
||||
'core.wishes': {
|
||||
'Meta': {'object_name': 'Wishes', 'db_table': "'core_wishlist_works'"},
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'source': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '15', 'blank': 'True'}),
|
||||
'wishlist': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['core.Wishlist']"}),
|
||||
'work': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'wishes'", 'to': "orm['core.Work']"})
|
||||
},
|
||||
'core.wishlist': {
|
||||
'Meta': {'object_name': 'Wishlist'},
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'wishlist'", 'unique': 'True', 'to': "orm['auth.User']"}),
|
||||
'works': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'wishlists'", 'symmetrical': 'False', 'through': "orm['core.Wishes']", 'to': "orm['core.Work']"})
|
||||
},
|
||||
'core.work': {
|
||||
'Meta': {'ordering': "['title']", 'object_name': 'Work'},
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
|
||||
'description': ('django.db.models.fields.TextField', [], {'default': "''", 'null': 'True', 'blank': 'True'}),
|
||||
'earliest_publication': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True'}),
|
||||
'featured': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'is_free': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'language': ('django.db.models.fields.CharField', [], {'default': "'en'", 'max_length': '5', 'db_index': 'True'}),
|
||||
'num_wishes': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}),
|
||||
'openlibrary_lookup': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
|
||||
'selected_edition': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'selected_works'", 'null': 'True', 'to': "orm['core.Edition']"}),
|
||||
'title': ('django.db.models.fields.CharField', [], {'max_length': '1000'})
|
||||
},
|
||||
'libraryauth.library': {
|
||||
'Meta': {'object_name': 'Library'},
|
||||
'approved': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'backend': ('django.db.models.fields.CharField', [], {'default': "'ip'", 'max_length': '10'}),
|
||||
'group': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'library'", 'unique': 'True', 'null': 'True', 'to': "orm['auth.Group']"}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '80'}),
|
||||
'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'libraries'", 'to': "orm['auth.User']"}),
|
||||
'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'library'", 'unique': 'True', 'to': "orm['auth.User']"})
|
||||
}
|
||||
}
|
||||
|
||||
complete_apps = ['core']
|
|
@ -0,0 +1,355 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import datetime
|
||||
from south.db import db
|
||||
from south.v2 import SchemaMigration
|
||||
from django.db import models
|
||||
|
||||
|
||||
class Migration(SchemaMigration):
|
||||
|
||||
def forwards(self, orm):
|
||||
# Adding model 'Gift'
|
||||
db.create_table('core_gift', (
|
||||
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
|
||||
('acq', self.gf('django.db.models.fields.related.ForeignKey')(related_name='gifts', to=orm['core.Acq'])),
|
||||
('to', self.gf('django.db.models.fields.CharField')(max_length=75, blank=True)),
|
||||
('giver', self.gf('django.db.models.fields.related.ForeignKey')(related_name='gifts', to=orm['auth.User'])),
|
||||
('message', self.gf('django.db.models.fields.TextField')(default='', max_length=512)),
|
||||
('used', self.gf('django.db.models.fields.DateTimeField')(null=True)),
|
||||
))
|
||||
db.send_create_signal('core', ['Gift'])
|
||||
|
||||
|
||||
def backwards(self, orm):
|
||||
# Deleting model 'Gift'
|
||||
db.delete_table('core_gift')
|
||||
|
||||
|
||||
models = {
|
||||
'auth.group': {
|
||||
'Meta': {'object_name': 'Group'},
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
|
||||
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
|
||||
},
|
||||
'auth.permission': {
|
||||
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
|
||||
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
|
||||
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
|
||||
},
|
||||
'auth.user': {
|
||||
'Meta': {'object_name': 'User'},
|
||||
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
|
||||
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
|
||||
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
|
||||
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
|
||||
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
|
||||
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
|
||||
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
|
||||
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
|
||||
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
|
||||
},
|
||||
'booxtream.boox': {
|
||||
'Meta': {'object_name': 'Boox'},
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'download_link_epub': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True'}),
|
||||
'download_link_mobi': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True'}),
|
||||
'downloads_remaining': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0'}),
|
||||
'expirydays': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'referenceid': ('django.db.models.fields.CharField', [], {'max_length': '32'})
|
||||
},
|
||||
'contenttypes.contenttype': {
|
||||
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
|
||||
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
|
||||
},
|
||||
'core.acq': {
|
||||
'Meta': {'object_name': 'Acq'},
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
|
||||
'expires': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'lib_acq': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'loans'", 'null': 'True', 'to': "orm['core.Acq']"}),
|
||||
'license': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '1'}),
|
||||
'nonce': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
|
||||
'refreshed': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
|
||||
'refreshes': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 12, 22, 0, 0)', 'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'acqs'", 'to': "orm['auth.User']"}),
|
||||
'watermarked': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['booxtream.Boox']", 'null': 'True'}),
|
||||
'work': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'acqs'", 'to': "orm['core.Work']"})
|
||||
},
|
||||
'core.author': {
|
||||
'Meta': {'object_name': 'Author'},
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'editions': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'authors'", 'symmetrical': 'False', 'to': "orm['core.Edition']"}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'max_length': '500'})
|
||||
},
|
||||
'core.badge': {
|
||||
'Meta': {'object_name': 'Badge'},
|
||||
'description': ('django.db.models.fields.TextField', [], {'default': "''", 'null': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'max_length': '72', 'blank': 'True'})
|
||||
},
|
||||
'core.campaign': {
|
||||
'Meta': {'object_name': 'Campaign'},
|
||||
'activated': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}),
|
||||
'amazon_receiver': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
|
||||
'cc_date_initial': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'deadline': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}),
|
||||
'description': ('ckeditor.fields.RichTextField', [], {'null': 'True'}),
|
||||
'details': ('ckeditor.fields.RichTextField', [], {'null': 'True', 'blank': 'True'}),
|
||||
'do_watermark': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
|
||||
'dollar_per_day': ('django.db.models.fields.FloatField', [], {'null': 'True'}),
|
||||
'edition': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'campaigns'", 'null': 'True', 'to': "orm['core.Edition']"}),
|
||||
'email': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'left': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '14', 'decimal_places': '2', 'db_index': 'True'}),
|
||||
'license': ('django.db.models.fields.CharField', [], {'default': "'CC BY-NC-ND'", 'max_length': '255'}),
|
||||
'managers': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'campaigns'", 'symmetrical': 'False', 'to': "orm['auth.User']"}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True'}),
|
||||
'paypal_receiver': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
|
||||
'publisher': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'campaigns'", 'null': 'True', 'to': "orm['core.Publisher']"}),
|
||||
'status': ('django.db.models.fields.CharField', [], {'default': "'INITIALIZED'", 'max_length': '15', 'null': 'True', 'db_index': 'True'}),
|
||||
'target': ('django.db.models.fields.DecimalField', [], {'default': '0.0', 'null': 'True', 'max_digits': '14', 'decimal_places': '2'}),
|
||||
'type': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '1'}),
|
||||
'use_add_ask': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
|
||||
'work': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'campaigns'", 'to': "orm['core.Work']"})
|
||||
},
|
||||
'core.campaignaction': {
|
||||
'Meta': {'object_name': 'CampaignAction'},
|
||||
'campaign': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'actions'", 'to': "orm['core.Campaign']"}),
|
||||
'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'timestamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'type': ('django.db.models.fields.CharField', [], {'max_length': '15'})
|
||||
},
|
||||
'core.celerytask': {
|
||||
'Meta': {'object_name': 'CeleryTask'},
|
||||
'active': ('django.db.models.fields.NullBooleanField', [], {'default': 'True', 'null': 'True', 'blank': 'True'}),
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 12, 22, 0, 0)', 'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'description': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'null': 'True'}),
|
||||
'function_args': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
|
||||
'function_name': ('django.db.models.fields.CharField', [], {'max_length': '1024'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'task_id': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
|
||||
'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'tasks'", 'null': 'True', 'to': "orm['auth.User']"})
|
||||
},
|
||||
'core.claim': {
|
||||
'Meta': {'object_name': 'Claim'},
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'rights_holder': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'claim'", 'to': "orm['core.RightsHolder']"}),
|
||||
'status': ('django.db.models.fields.CharField', [], {'default': "'active'", 'max_length': '7'}),
|
||||
'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'claim'", 'to': "orm['auth.User']"}),
|
||||
'work': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'claim'", 'to': "orm['core.Work']"})
|
||||
},
|
||||
'core.ebook': {
|
||||
'Meta': {'object_name': 'Ebook'},
|
||||
'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
|
||||
'download_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
|
||||
'edition': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'ebooks'", 'to': "orm['core.Edition']"}),
|
||||
'format': ('django.db.models.fields.CharField', [], {'max_length': '25'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'provider': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
|
||||
'rights': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_index': 'True'}),
|
||||
'url': ('django.db.models.fields.URLField', [], {'max_length': '1024'}),
|
||||
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'})
|
||||
},
|
||||
'core.ebookfile': {
|
||||
'Meta': {'object_name': 'EbookFile'},
|
||||
'asking': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'edition': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'ebook_files'", 'to': "orm['core.Edition']"}),
|
||||
'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
|
||||
'format': ('django.db.models.fields.CharField', [], {'max_length': '25'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
|
||||
},
|
||||
'core.edition': {
|
||||
'Meta': {'object_name': 'Edition'},
|
||||
'cover_image': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'publication_date': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '50', 'null': 'True', 'blank': 'True'}),
|
||||
'publisher_name': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'editions'", 'null': 'True', 'to': "orm['core.PublisherName']"}),
|
||||
'title': ('django.db.models.fields.CharField', [], {'max_length': '1000'}),
|
||||
'unglued': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'work': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'editions'", 'null': 'True', 'to': "orm['core.Work']"})
|
||||
},
|
||||
'core.gift': {
|
||||
'Meta': {'object_name': 'Gift'},
|
||||
'acq': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'gifts'", 'to': "orm['core.Acq']"}),
|
||||
'giver': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'gifts'", 'to': "orm['auth.User']"}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'message': ('django.db.models.fields.TextField', [], {'default': "''", 'max_length': '512'}),
|
||||
'to': ('django.db.models.fields.CharField', [], {'max_length': '75', 'blank': 'True'}),
|
||||
'used': ('django.db.models.fields.DateTimeField', [], {'null': 'True'})
|
||||
},
|
||||
'core.hold': {
|
||||
'Meta': {'object_name': 'Hold'},
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'library': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'holds'", 'to': "orm['libraryauth.Library']"}),
|
||||
'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'holds'", 'to': "orm['auth.User']"}),
|
||||
'work': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'holds'", 'to': "orm['core.Work']"})
|
||||
},
|
||||
'core.identifier': {
|
||||
'Meta': {'unique_together': "(('type', 'value'),)", 'object_name': 'Identifier'},
|
||||
'edition': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'identifiers'", 'null': 'True', 'to': "orm['core.Edition']"}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'type': ('django.db.models.fields.CharField', [], {'max_length': '4'}),
|
||||
'value': ('django.db.models.fields.CharField', [], {'max_length': '250'}),
|
||||
'work': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'identifiers'", 'to': "orm['core.Work']"})
|
||||
},
|
||||
'core.key': {
|
||||
'Meta': {'object_name': 'Key'},
|
||||
'encrypted_value': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'})
|
||||
},
|
||||
'core.libpref': {
|
||||
'Meta': {'object_name': 'Libpref'},
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'marc_link_target': ('django.db.models.fields.CharField', [], {'default': "'UNGLUE'", 'max_length': '6'}),
|
||||
'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'libpref'", 'unique': 'True', 'to': "orm['auth.User']"})
|
||||
},
|
||||
'core.offer': {
|
||||
'Meta': {'object_name': 'Offer'},
|
||||
'active': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'license': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '1'}),
|
||||
'price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '6', 'decimal_places': '2'}),
|
||||
'work': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'offers'", 'to': "orm['core.Work']"})
|
||||
},
|
||||
'core.premium': {
|
||||
'Meta': {'object_name': 'Premium'},
|
||||
'amount': ('django.db.models.fields.DecimalField', [], {'max_digits': '10', 'decimal_places': '0'}),
|
||||
'campaign': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'premiums'", 'null': 'True', 'to': "orm['core.Campaign']"}),
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'description': ('django.db.models.fields.TextField', [], {'null': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'limit': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
|
||||
'type': ('django.db.models.fields.CharField', [], {'max_length': '2'})
|
||||
},
|
||||
'core.press': {
|
||||
'Meta': {'object_name': 'Press'},
|
||||
'date': ('django.db.models.fields.DateField', [], {'db_index': 'True'}),
|
||||
'highlight': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'language': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}),
|
||||
'note': ('django.db.models.fields.CharField', [], {'max_length': '140', 'blank': 'True'}),
|
||||
'source': ('django.db.models.fields.CharField', [], {'max_length': '140'}),
|
||||
'title': ('django.db.models.fields.CharField', [], {'max_length': '140'}),
|
||||
'url': ('django.db.models.fields.URLField', [], {'max_length': '200'})
|
||||
},
|
||||
'core.publisher': {
|
||||
'Meta': {'object_name': 'Publisher'},
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'description': ('django.db.models.fields.TextField', [], {'default': "''", 'null': 'True', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'logo_url': ('django.db.models.fields.URLField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}),
|
||||
'name': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'key_publisher'", 'to': "orm['core.PublisherName']"}),
|
||||
'url': ('django.db.models.fields.URLField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'})
|
||||
},
|
||||
'core.publishername': {
|
||||
'Meta': {'object_name': 'PublisherName'},
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
|
||||
'publisher': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'alternate_names'", 'null': 'True', 'to': "orm['core.Publisher']"})
|
||||
},
|
||||
'core.rightsholder': {
|
||||
'Meta': {'object_name': 'RightsHolder'},
|
||||
'can_sell': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'email': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'rights_holder'", 'to': "orm['auth.User']"}),
|
||||
'rights_holder_name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
|
||||
},
|
||||
'core.subject': {
|
||||
'Meta': {'ordering': "['name']", 'object_name': 'Subject'},
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '200'}),
|
||||
'works': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'subjects'", 'symmetrical': 'False', 'to': "orm['core.Work']"})
|
||||
},
|
||||
'core.userprofile': {
|
||||
'Meta': {'object_name': 'UserProfile'},
|
||||
'avatar_source': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '4', 'null': 'True'}),
|
||||
'badges': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'holders'", 'symmetrical': 'False', 'to': "orm['core.Badge']"}),
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'facebook_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'}),
|
||||
'goodreads_auth_secret': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
|
||||
'goodreads_auth_token': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
|
||||
'goodreads_user_id': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
|
||||
'goodreads_user_link': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
|
||||
'goodreads_user_name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
|
||||
'home_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'kindle_email': ('django.db.models.fields.EmailField', [], {'max_length': '254', 'blank': 'True'}),
|
||||
'librarything_id': ('django.db.models.fields.CharField', [], {'max_length': '31', 'blank': 'True'}),
|
||||
'pic_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
|
||||
'tagline': ('django.db.models.fields.CharField', [], {'max_length': '140', 'blank': 'True'}),
|
||||
'twitter_id': ('django.db.models.fields.CharField', [], {'max_length': '15', 'blank': 'True'}),
|
||||
'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"})
|
||||
},
|
||||
'core.waswork': {
|
||||
'Meta': {'object_name': 'WasWork'},
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'moved': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}),
|
||||
'was': ('django.db.models.fields.IntegerField', [], {'unique': 'True'}),
|
||||
'work': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['core.Work']"})
|
||||
},
|
||||
'core.wishes': {
|
||||
'Meta': {'object_name': 'Wishes', 'db_table': "'core_wishlist_works'"},
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'source': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '15', 'blank': 'True'}),
|
||||
'wishlist': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['core.Wishlist']"}),
|
||||
'work': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'wishes'", 'to': "orm['core.Work']"})
|
||||
},
|
||||
'core.wishlist': {
|
||||
'Meta': {'object_name': 'Wishlist'},
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'wishlist'", 'unique': 'True', 'to': "orm['auth.User']"}),
|
||||
'works': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'wishlists'", 'symmetrical': 'False', 'through': "orm['core.Wishes']", 'to': "orm['core.Work']"})
|
||||
},
|
||||
'core.work': {
|
||||
'Meta': {'ordering': "['title']", 'object_name': 'Work'},
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
|
||||
'description': ('django.db.models.fields.TextField', [], {'default': "''", 'null': 'True', 'blank': 'True'}),
|
||||
'earliest_publication': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True'}),
|
||||
'featured': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'is_free': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'language': ('django.db.models.fields.CharField', [], {'default': "'en'", 'max_length': '5', 'db_index': 'True'}),
|
||||
'num_wishes': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}),
|
||||
'openlibrary_lookup': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
|
||||
'selected_edition': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'selected_works'", 'null': 'True', 'to': "orm['core.Edition']"}),
|
||||
'title': ('django.db.models.fields.CharField', [], {'max_length': '1000'})
|
||||
},
|
||||
'libraryauth.library': {
|
||||
'Meta': {'object_name': 'Library'},
|
||||
'approved': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'backend': ('django.db.models.fields.CharField', [], {'default': "'ip'", 'max_length': '10'}),
|
||||
'group': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'library'", 'unique': 'True', 'null': 'True', 'to': "orm['auth.Group']"}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '80'}),
|
||||
'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'libraries'", 'to': "orm['auth.User']"}),
|
||||
'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'library'", 'unique': 'True', 'to': "orm['auth.User']"})
|
||||
}
|
||||
}
|
||||
|
||||
complete_apps = ['core']
|
|
@ -26,7 +26,7 @@ from django.core.urlresolvers import reverse
|
|||
from django.core.files.base import ContentFile
|
||||
from django.db import models
|
||||
from django.db.models import F, Q, get_model
|
||||
from django.db.models.signals import post_save
|
||||
from django.db.models.signals import post_save, pre_delete
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
'''
|
||||
|
@ -314,7 +314,7 @@ class Acq(models.Model):
|
|||
return hashlib.md5('%s:%s:%s:%s'%(settings.TWITTER_CONSUMER_SECRET,self.user.id,self.work.id,self.created)).hexdigest()
|
||||
|
||||
def expire_in(self, delta):
|
||||
self.expires = now() + delta
|
||||
self.expires = (now() + delta) if delta else now()
|
||||
self.save()
|
||||
if self.lib_acq:
|
||||
self.lib_acq.refreshes = now() + delta
|
||||
|
@ -1062,6 +1062,7 @@ class Work(models.Model):
|
|||
selected_edition = models.ForeignKey("Edition", related_name = 'selected_works', null = True)
|
||||
earliest_publication = models.CharField(max_length=50, null=True)
|
||||
featured = models.DateTimeField(null=True, blank=True, db_index=True,)
|
||||
is_free = models.BooleanField(default=False)
|
||||
|
||||
|
||||
class Meta:
|
||||
|
@ -1482,7 +1483,7 @@ class Work(models.Model):
|
|||
|
||||
@property
|
||||
def purchased(self):
|
||||
purchases = self.acqs.filter(license=INDIVIDUAL)
|
||||
purchases = self.acqs.filter(license=INDIVIDUAL, expires__isnull = True)
|
||||
if purchases.count()==0:
|
||||
return None
|
||||
else:
|
||||
|
@ -1524,6 +1525,13 @@ class Work(models.Model):
|
|||
else:
|
||||
return None
|
||||
|
||||
@property
|
||||
def is_duplicate(self):
|
||||
# does user have two individual licenses?
|
||||
pending = self.acqs.filter(license=INDIVIDUAL, expires__isnull = True, gifts__used__isnull = True).count()
|
||||
return self.acqs.filter(license=INDIVIDUAL, expires__isnull = True).count() > pending
|
||||
|
||||
|
||||
def get_user_license(self, user):
|
||||
""" This is all the acqs, wrapped in user_license object for the work, user(s) """
|
||||
if user==None:
|
||||
|
@ -1861,6 +1869,23 @@ class Ebook(models.Model):
|
|||
self.active=True
|
||||
self.save()
|
||||
|
||||
def set_free_flag(sender, instance, created, **kwargs):
|
||||
if created:
|
||||
if not instance.edition.work.is_free:
|
||||
instance.edition.work.is_free = True
|
||||
instance.edition.work.save()
|
||||
|
||||
post_save.connect(set_free_flag,sender=Ebook)
|
||||
|
||||
def reset_free_flag(sender, instance, **kwargs):
|
||||
# if the Work associated with the instance Ebook currenly has only 1 Ebook, then it's no longer a free Work
|
||||
# once the instance Ebook is deleted.
|
||||
if instance.edition.work.ebooks().count()==1:
|
||||
instance.edition.work.is_free = False
|
||||
instance.edition.work.save()
|
||||
|
||||
pre_delete.connect(reset_free_flag,sender=Ebook)
|
||||
|
||||
class Wishlist(models.Model):
|
||||
created = models.DateTimeField(auto_now_add=True)
|
||||
user = models.OneToOneField(User, related_name='wishlist')
|
||||
|
@ -1994,7 +2019,7 @@ class UserProfile(models.Model):
|
|||
|
||||
@property
|
||||
def pledges(self):
|
||||
return self.user.transaction_set.filter(status=TRANSACTION_STATUS_ACTIVE)
|
||||
return self.user.transaction_set.filter(status=TRANSACTION_STATUS_ACTIVE, campaign__type=1)
|
||||
|
||||
@property
|
||||
def last_transaction(self):
|
||||
|
@ -2110,6 +2135,26 @@ class Press(models.Model):
|
|||
highlight = models.BooleanField(default=False)
|
||||
note = models.CharField(max_length=140, blank=True)
|
||||
|
||||
class Gift(models.Model):
|
||||
# the acq will contain the recipient, and the work
|
||||
acq = models.ForeignKey('Acq', related_name='gifts')
|
||||
to = models.CharField(max_length = 75, blank = True) # store the email address originally sent to, not necessarily the email of the recipient
|
||||
giver = models.ForeignKey(User, related_name='gifts')
|
||||
message = models.TextField(max_length=512, default='')
|
||||
used = models.DateTimeField(null=True)
|
||||
|
||||
@staticmethod
|
||||
def giftee(email, t_id):
|
||||
# return a user (create a user if necessary)
|
||||
(giftee, new_user) = User.objects.get_or_create(email=email,defaults={'username':'giftee%s' % t_id})
|
||||
giftee.new_user = new_user
|
||||
return giftee
|
||||
|
||||
def use(self):
|
||||
self.used = now()
|
||||
self.save()
|
||||
notification.send([self.giver], "purchase_got_gift", {'gift': self }, True)
|
||||
|
||||
|
||||
# this was causing a circular import problem and we do not seem to be using
|
||||
# anything from regluit.core.signals after this line
|
||||
|
|
|
@ -101,6 +101,8 @@ def create_notice_types(app, created_models, verbosity, **kwargs):
|
|||
notification.create_notice_type("library_borrow", _("Library eBook Borrowed."), _("You've borrowed an ebook through a Library participating in Unglue.it"))
|
||||
notification.create_notice_type("library_reserve", _("Library eBook Reserved."), _("An ebook you've reserved is available."))
|
||||
notification.create_notice_type("library_join", _("New Library User."), _("A library participating in Unglue.it has added a user"))
|
||||
notification.create_notice_type("purchase_gift", _("You have a gift."), _("An ungluer has given you an ebook."))
|
||||
notification.create_notice_type("purchase_got_gift", _("Your gift was received."), _("The ebook you sent as a gift has been redeemed."))
|
||||
|
||||
signals.post_syncdb.connect(create_notice_types, sender=notification)
|
||||
|
||||
|
@ -164,8 +166,9 @@ def handle_transaction_charged(sender,transaction=None, **kwargs):
|
|||
if transaction==None:
|
||||
return
|
||||
transaction._current_total = None
|
||||
context = {'transaction':transaction,'current_site':Site.objects.get_current()}
|
||||
if transaction.campaign.type is REWARDS:
|
||||
notification.send([transaction.user], "pledge_charged", {'transaction':transaction}, True)
|
||||
notification.send([transaction.user], "pledge_charged", context, True)
|
||||
elif transaction.campaign.type is BUY2UNGLUE:
|
||||
# provision the book
|
||||
Acq = get_model('core', 'Acq')
|
||||
|
@ -180,9 +183,18 @@ def handle_transaction_charged(sender,transaction=None, **kwargs):
|
|||
Acq.objects.create(user=library.user,work=transaction.campaign.work,license= LIBRARY)
|
||||
copies -= 1
|
||||
else:
|
||||
new_acq = Acq.objects.create(user=transaction.user,work=transaction.campaign.work,license= transaction.offer.license)
|
||||
if transaction.extra.get('give_to', False):
|
||||
# it's a gift!
|
||||
Gift = get_model('core', 'Gift')
|
||||
giftee = Gift.giftee(transaction.extra['give_to'], str(transaction.id))
|
||||
new_acq = Acq.objects.create(user=giftee, work=transaction.campaign.work, license= transaction.offer.license)
|
||||
gift = Gift.objects.create(acq=new_acq, message=transaction.extra.get('give_message',''), giver=transaction.user , to = transaction.extra['give_to'])
|
||||
context['gift'] = gift
|
||||
notification.send([giftee], "purchase_gift", context, True)
|
||||
else:
|
||||
new_acq = Acq.objects.create(user=transaction.user,work=transaction.campaign.work,license= transaction.offer.license)
|
||||
transaction.campaign.update_left()
|
||||
notification.send([transaction.user], "purchase_complete", {'transaction':transaction}, True)
|
||||
notification.send([transaction.user], "purchase_complete", context, True)
|
||||
from regluit.core.tasks import watermark_acq
|
||||
watermark_acq.delay(new_acq)
|
||||
if transaction.campaign.cc_date < date_today() :
|
||||
|
@ -191,10 +203,10 @@ def handle_transaction_charged(sender,transaction=None, **kwargs):
|
|||
if transaction.user:
|
||||
Acq = get_model('core', 'Acq')
|
||||
new_acq = Acq.objects.create(user=transaction.user, work=transaction.campaign.work, license=THANKED)
|
||||
notification.send([transaction.user], "purchase_complete", {'transaction':transaction}, True)
|
||||
notification.send([transaction.user], "purchase_complete", context, True)
|
||||
elif transaction.receipt:
|
||||
from regluit.core.tasks import send_mail_task
|
||||
message = render_to_string("notification/purchase_complete/full.txt",{'transaction':transaction,'current_site':Site.objects.get_current()})
|
||||
message = render_to_string("notification/purchase_complete/full.txt", context )
|
||||
send_mail_task.delay('unglue.it transaction confirmation', message, 'notices@gluejar.com', [transaction.receipt])
|
||||
if transaction.user:
|
||||
from regluit.core.tasks import emit_notifications
|
||||
|
|
|
@ -183,6 +183,9 @@ class BookLoaderTests(TestCase):
|
|||
e2 = Edition(work=w2)
|
||||
e2.save()
|
||||
|
||||
eb1 = Ebook(edition = e2)
|
||||
eb1.save()
|
||||
|
||||
e2a = Edition(work=w2)
|
||||
e2a.save()
|
||||
|
||||
|
@ -193,6 +196,9 @@ class BookLoaderTests(TestCase):
|
|||
self.assertTrue(e2.work)
|
||||
self.assertEqual(models.Work.objects.count(), 2)
|
||||
|
||||
self.assertTrue(w2.is_free)
|
||||
self.assertFalse(w1.is_free)
|
||||
|
||||
w1_id = w1.id
|
||||
w2_id = w2.id
|
||||
|
||||
|
@ -206,6 +212,8 @@ class BookLoaderTests(TestCase):
|
|||
self.assertEqual(models.WasWork.objects.count(),1)
|
||||
self.assertEqual(w1.subjects.count(),2)
|
||||
|
||||
self.assertTrue(w1.is_free)
|
||||
|
||||
# getting proper view?
|
||||
anon_client = Client()
|
||||
r = anon_client.get("/work/%s/" % w1_id)
|
||||
|
@ -788,6 +796,11 @@ class DownloadPageTest(TestCase):
|
|||
response = anon_client.get("/work/%s/download/" % w.id, follow=True)
|
||||
self.assertContains(response, "/download_ebook/%s/"% eb1.id, count=10)
|
||||
self.assertContains(response, "/download_ebook/%s/"% eb2.id, count=5)
|
||||
self.assertTrue(eb1.edition.work.is_free)
|
||||
eb1.delete()
|
||||
self.assertTrue(eb2.edition.work.is_free)
|
||||
eb2.delete()
|
||||
self.assertFalse(eb2.edition.work.is_free)
|
||||
|
||||
|
||||
class LocaldatetimeTest(TestCase):
|
||||
|
|
|
@ -20,5 +20,4 @@
|
|||
# For more information see the manual pages of crontab(5) and cron(8)
|
||||
#
|
||||
# m h dom mon dow command
|
||||
SHELL=/bin/bash PATH=/opt/regluit/ENV/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||
* * * * * cd /opt/regluit; source /opt/regluit/ENV/bin/activate; /opt/regluit/ENV/bin/django-admin.py emit_notices --settings=regluit.settings.just > /opt/regluit/deploy/emit_notices.log 2>&1 ; touch /opt/regluit/deploy/last-cron
|
||||
* * * * * cd /opt/regluit; . /opt/regluit/ENV/bin/activate; /opt/regluit/ENV/bin/django-admin.py emit_notices --settings=regluit.settings.just > /opt/regluit/deploy/emit_notices.log 2>&1 ; touch /opt/regluit/deploy/last-cron
|
||||
|
|
|
@ -321,6 +321,7 @@ class UserData(forms.Form):
|
|||
}
|
||||
)
|
||||
oldusername = None
|
||||
allow_same = False
|
||||
|
||||
|
||||
def clean_username(self):
|
||||
|
@ -330,7 +331,22 @@ class UserData(forms.Form):
|
|||
for user in users:
|
||||
raise forms.ValidationError(_("Another user with that username already exists."))
|
||||
return username
|
||||
raise forms.ValidationError(_("Your username is already "+username))
|
||||
if not self.allow_same:
|
||||
raise forms.ValidationError(_("Your username is already "+username))
|
||||
|
||||
class UserNamePass(UserData):
|
||||
password1 = forms.CharField(label=_("Password"),
|
||||
widget=forms.PasswordInput)
|
||||
password2 = forms.CharField(label=_("Password confirmation"),
|
||||
widget=forms.PasswordInput,
|
||||
help_text = _("Enter the same password as above, for verification."))
|
||||
allow_same = True
|
||||
def clean_password2(self):
|
||||
password1 = self.cleaned_data.get("password1", "")
|
||||
password2 = self.cleaned_data["password2"]
|
||||
if password1 != password2:
|
||||
raise forms.ValidationError(_("The two passwords don't match."))
|
||||
return password2
|
||||
|
||||
class CloneCampaignForm(forms.Form):
|
||||
campaign_id = forms.IntegerField(required = True, widget = forms.HiddenInput)
|
||||
|
@ -558,6 +574,8 @@ class CampaignPurchaseForm(forms.Form):
|
|||
library_id = forms.IntegerField(required=False)
|
||||
library = None
|
||||
copies = forms.IntegerField(required=False,min_value=1)
|
||||
give_to = forms.EmailField(required = False)
|
||||
give_message = forms.CharField(required = False, max_length=512, )
|
||||
|
||||
def clean_offer_id(self):
|
||||
offer_id = self.cleaned_data['offer_id']
|
||||
|
@ -574,10 +592,26 @@ class CampaignPurchaseForm(forms.Form):
|
|||
except Library.DoesNotExist:
|
||||
raise forms.ValidationError(_("Sorry, that Library is not valid."))
|
||||
|
||||
def clean_copies(self):
|
||||
copies = self.cleaned_data.get('copies',1)
|
||||
return copies if copies else 1
|
||||
|
||||
def clean_anonymous(self):
|
||||
if self.data.get('give', False):
|
||||
return True
|
||||
else:
|
||||
return self.cleaned_data['anonymous']
|
||||
|
||||
def clean(self):
|
||||
if self.offer.license == LIBRARY:
|
||||
if not self.library:
|
||||
raise forms.ValidationError(_("No library specified." ))
|
||||
if self.data.get('give', False):
|
||||
if not self.cleaned_data.get('give_to',None):
|
||||
raise forms.ValidationError(_("Gift recipient email is needed." ))
|
||||
else:
|
||||
if 'give_to' in self._errors:
|
||||
del self._errors['give_to']
|
||||
return self.cleaned_data
|
||||
|
||||
def amount(self):
|
||||
|
@ -591,6 +625,9 @@ class CampaignPurchaseForm(forms.Form):
|
|||
if self.library:
|
||||
pe.extra['library_id']=self.library.id
|
||||
pe.extra['copies']=self.cleaned_data.get('copies',1)
|
||||
if self.data.get('give', False):
|
||||
pe.extra['give_to']=self.cleaned_data['give_to']
|
||||
pe.extra['give_message']=self.cleaned_data['give_message']
|
||||
return pe
|
||||
|
||||
class CampaignThanksForm(forms.Form):
|
||||
|
@ -778,3 +815,7 @@ class LibModeForm(forms.ModelForm):
|
|||
class Meta:
|
||||
model = Libpref
|
||||
fields = ()
|
||||
|
||||
class RegiftForm(forms.Form):
|
||||
give_to = forms.EmailField(label="email address of recipient")
|
||||
give_message = forms.CharField( max_length=512, label="your gift message", initial="Here's an ebook from unglue.it, I hope you like it! - me")
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
</div>
|
||||
{% if purchased %}
|
||||
<div class="unglued_white">
|
||||
<b>Purchased!</b>
|
||||
<b>{% if purchased.gifts.all.count %}A gift to you!{% else %}Purchased!{% endif %}</b>
|
||||
</div>
|
||||
{% else %}{% if borrowed %}
|
||||
<b>Borrowed! </b>
|
||||
|
@ -244,7 +244,7 @@
|
|||
{% else %}
|
||||
<div class="listview panelfront side1 on-wishlist">
|
||||
{% if purchased %}
|
||||
<span>Purchased!</span>
|
||||
<span>{% if purchased.gifts.all.count %}A gift to you!{% else %}Purchased!{% endif %}</span>
|
||||
{% else %}{% if borrowed %}
|
||||
<span>Borrowed! ...until</span>
|
||||
{% else %}{% if request.user.id in supporters %}
|
||||
|
|
|
@ -6,6 +6,10 @@
|
|||
</head>
|
||||
<body>
|
||||
<div class="booksection">
|
||||
{% if acq.gifts.all.0 %}
|
||||
<p> This ebook is a gift from {{ acq.gifts.all.0.giver }}.</p>
|
||||
<p style="margin:2em">{{ acq.gifts.all.0.message }}</p>
|
||||
{% endif %}
|
||||
<p class="copyk">
|
||||
{% ifequal acq.license 1 %}
|
||||
RESTRICTED NON-TRANSFERABLE DIGITAL LICENSE FOR PERSONAL USE ONLY: This copyrighted work is licensed to you, {{ acq.user.username }}, on {{ acq.created }} through https://unglue.it under an individual, restricted, non-transferrable license for your personal use only. You are not authorized to copy, transfer, distribute, display or otherwise transmit this work to third parties without the express written permission of the copyright holder. The license has been embedded into the digital file, along with your identity, that of the licensor, and the details of the restricted terms of this license. You can use this file to prove your license status. This embedded license must not be altered, removed or tampered with for any reason and any effort to do so will result in the immediate revocation of this license. Unauthorized distribution of this work is a copyright violation and may be enforced by the rights holder accordingly to the fullest extent available under the law.
|
||||
|
|
|
@ -17,14 +17,21 @@
|
|||
</span>
|
||||
</li>
|
||||
|
||||
<li class="last parent">
|
||||
<li class="parent">
|
||||
<span class="faq">How and when will I get my eBook?</span>
|
||||
<span class="menu level2 answer">
|
||||
Your purchased books will be always available for download from your <a href="{% url supporter request.user %}"> personal unglue.it page</a>. You can read the ebooks on any laptop, ebook reader or tablet.
|
||||
</span>
|
||||
</li>
|
||||
|
||||
<li class="last parent">
|
||||
<li class="parent">
|
||||
<span class="faq">How do gifts work?</span>
|
||||
<span class="menu level2 answer">
|
||||
An email will be sent to the gift recipient with a redemption link. The recipient clicks on the link, and they're logged into unglue.it, where they can download their ebook, in whatever format they prefer. The ebook has your gift message embedded. In case they've already purchased the ebook from Unglue.it, a recipient can re-gift it. You'll also be sent an email with the redemption link, just in case the email gets lost. It's also in your <a href="/notification">notifications</a>. You can send the redemption link in other ways, if you prefer. When the recipient redeems the link, we'll send you another notification.
|
||||
</span>
|
||||
</li>
|
||||
|
||||
<li class="parent">
|
||||
<span class="faq">What are the formats available?</span>
|
||||
<span class="menu level2 answer">
|
||||
You can use any format that's available for your purchased book- you don't have to select at time of purchase. The available formats are EPUB and MOBI, so you can read them on a Kindle, an iPad, a Nook, Kobo, iPhone, Mac, PC, Linux or Android device.
|
||||
|
@ -57,7 +64,7 @@
|
|||
You need to join a library participating in Unglue.it. If your library is not on <a href="{% url library_list %}">this list</a>, contact your librarian and have them check out our <a href="{% url libraries %}">libraries FAQ</a>.
|
||||
</span>
|
||||
</li>
|
||||
<li class="parent">
|
||||
<li class="last parent">
|
||||
<span class="faq">Why don't you use Paypal or Amazon?</span>
|
||||
<span class="menu level2 answer">
|
||||
Funny you should ask. We've told the agonizing story about our search for a payment provider in a series of blog posts. <ul><li> <a href="http://blog.unglue.it/2012/05/03/unglue-it-payment-options-amazon-vs-paypal/">Forget Paypal!</a></li>
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
{% extends "registration/registration_base.html" %}
|
||||
{% block title %}Duplicate Gift Code{% endblock %}
|
||||
{% block doccontent %}
|
||||
<div><h2>Re-Gifting</h2>
|
||||
<div>
|
||||
|
||||
{% if form %}
|
||||
{% ifequal request.user.id gift.giver.id %}
|
||||
<p> It looks like you're trying to redeem a gift of "<a href="{% url work work.id %}">{{ work.title }}</a>" that you sent to {{ gift.to }}. You probably clicked the redemption link by mistake. If it's not a mistake, you can redirect the gift by regifting it to someone else.</p>
|
||||
{% else %}
|
||||
<p> <a href="{% url supporter gift.giver %}">{{ gift.giver }}</a> has sent you "<a href="{% url work work.id %}">{{ work.title }}</a>" as a gift, however, it seems that you already own this work at unglue.it. Not to worry, you can Re-Gift it!</p>
|
||||
{% endifequal %}
|
||||
<div>
|
||||
<form method="POST" action="#">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" name="regift" value="Re-Gift It" id="submit_regift" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{% else %}
|
||||
<p>
|
||||
An email has been sent to <a href="mailto:{{ gift.acq.user.email }}">{{ gift.acq.user.email }}</a> with this message:</p>
|
||||
<p style="margin:2em">
|
||||
{{ gift.message }}
|
||||
</p>
|
||||
<p>along with instructions for obtaining the ebook. Here's the URL that the recipient (and ONLY the recipient) should use to collect the book:
|
||||
</p>
|
||||
<textarea cols="68">
|
||||
https://{{ site.domain }}{% url receive_gift gift.acq.nonce %}
|
||||
</textarea>
|
||||
<p>
|
||||
You can send the url yourself if there's been any problem with the email.
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
{% extends "registration/registration_base.html" %}
|
||||
{% block title %}Invalid Gift Code{% endblock %}
|
||||
{% block doccontent %}
|
||||
<div><h2>Invalid Gift Code</h2>
|
||||
<div>
|
||||
{% if gift %}
|
||||
<p>Sorry, the gift code you tried to use for "<a href="{% url work work.id %}">{{ work.title }}</a>" has already been redeemed. If you think it should still be valid, don't hesitate to contact <a href="mailto:support@gluejar.com?subject={{ request.get_full_path|urlencode }}">unglue.it support</a>.
|
||||
</p>
|
||||
{% else %}
|
||||
<p>Sorry, your gift code is invalid. Perhaps there was a problem cutting and pasting the URL? If you're having trouble, don't hesitate to contact <a href="mailto:support@gluejar.com?subject={{ request.get_full_path|urlencode }}">unglue.it support</a>.
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
{% extends "registration/registration_base.html" %}
|
||||
{% block title %}Log in to Unglue.it{% endblock %}
|
||||
{% block doccontent %}
|
||||
<div id="lightbox_content">
|
||||
{% if form.errors %}
|
||||
{% for error in form.non_field_errors %}
|
||||
<p class="errorlist">{{ error }}</p>
|
||||
{% endfor %}
|
||||
Make sure the username box has your <b>username, not your email</b> -- some browsers automatically fill in your email. We're working on fixing this bug.
|
||||
{% endif %}
|
||||
{% if not user.is_authenticated %}
|
||||
<div class="launch_top pale">
|
||||
<p>
|
||||
We've added your gift, "<a href="{% url work work.id %}">{{ work.title }}</a>" to the account with username: {{ gift.acq.user.username }}. Happy reading!
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<h3>Sign in to your account</h3>
|
||||
|
||||
{% include "login_form.html" %}
|
||||
<br />
|
||||
|
||||
|
||||
<a href="{% url auth_password_reset %}?next={% url receive_gift gift.acq.nonce %}">Forgot</a> your password? <a href="{% url registration_register %}?next={% url receive_gift gift.acq.nonce %}">Need an account</a>? <a href="/faq/basics/account">Other questions</a>?
|
||||
|
||||
|
||||
<br /><br />
|
||||
<div class="google_signup">
|
||||
<div {% if socials.google %}class="errorlist"{% endif %}>
|
||||
<div><a href="/socialauth/login/google?next={% url receive_gift gift.acq.nonce %}"><img src="{{ STATIC_URL }}images/auth/google_32_noborder.png" alt="google" /></a></div>
|
||||
<div>Or: <a href="/socialauth/login/google?next={% url receive_gift gift.acq.nonce %}">Sign in with Google</a></div>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div>
|
||||
You are already logged in as <a href="{% url supporter user %}">{{ user.username }}</a>.
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -0,0 +1,35 @@
|
|||
{% extends "registration/registration_base.html" %}
|
||||
|
||||
{% block title %}Welcome to Unglue.It{% endblock %}
|
||||
{% block doccontent %}
|
||||
<p> Your new book, "<a href="{% url work work.id %}">{{ work.title }}</a>" from <a href="{% url supporter gift.giver %}">{{ gift.giver.username }}</a>, is waiting for you. <a href="{% url download work.id %}">Download it here</a>.</p>
|
||||
|
||||
<div><p>From {{ gift.giver.username }}:</p>
|
||||
<p style="margin:1em">{{ gift.message }}</p>
|
||||
</div>
|
||||
{% ifequal message 'newuser' %}
|
||||
{% if passmessage %}
|
||||
<p> Thanks for setting your password and username. Your new book is on your <a href="{% url supporter request.user %}">favorites list</a> for you.</p>
|
||||
{% else %}
|
||||
<p> If you want download your ebook later, you need to set a password, and you may want to pick your own username. We've put it on your <a href="{% url supporter request.user %}">favorites list</a> for you.</p>
|
||||
{% endif %}
|
||||
{% if form %}
|
||||
<div>
|
||||
<form method="POST" action="#">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" name="change_username" value="Change username/Set password" id="submit_username">
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endifequal %}
|
||||
{% ifequal message 'existing' %}
|
||||
<p> Your new book has been put on your <a href="{% url supporter request.user %}">favorites list</a> for you.</p>
|
||||
{% endifequal %}
|
||||
<br />
|
||||
<div class="welcomealternatives">
|
||||
Or you can <a href="{% url regluit.frontend.views.edit_user %}">change your username</a> — <a href="{% url free %}">browse free books</a> — <a href="/feedback/?page={{request.build_absolute_uri|urlencode:""}}">send us feedback</a> — <a href="{% url notification_notice_settings %}">manage your contact preferences</a>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
|
@ -179,7 +179,7 @@ function put_un_in_cookie2(){
|
|||
<div class="jsmodule">
|
||||
<h3 class="module-title">News</h3>
|
||||
<div class="jsmod-content">
|
||||
Blog: <a href="http://blog.unglue.it/2014/11/10/marc-records-for-creative-commons-licensed-books-from-unglue-it/">MARC records from Unglue.it</a>
|
||||
Blog: <a href="http://blog.unglue.it/2014/12/23/new-at-unglue-it-buy-as-a-gift/">New at Unglue.it: Buy as a Gift</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="jsmodule">
|
||||
|
|
|
@ -15,17 +15,12 @@ $j(document).ready(function(){
|
|||
</script>
|
||||
{% endblock %}
|
||||
{% block doccontent %}
|
||||
<h2>Your Pledges</h2>
|
||||
<dl>
|
||||
{% for transaction in request.user.profile.pledges %}
|
||||
<dt><i><a href="{% url work transaction.campaign.work.id %}">{{ transaction.campaign.work.title }}</a></i> (<a href="{% url pledge_modify transaction.campaign.work.id %}">modify pledge</a>)</dt>
|
||||
<dd><div class="modify_notification">
|
||||
{% include "trans_summary.html" %}
|
||||
</div></dd>
|
||||
{% empty %}
|
||||
<dt>You don't have any active pledges. To make one, click on a book you'd like to support among our <a href="{% url campaign_list facet="ending" %}">active campaigns</a>. There's a "Support" button on every campaign page, or just click on your favorite premium to get started.</dt>
|
||||
{% endfor %}
|
||||
</dl>
|
||||
{% if user.profile.last_transaction %}
|
||||
{% if user.profile.last_transaction.status == 'Error' or user.profile.last_transaction.status == 'Failed' or not user.profile.last_transaction.status %}
|
||||
<h2 id="your_payment_info">Incomplete Transaction</h2>
|
||||
You can complete your last transaction by <a href="{% url fund user.profile.last_transaction.id %}">clicking here</a>.
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<h2 id="your_payment_info">Your Payment Info</h2>
|
||||
{% if request.user.profile.account %}
|
||||
<p>Unglue.it has a credit card on file for you. We'll use this to fund your pledges.</p>
|
||||
|
@ -93,6 +88,18 @@ $j(document).ready(function(){
|
|||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<h2 style="margin-top:8em">Your Pledges</h2>
|
||||
<dl>
|
||||
{% for transaction in request.user.profile.pledges %}
|
||||
<dt><i><a href="{% url work transaction.campaign.work.id %}">{{ transaction.campaign.work.title }}</a></i>
|
||||
(<a href="{% url pledge_modify transaction.campaign.work.id %}">modify pledge</a>)</dt>
|
||||
<dd><div class="modify_notification">
|
||||
{% include "trans_summary.html" %}
|
||||
</div></dd>
|
||||
{% empty %}
|
||||
<dt>You don't have any active pledges. </dt>
|
||||
{% endfor %}
|
||||
</dl>
|
||||
|
||||
<h2> Other Account Management Tools </h2>
|
||||
<ul>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{% load humanize %}An Ungluing!
|
||||
|
||||
Thanks to you and other ungluers, {{ transaction.campaign.work.title }} will be released to the world in an unglued ebook edition. Your credit card has been charged ${{ transaction.amount|intcomma }}.
|
||||
Thanks to you and other ungluers, {{ transaction.campaign.work.title }} will be released to the world in an unglued ebook edition. Your credit card has been charged ${{ transaction.amount|floatformat:2|intcomma }}.
|
||||
|
||||
Pledge summary
|
||||
{% include "notification/pledge_summary.txt" %}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block comments_graphical %}
|
||||
Hooray! The campaign for <a href="{% url work transaction.campaign.work.id %}">{{ transaction.campaign.work.title }}</a> has succeeded. Your credit card has been charged ${{ transaction.amount|intcomma }}. Thank you again for your help.
|
||||
Hooray! The campaign for <a href="{% url work transaction.campaign.work.id %}">{{ transaction.campaign.work.title }}</a> has succeeded. Your credit card has been charged ${{ transaction.amount|floatformat:2|intcomma }}. Thank you again for your help.
|
||||
{% endblock %}
|
||||
|
||||
{% block comments_textual %}
|
||||
|
@ -15,7 +15,7 @@
|
|||
<p>Thanks to you and other ungluers, {{ transaction.campaign.work.title }} will be released to the world in an unglued ebook edition. {{ transaction.host|capfirst }} has been charged to your credit card.</p>
|
||||
|
||||
<p><b>Pledge Summary</b><br />
|
||||
Amount pledged: {{ transaction.amount|intcomma }}<br />
|
||||
Amount pledged: {{ transaction.amount|floatformat:2|intcomma }}<br />
|
||||
Premium: {{ transaction.premium.description }} <br />
|
||||
</p>
|
||||
<p>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.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{% load humanize %}{{ transaction.campaign.work.title }} will be released to the world in an unglued ebook edition.
|
||||
{% load humanize %}We tried to process your transaction for "{{ transaction.campaign.work.title }}".
|
||||
|
||||
However, our attempt to charge your credit card in the amount of ${{ transaction.amount|intcomma }} failed ({{transaction.error}}).
|
||||
However, our attempt to charge your credit card in the amount of ${{ transaction.amount|floatformat:2|intcomma }} failed{% if transaction.error %} ({{transaction.error}}){% endif %}.
|
||||
{% ifequal transaction.campaign.type 1 %}Don't worry -- typically this means the card on file for you is expired, and once you update your card information we'll be able to collect your pledge on behalf of {{ transaction.campaign.rightsholder }}. Please update your credit card information at
|
||||
https://{{ current_site.domain }}{% url manage_account %} by {{ recharge_deadline }} so that you can fulfill your pledge. Thank you!
|
||||
|
||||
|
|
|
@ -6,20 +6,20 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block comments_graphical %}
|
||||
{% ifequal transaction.campaign.type 1 %}The campaign for <a href="{% url work transaction.campaign.work.id %}">{{ transaction.campaign.work.title }}</a> has succeeded. However, our attempt to charge your pledge for ${{ transaction.amount|intcomma }} to your credit card failed ({{transaction.error}}). Will you help us fix that?{% else %}Our attempt to charge a purchase of ${{ transaction.amount|intcomma }} to your credit card failed ({{transaction.error}}).{% endifequal %}
|
||||
{% ifequal transaction.campaign.type 1 %}The campaign for <a href="{% url work transaction.campaign.work.id %}">{{ transaction.campaign.work.title }}</a> 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 %}
|
||||
<p>Your attention needed!</p>
|
||||
|
||||
<p>Thanks to you and other ungluers, {{ transaction.campaign.work.title }} will be released to the world in an unglued ebook edition.
|
||||
However, our attempt to charge your credit card for ${{ transaction.amount|intcomma }} failed.</p>
|
||||
<p>}We tried to process your transaction for "{{ transaction.campaign.work.title }}".
|
||||
However, our attempt to charge your credit card for ${{ transaction.amount|floatformat:2|intcomma }} failed.</p>
|
||||
{% ifequal transaction.campaign.type 1 %}
|
||||
<p>Don't worry - normally this just means the card we have on file for you is expired. Once you've updated your card information we'll be able to collect your pledge on behalf of {{ transaction.campaign.rightsholder }}. Please update your credit card information at
|
||||
<a href="{% url manage_account %}">your account management page</a> by {{ recharge_deadline }} so that you can fulfill your pledge. Thank you!</p>
|
||||
|
||||
<p><b>Pledge Summary</b><br />
|
||||
Amount pledged: {{ transaction.amount|intcomma }}<br />
|
||||
Amount pledged: {{ transaction.amount|floatformat:2|intcomma }}<br />
|
||||
Premium: {{ transaction.premium.description }} <br />
|
||||
</p>
|
||||
<p>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.
|
||||
|
@ -29,7 +29,7 @@
|
|||
<a href="{% url manage_account %}">your account management page</a>. Thank you!</p>
|
||||
|
||||
<p><b>Transaction Summary</b><br />
|
||||
Amount of purchase: {{ transaction.amount|intcomma }}<br />
|
||||
Amount of purchase: {{ transaction.amount|floatformat:2|intcomma }}<br />
|
||||
</p>
|
||||
{% endifequal %}
|
||||
<p>For more information, visit the <a href="{% url work transaction.campaign.work.id %}">campaign page</a>.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{% load humanize %}{% if up_or_down == 'canceled' %}You have canceled a pledge that you had previously made to the campaign to unglue {{ transaction.campaign.work.title }}.
|
||||
|
||||
Your canceled pledge
|
||||
Amount: ${{ transaction.amount|intcomma }}
|
||||
Amount: ${{ transaction.amount|floatformat:2|intcomma }}
|
||||
Premium: {{ transaction.premium.description }}
|
||||
You will not be acknowledged in the unglued ebook.
|
||||
{% else %}You have modified a pledge that you had previously made to the campaign to unglue {{ transaction.campaign.work.title }}.
|
||||
|
|
|
@ -12,11 +12,11 @@
|
|||
{% block comments_textual %}
|
||||
{% if up_or_down == 'canceled' %}
|
||||
Your canceled pledge was as follows:<br />
|
||||
Amount: ${{ transaction.amount|intcomma }}<br />
|
||||
Amount: ${{ transaction.amount|floatformat:2|intcomma }}<br />
|
||||
Premium: {% if transaction.premium %}{{ transaction.premium.description }}{% else %}None requested{% endif %}<br />
|
||||
{% else %}
|
||||
Your new pledge is as follows:<br />
|
||||
Amount: ${{ transaction.amount|intcomma }}<br />
|
||||
Amount: ${{ transaction.amount|floatformat:2|intcomma }}<br />
|
||||
Premium: {% if transaction.premium %}{{ transaction.premium.description }}{% else %}None requested{% endif %}<br /><br />
|
||||
|
||||
Acknowledgements: <ul>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{% load humanize %}
|
||||
{% ifequal transaction.campaign.type 1 %}
|
||||
Amount pledged: ${{ transaction.amount|intcomma }}
|
||||
Amount pledged: ${{ transaction.amount|floatformat:2|intcomma }}
|
||||
Premium: {{ transaction.premium.description }}
|
||||
|
||||
You will also be acknowledged as follows:
|
||||
|
@ -12,6 +12,6 @@ You will also be acknowledged as follows:
|
|||
{{ 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 %}.
|
||||
{% endif %}{% endifequal %}{% else %}
|
||||
Amount charged: ${{ transaction.amount|intcomma }}
|
||||
Amount charged: ${{ transaction.amount|floatformat:2|intcomma }}
|
||||
|
||||
{% endifequal %}
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block comments_graphical %}
|
||||
You've just pledged ${{ transaction.amount|intcomma }} to <a href="{% url work transaction.campaign.work.id %}">{{ transaction.campaign.work.title }}</a>.
|
||||
You've just pledged ${{ transaction.amount|floatformat:2|intcomma }} to <a href="{% url work transaction.campaign.work.id %}">{{ transaction.campaign.work.title }}</a>.
|
||||
{% endblock %}
|
||||
|
||||
{% block comments_textual %}
|
||||
<p>Thank you, {{ transaction.user.username }}!</p>
|
||||
<p>You've just pledged ${{ transaction.amount|intcomma }} to <a href="{% url work transaction.campaign.work.id %}">{{ transaction.campaign.work.title }}</a>. 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.</p>
|
||||
<p>You've just pledged ${{ transaction.amount|floatformat:2|intcomma }} to <a href="{% url work transaction.campaign.work.id %}">{{ transaction.campaign.work.title }}</a>. 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.</p>
|
||||
<p>You can help even more by sharing this campaign with your friends!</p>
|
||||
|
||||
{% url work transaction.campaign.work.id as work_url %}
|
||||
|
|
|
@ -1,12 +1,21 @@
|
|||
{% load humanize %}{% ifequal transaction.host 'credit' %}Your Unglue.it transaction has completed and ${{transaction.max_amount|default:"0"}} has been deducted from your Unglue.it credit balance. You have ${{transaction.user.credit.available|default:"0"}} of credit left. {% else %}{% if transaction.max_amount > transaction.amount %}Your transaction for ${{transaction.max_amount|default:"0"}} has completed. Your credit card has been charged ${{transaction.amount}} and the rest has been deducted from your unglue.it credit balance. You have ${{transaction.user.credit.available|default:"0"}} of credit left. {% else %}Your Unglue.it credit card transaction has completed and your credit card has been charged ${{ transaction.amount|default:"0" }}. {% endif %}{% endifequal %}
|
||||
|
||||
{% ifequal transaction.offer.license 2 %}If you have not already done so, download your ebook at
|
||||
{% ifequal transaction.offer.license 1 %}{% if gift %}An email has been sent to {{ gift.acq.user.email }} with this message:
|
||||
|
||||
{{ gift.message }}
|
||||
|
||||
along with instructions for obtaining the ebook. Here's the URL that the recipient (and ONLY the recipient) should use to collect the book:
|
||||
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 %}
|
||||
|
||||
{% 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 %}
|
||||
{% 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.
|
||||
{% else %}
|
||||
{% 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 %}
|
||||
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 %}
|
||||
|
|
|
@ -7,21 +7,31 @@
|
|||
|
||||
{% block comments_graphical %}
|
||||
{% ifequal transaction.host 'credit' %}
|
||||
Your Unglue.it transaction has completed and ${{transaction.max_amount|intcomma}} has been deducted from your Unglue.it credit balance.
|
||||
Your Unglue.it transaction has completed and ${{transaction.max_amount|floatformat:2|intcomma}} has been deducted from your Unglue.it credit balance.
|
||||
You have ${{transaction.user.credit.available|default:"0"}} of credit left.
|
||||
{% else %}
|
||||
{% if transaction.max_amount > transaction.amount %}
|
||||
Your transaction for ${{transaction.max_amount|intcomma}} has completed.
|
||||
Your transaction for ${{transaction.max_amount|floatformat:2|intcomma}} has completed.
|
||||
Your credit card has been charged ${{transaction.amount}} and the
|
||||
rest has been deducted from your unglue.it credit balance.
|
||||
You have ${{transaction.user.credit.available|intcomma}} of credit left.
|
||||
{% else %}
|
||||
Your Unglue.it credit card transaction has completed and your credit card has been charged ${{ transaction.amount|intcomma }}.
|
||||
Your Unglue.it credit card transaction has completed and your credit card has been charged ${{ transaction.amount|floatformat:2|intcomma }}.
|
||||
{% endif %}
|
||||
{% endifequal %}
|
||||
{% ifequal transaction.offer.license 1 %}
|
||||
{% ifequal transaction.offer.license 1 %}{% if gift %}An email has been sent to <a href="mailto:{{ gift.acq.user.email }}">{{ gift.acq.user.email }}</a> with this message:
|
||||
<pre>
|
||||
{{ gift.message }}
|
||||
</pre>
|
||||
along with instructions for obtaining the ebook. Here's the URL that the recipient (and ONLY the recipient) should use to collect the book:
|
||||
<pre>
|
||||
https://{{ current_site.domain }}{% url receive_gift gift.acq.nonce %}
|
||||
</pre>
|
||||
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 <a href="{% url download transaction.campaign.work.id %}">the book's download page.</a>
|
||||
{% endifequal %}
|
||||
{% endif %}{% endifequal %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
@ -29,9 +39,9 @@ If you have not already done so, download your ebook at <a href="{% url download
|
|||
{% ifequal transaction.campaign.type 2 %}
|
||||
<p>Thanks to you and other ungluers, <i>{{ transaction.campaign.work.title }}</i> 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 }}.</p>
|
||||
|
||||
{% ifequal transaction.offer.license 1 %}
|
||||
{% ifequal transaction.offer.license 1 %}{% if not gift %}
|
||||
<p>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.</p>
|
||||
{% else %}
|
||||
{% endif %}{% else %}
|
||||
<p>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 <a href="{% url borrow transaction.campaign.work.id %}">get your copy now</a>. 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.</p>
|
||||
{% endifequal %}
|
||||
{% endifequal %}
|
||||
|
|
|
@ -1 +1 @@
|
|||
{% ifequal transaction.campaign.type 2 %}You have purchased {{transaction.campaign.work.title}}{% ifequal transaction.offer.license 2 %} for your library{% endifequal %}.{% endifequal %}{% ifequal transaction.campaign.type 3 %}You have supported {{ transaction.campaign.work.title }}, a free ebook.{% endifequal %}
|
||||
{% ifequal transaction.campaign.type 2 %}You have purchased {{transaction.campaign.work.title}}{% ifequal transaction.offer.license 2 %} for your library{% endifequal %}{% if gift %} as a gift{% endif %}.{% endifequal %}{% ifequal transaction.campaign.type 3 %}You have supported {{ transaction.campaign.work.title }}, a free ebook.{% endifequal %}
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
{% load humanize %}From "{{ gift.giver }}":
|
||||
|
||||
{{ gift.message }}
|
||||
|
||||
|
||||
|
||||
From Unglue.it:
|
||||
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.
|
||||
|
||||
To get the ebook {{ gift.giver }} has given you, please click on this link (or copy and paste it into your web browser):
|
||||
https://{{ current_site.domain }}{% url receive_gift gift.acq.nonce %}
|
||||
|
||||
Choose a password if you want to access your ebooks in the future.
|
||||
|
||||
The ebook will be licensed to you personally, and the license will be embedded in the ebook file. You may download it as many times as you need to, but you can't make copies for the use of others until the ungluing date, when it becomes free to everyone. You can make that date come sooner by encouraging your friends to buy a copy.
|
||||
|
||||
|
||||
For more information about the book, visit the book's unglue.it page at
|
||||
https://{{ current_site.domain }}{% url work gift.acq.work.id %}
|
||||
|
||||
We hope enjoy your new ebook, and we hope you like Unglue.it!
|
||||
|
||||
"{{ gift.giver.username }}" and the Unglue.it team
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
{% extends "notification/notice_template.html" %}
|
||||
{% load humanize %}
|
||||
|
||||
{% block comments_book %}
|
||||
<a href="{% url work gift.acq.work.id %}"><img src="{{ gift.acq.work.cover_image_small }}" alt="cover image for {{ gift.acq.work.title }}" /></a>
|
||||
{% endblock %}
|
||||
|
||||
{% block comments_graphical %}
|
||||
To accept your ebook, visit <a href="{% url receive_gift gift.acq.nonce %}">the gift page.</a>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block comments_textual %}
|
||||
<p style="margin:2em">
|
||||
{{ gift.message }}
|
||||
</p>
|
||||
<p>
|
||||
<a href="{% url receive_gift gift.acq.nonce %}">Click here</a> to receive your ebook.
|
||||
</p>
|
||||
<p>
|
||||
Thanks to <a href="{% url supporter gift.giver %}">{{ gift.giver }}</a> and other ungluers, <a href="{% url work gift.acq.work.id %}">{{ gift.acq.work.title }}</a> will be eventually be released to the world in an unglued ebook edition.
|
||||
</p>
|
||||
<p>
|
||||
The ebook will be licensed to you personally, and your 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.
|
||||
</p>
|
||||
<p>
|
||||
For more information about the book, visit the book's <a href="{% url work gift.acq.work.id %}">unglue.it page</a>
|
||||
|
||||
</p>
|
||||
<p>
|
||||
We hope enjoy your new ebook!
|
||||
</p>
|
||||
<p>
|
||||
<a href="{% url supporter gift.giver %}">{{ gift.giver.username }}</a> and the Unglue.it team
|
||||
</p>
|
||||
{% endblock %}
|
|
@ -0,0 +1 @@
|
|||
You have been given an ebook, "{{ gift.acq.work.title }}"
|
|
@ -0,0 +1,6 @@
|
|||
The gift you sent to {{ gift.to }} has been redeemed.
|
||||
|
||||
Thank you for supporting Unglue.it and for helping to spread "{{ gift.acq.work.title }}".
|
||||
|
||||
the Unglue.it team
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
{% extends "notification/notice_template.html" %}
|
||||
{% load humanize %}
|
||||
|
||||
{% block comments_book %}
|
||||
<a href="{% url work gift.acq.work.id %}"><img src="{{ gift.acq.work.cover_image_small }}" alt="cover image for {{ gift.acq.work.title }}" /></a>
|
||||
{% endblock %}
|
||||
|
||||
{% block comments_graphical %}
|
||||
The gift you sent to {{ gift.to }} has been redeemed.
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block comments_textual %}
|
||||
<p>
|
||||
We wanted you to know that the gift you sent to {{ gift.to }} has been redeemed.
|
||||
</p>
|
||||
<p>
|
||||
Thank you for supporting Unglue.it and for helping to spread "{{ gift.acq.work.title }}".
|
||||
</p>
|
||||
<p>
|
||||
the Unglue.it team
|
||||
</p>
|
||||
{% endblock %}
|
|
@ -0,0 +1 @@
|
|||
The gift you sent to {{ gift.to }} has been redeemed.
|
|
@ -63,7 +63,7 @@
|
|||
{% if faqmenu == 'modify' %}
|
||||
<div class="modify_notification clearfix"><h4>You've already pledged to this campaign:</h4>
|
||||
<div>
|
||||
Amount: ${{transaction.amount|intcomma}}.<br />
|
||||
Amount: ${{transaction.amount|floatformat:2|intcomma}}.<br />
|
||||
Your premium: {% if transaction.premium %}{{ transaction.premium.description }}{% else %}You did not request a premium for this campaign.{% endif %}<br />
|
||||
</div>
|
||||
<br /> You can modify your pledge below.
|
||||
|
@ -101,7 +101,7 @@
|
|||
</span>
|
||||
{% else %}
|
||||
<span class="menu-item-price">
|
||||
${{ premium_item.amount|intcomma }}
|
||||
${{ premium_item.amount|floatformat:0|intcomma }}
|
||||
</span>
|
||||
{% endif %}
|
||||
<span class="menu-item-desc">
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
{% else %}
|
||||
{% if transaction %}
|
||||
<h2>Pledge Canceled</h2>
|
||||
<div>You have asked to cancel your pledge of ${{ transaction.amount|intcomma }} to <a href="{% url work work.id %}">{{ work.title }}</a>. </div>
|
||||
<div>You have asked to cancel your pledge of ${{ transaction.amount|floatformat:2|intcomma }} to <a href="{% url work work.id %}">{{ work.title }}</a>. </div>
|
||||
|
||||
<form method="post" action="{% url pledge_cancel campaign_id=campaign.id %}">
|
||||
{% csrf_token %}
|
||||
|
|
|
@ -28,16 +28,28 @@
|
|||
|
||||
<h2 class="thank-you">Thank you!</h2>
|
||||
{% ifequal campaign.type 1 %}
|
||||
<p class="pledge_complete">You've just {% if modified %}modified your pledge for{% else %}pledged{% endif %} ${{ transaction.amount|intcomma }} to <I><a href="{% url work work.id %}">{{ work.title }}</a></I>. If it reaches its goal of ${{ campaign.target|intcomma }} by {{ campaign.deadline|date:"M d Y"}}, it will be unglued for all to enjoy.</p>
|
||||
<p class="pledge_complete">You've just {% if modified %}modified your pledge for{% else %}pledged{% endif %} ${{ transaction.amount|floatformat:2|intcomma }} to <I><a href="{% url work work.id %}">{{ work.title }}</a></I>. If it reaches its goal of ${{ campaign.target|intcomma }} by {{ campaign.deadline|date:"M d Y"}}, it will be unglued for all to enjoy.</p>
|
||||
{% endifequal %}
|
||||
{% ifequal campaign.type 2 %}
|
||||
<p class="pledge_complete">You've just paid ${{ transaction.amount|intcomma }} for a copy of <I><a href="{% url work work.id %}">{{ work.title }}</a></I>. Its ungluing date is now <i>{{ campaign.cc_date }}</i>. Thanks for helping to make that day come sooner!</p>
|
||||
<div><a href="{% url download work.id %}" class="fakeinput" style="float:left">Download Now</a> </div>
|
||||
<div style="height:75px;"></div>
|
||||
{% if transaction.extra.give_to %}
|
||||
<p class="pledge_complete">You've just paid ${{ transaction.amount|floatformat:2|intcomma }} to give a copy of <I><a href="{% url work work.id %}">{{ work.title }}</a></I> to {{ transaction.extra.give_to }}. Its ungluing date is now <i>{{ campaign.cc_date }}</i>. Thanks for helping to make that day come sooner!</p>
|
||||
|
||||
<p class="pledge_complete">An email has been sent to {{ transaction.extra.give_to }} with this message:</p>
|
||||
<p style="margin:2em">
|
||||
{{ transaction.extra.give_message }}
|
||||
</p>
|
||||
<p class="pledge_complete">along with instructions for obtaining the ebook. You'll also be sent a url that the recipient can use to get the ebook, in case the email doesn't get through. </p>
|
||||
|
||||
|
||||
{% else %}
|
||||
<p class="pledge_complete">You've just paid ${{ transaction.amount|floatformat:2|intcomma }} for a copy of <I><a href="{% url work work.id %}">{{ work.title }}</a></I>. Its ungluing date is now <i>{{ campaign.cc_date }}</i>. Thanks for helping to make that day come sooner!</p>
|
||||
<div><a href="{% url download work.id %}" class="fakeinput" style="float:left">Download Now</a> </div>
|
||||
{% endif %}
|
||||
|
||||
<div style="height:75px;"></div>
|
||||
{% endifequal %}
|
||||
{% ifequal campaign.type 3 %}
|
||||
<p class="pledge_complete">You've just contributed ${{ transaction.amount|intcomma }} to the creators of <I><a href="{% url work work.id %}">{{ work.title }}</a></I> to thank them for making it free to the world.</p>
|
||||
<p class="pledge_complete">You've just contributed ${{ transaction.amount|floatformat:2|intcomma }} to the creators of <I><a href="{% url work work.id %}">{{ work.title }}</a></I> to thank them for making it free to the world.</p>
|
||||
<div><a href="{% url download work.id %}" class="fakeinput" style="float:left">Download Now</a> </div>
|
||||
<div style="height:75px;"></div>
|
||||
|
||||
|
@ -57,46 +69,5 @@
|
|||
</ul>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
<div id="js-slide">
|
||||
<div class="js-main">
|
||||
<div class="jsmodule">
|
||||
{% include "slideshow.html" %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="js-maincontainer-bot-block">
|
||||
<div id="js-search">
|
||||
<label>What book should we give to the world? </label>
|
||||
<form action="{% url search %}" method="get">
|
||||
<input type="text" id="watermarkempty" onfocus="imgfocus()" onblur="imgblur(0)" size="25" class="inputbox" name="q" value="{{ q }}">
|
||||
<input type="submit" class="greenbutton" value="Search">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% ifequal work.id 81834 %}
|
||||
<!-- Google Code for Thank you Conversion Page -->
|
||||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
var google_conversion_id = 1072527387;
|
||||
var google_conversion_language = "en";
|
||||
var google_conversion_format = "3";
|
||||
var google_conversion_color = "ffffff";
|
||||
var google_conversion_label = "hiQVCPC14AIQm_C1_wM";
|
||||
if ({{ transaction.amount }})
|
||||
var google_conversion_value = {{ transaction.amount }};
|
||||
}
|
||||
/* ]]> */
|
||||
</script>
|
||||
<script type="text/javascript" src="https://www.googleadservices.com/pagead/conversion.js">
|
||||
</script>
|
||||
<noscript>
|
||||
<div style="display:inline;">
|
||||
<img height="1" width="1" style="border-style:none;" alt="" src="https://www.googleadservices.com/pagead/conversion/1072527387/?value={{ transaction.amount }}&label=hiQVCPC14AIQm_C1_wM&guid=ON&script=0" />
|
||||
</div>
|
||||
</noscript>
|
||||
{% endifequal %}
|
||||
|
||||
{% endblock %}
|
|
@ -13,9 +13,9 @@
|
|||
{{error}}
|
||||
{% else %}
|
||||
{% if transaction %}
|
||||
<div>Thank you for pledging ${{ transaction.amount|intcomma}} to the campaign for <a href="{% url work work.id %}">{{ work.title }}</a>.
|
||||
<div>Thank you for pledging ${{ transaction.amount|floatformat:2|intcomma}} to the campaign for <a href="{% url work work.id %}">{{ work.title }}</a>.
|
||||
The attempt to collect your payment was unsucessful.<br> <br>
|
||||
Please authorize another attempt to collect your pledge of ${{ transaction.amount|intcomma }}
|
||||
Please authorize another attempt to collect your pledge of ${{ transaction.amount|floatformat:2|intcomma }}
|
||||
by clicking on the following link:
|
||||
<a href="{{recharge_url|safe}}">Authorize recharge via {{payment_processor}} payments</a>.</div>
|
||||
|
||||
|
|
|
@ -41,29 +41,29 @@
|
|||
<a id="overview"></a><h2>Overview</h2>
|
||||
<dl>
|
||||
<dt>What?</dt>
|
||||
<dd>Unglue.it offers a win-win solution to readers, who want to read and share their favorite books conveniently, and rights holders (authors, publishers, etc.), who want to be rewarded for their work.<br /><br />
|
||||
We run <a href="http://en.wikipedia.org/wiki/Crowdfunding">crowdfunding</a> campaigns to raise money for specific, already-published books. When we reach goals set by the rights holders, we'll pay them to unglue their work. They'll issue an electronic edition with a <a href="http://creativecommons.org">Creative Commons</a> license as specified during the campaign. These licenses will make the edition free and legal for everyone to read, copy, and share, worldwide.<br /><br />
|
||||
|
||||
At Unglue.it, book lovers can pledge money to support these campaigns; add books to their wishlist to tell the world about their favorites; discuss their favorite books; share their Unglue.it pages via social media; and find direct links to public domain and unglued ebooks that they can read right away.
|
||||
<dd>Unglue.it works to make free ebooks sustainable.
|
||||
<br /><br />
|
||||
We provide distribution infrastructure for free ebooks - we're a bookstore for books that want to be free. We're building a database of free-licensed ebooks.
|
||||
<br /><br />
|
||||
We help archive books that are already free, and we help readers find and download them. We help creators ask those readers for support.
|
||||
<br /><br />
|
||||
We run crowdfunding campaigns to raise money to make ebooks free. In Buy-to-Unglue campaigns, the creators set a revenue target that triggers the free release of the rbook. In Pledge-to-Unglue campaigns, rights holders set the amount needed for ungluing, and if enough reders pledge there support, the book becomes free.
|
||||
</dd>
|
||||
<dt>Why?</dt>
|
||||
<dd>As ereaders proliferate, more and more people are enjoying the ereading experience. However, their favorite books may not be available as ebooks. Their ebooks may come with DRM which makes them unreadable on certain devices, and difficult or impossible to lend to friends. Or they may not be able to tell if they have the legal right to use the book as they'd like. The situation is even more challenging for libraries, which cannot acquire some ebooks at all, and can only acquire them under legal terms and DRM restrictions which run counter to library lending.<br /><br />
|
||||
When books have a clear, established legal license which promotes use, they can be read more widely, leading to enjoyment, scholarship, and innovation. By raising money to compensate authors and publishers up front, Unglue.it encourages the benefits of openness while ensuring sustainability for creators.<br /><br />
|
||||
For more background, read our president Eric Hellman's thoughts on <a href="http://go-to-hellman.blogspot.com/2011/04/public-broadcasting-model-for-ebooks.html">a public broadcasting model for ebooks</a> (on why the numbers work) and <a href="http://go-to-hellman.blogspot.com/search/label/Unglue.it">the development of Unglue.it</a>.</dd>
|
||||
<dd>Most books have a greater purpose than just making money for the creators. In many cases, that purpose is best served by making the book free to read. And it's that greater purpose that drives us.<br /><br />
|
||||
When books have a clear, established legal license which promotes use, they can be read more widely, leading to enjoyment, scholarship, and innovation. By raising money to support authors and publishers, Unglue.it encourages the benefits of openness while ensuring sustainability for creators. </dd>
|
||||
<dt>Who?</dt>
|
||||
<dd>Unglue.it is a service of Gluejar, Inc. We come from the worlds of entrepreneurship, linked data, physics, publishing, education, and library science, to name a few. You can learn more about us at our <a href="/about/">about page</a>.</dd>
|
||||
<dt>When?</dt>
|
||||
<dd>Unglue.it launched May 17, 2012.</dd>
|
||||
<dd>Unglue.it launched its first crowdfunding campaign on May 17, 2012. Buy-to-Unglue launched in January of 2014, and Thanks-for-Ungluing launched in April of 2014.</dd>
|
||||
<dt>Where?</dt>
|
||||
<dd>Gluejar is a New Jersey corporation, but its employees and contractors live and work across North America. The best way to contact us is by email, <a href="mailto:press@gluejar.com">press@gluejar.com</a>.</dd>
|
||||
<dt>What does it cost?</dt>
|
||||
<dd>Unglue.it is free to join and explore. Supporters pledge money only if they choose to support campaigns, and the amount is up to them. They are charged only if the campaigns reach their goal price. Unglue.it takes a small percentage from successful campaigns, with the remainder going to the author, publisher, or other rights holder.</dd>
|
||||
<dt>What's your technology?</dt>
|
||||
<dd>Unglue.it is built using <a href="http://python.org/">Python</a> and the <a href="https://www.djangoproject.com/">Django framework</a>. We use data from the <a href="http://code.google.com/apis/books/docs/v1/getting_started.html">Google Books</a>, <a href="http://openlibrary.org/developers/api">Open Library</a>, <a href="http://www.librarything.com/api">LibraryThing</a>, and <a href="http://www.goodreads.com/api">GoodReads</a> APIs; we appreciate that they've made these APIs available, and we're returning the favor with <a href="/api/help">our own API</a>. You're welcome to use it. We use <a href="http://lesscss.org/">Less</a> to organize our CSS. We process pledges with <a href="https://payments.amazon.com/">Amazon Payments</a>. We collaborate on our code at <a href="https://github.com/">GitHub</a> and deploy to the cloud with <a href="http://aws.amazon.com/ec2/">Amazon EC2</a>.</dd>
|
||||
<dt>How does the license work? Why did you choose this license?</dt>
|
||||
<dd>Unglue.it is built using <a href="http://python.org/">Python</a> and the <a href="https://www.djangoproject.com/">Django framework</a>. We use data from the <a href="http://code.google.com/apis/books/docs/v1/getting_started.html">Google Books</a>, <a href="http://openlibrary.org/developers/api">Open Library</a>, <a href="http://www.librarything.com/api">LibraryThing</a>, and <a href="http://www.goodreads.com/api">GoodReads</a> APIs; we appreciate that they've made these APIs available, and we're returning the favor with <a href="/api/help">our own API</a>. You're welcome to use it. We use <a href="http://lesscss.org/">Less</a> to organize our CSS. We process pledges with <a href="https://stripe.com/">Stripe</a>. We collaborate on our code at <a href="https://github.com/">GitHub</a> and deploy to the cloud with <a href="http://aws.amazon.com/ec2/">Amazon EC2</a>.</dd>
|
||||
<dt>What licenses are supported? </dt>
|
||||
<dd>
|
||||
The default Unglue.it license is a <a href="http://creativecommons.org/licenses/by-nc-nd/3.0/">Creative Commons BY-NC-ND</a> license. This license makes the edition free and legal for everyone to read, copy, and share worldwide. It requires that the author be credited and does not allow commercial use or derivative works (such as film adaptations) without additional permission from the rights holder.<br /><br />
|
||||
We chose this license because it's a worldwide standard that has been developed by legal experts and tested in court. It invites readers to enjoy the book while providing clarity about their legal rights. It strikes a balance between rights holders' interests in promoting their work today and retaining certain potentially valuable rights for the future.<br /><br />
|
||||
Creative Commons offers a variety of other licenses, many of them with even less restrictive terms. Unglue.it is happy to use any of them, if the rights holder prefers.
|
||||
We support the <a href="http://creativecommons.org/licenses/">Creative Commons</a> licenses in all of our programs. Ebooks with these licenses are free and legal for everyone to read, copy, and share worldwide and requires that the author attribution.<br /><br />
|
||||
We support a additional Free Licenses in our Thanks-for-Ungluing program.
|
||||
</dd>
|
||||
|
||||
<dt>I have more questions...</dt>
|
||||
|
@ -84,6 +84,12 @@ Creative Commons offers a variety of other licenses, many of them with even less
|
|||
|
||||
<a id="video"></a><h2>Video</h2>
|
||||
<div class="pressvideos">
|
||||
|
||||
<div>
|
||||
<iframe src="http://research.microsoft.com/apps/video/ifVideo.aspx?id=232715" style="width:480px; height:270px; overflow:hidden; border:none;" scrolling="no"></iframe><br />
|
||||
<I>Nov 2014</I><br />
|
||||
Eric Hellman at "Shaking It Up".
|
||||
</div>
|
||||
<div>
|
||||
<iframe width="480" height="270" src="https://www.youtube-nocookie.com/embed/HxjTW4OBouo?rel=0" frameborder="0" allowfullscreen></iframe><br />
|
||||
<I>June 2012</I><br />
|
||||
|
@ -105,11 +111,7 @@ Creative Commons offers a variety of other licenses, many of them with even less
|
|||
<I>November 2011</I><br />
|
||||
Eric Hellman, "The Network is Overrated"; talk at <a href="http://bib.archive.org/">Books in Browsers</a> 2011.
|
||||
</div>
|
||||
<div>
|
||||
<iframe width="480" height="274" src="//www.youtube-nocookie.com/embed/mhfr-GWlo0M?rel=0" frameborder="0" allowfullscreen></iframe><br />
|
||||
<I>June 2011</I><br />
|
||||
Eric Hellman explains the Gluejar model to David Weinberger at <a href="http://lod-lam.net/summit/">LOD-LAM</a> 2011.
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="press_spacer"></div>
|
||||
|
||||
|
@ -130,51 +132,5 @@ Creative Commons offers a variety of other licenses, many of them with even less
|
|||
<div><a href="/static/images/unglued.png"><img src="/static/images/unglued.png" alt="small Logo" /></a></div>
|
||||
<div class="text"><p>Logo image only, 44px x 30px</p></div>
|
||||
</div>
|
||||
<div class="outer">
|
||||
<div><a href="/static/images/workpage.png"><img src="/static/images/workpage_thumb.png" class="screenshot" alt="screenshot" /></a></div>
|
||||
<div class="text"><p>300 ppi screenshot of a book page on Unglue.it. Features include links to the book, where available, at Google Books, Open Library, GoodReads, and LibraryThing; social sharing options; tabs with user comments and more information; and an explore bar linking to other books and users. The user list is dynamically generated, reflecting others interested in the same book.</p></div>
|
||||
</div>
|
||||
<div class="outer">
|
||||
<div><a href="/static/images/supporter_listview.png"><img src="/static/images/supporter_listview_thumb.png" class="screenshot" alt="screenshot" /></a></div>
|
||||
<div class="text"><p>300 ppi screenshot of a supporter page. Supporters can readily see all the books on their faves list and filter for active or successful campaigns. Icons show how many other ungluers have faved a book or, for active campaigns, their progress toward completion. Unglued and public domain books have links to freely available copies. Supporters can link to their home page and accounts on Facebook, Twitter, GoodReads, and LibraryThing (note icons in upper right), as well as import books from their GoodReads and LibraryThing accounts to their wishlist.</p></div>
|
||||
</div>
|
||||
<div class="outer">
|
||||
<div><a href="/static/images/supporter_panelview.png"><img src="/static/images/supporter_panelview_thumb.png" class="screenshot" alt="screenshot" /></a></div>
|
||||
<div class="text"><p>300 ppi screenshot of a supporter page in panel view. This displays the same information as the list view, but in a less information-dense, more visually arresting format. Supporters can toggle between views.</p></div>
|
||||
</div>
|
||||
<div class="outer">
|
||||
<div><a href="/static/images/search_listview.png"><img src="/static/images/search_listview_thumb.png" class="screenshot" alt="screenshot" /></a></div>
|
||||
<div class="text"><p>300 ppi screenshot of a search result page, powered by Google Books. Users can add books to their wishlist with one click, or click through for more information. Books with active campaigns display a progress meter. Where possible, books that are already unglued or in the public domain link to freely available copies.</p></div>
|
||||
</div>
|
||||
<div class="outer">
|
||||
<div><a href="/static/images/search_panelview.png"><img src="/static/images/search_panelview_thumb.png" class="screenshot" alt="screenshot" /></a></div>
|
||||
<div class="text"><p>300 ppi screenshot of a search result page, in panel view. As with the supporter page, users can toggle between views.</p></div>
|
||||
</div>
|
||||
</div>
|
||||
<a id="releases"></a><h2>Press Releases</h2>
|
||||
<div class="pressarticles">
|
||||
<div>
|
||||
<a href="/static/pdfs/OLAUngluedEbookRelease.pdf">Oral Literature in Africa unglued ebook released</a><br />September 12, 2012
|
||||
</div>
|
||||
<div>
|
||||
<a href="/static/pdfs/PressReleaselaunchoverall.pdf">Main launch announcement</a><br />May 17, 2012
|
||||
</div>
|
||||
<div>
|
||||
<a href="/static/pdfs/PressReleaseBuddingReader.pdf">Launch announcement: Budding Reader campaign</a><br />May 17, 2012
|
||||
</div>
|
||||
<div>
|
||||
<a href="/static/pdfs/PressReleaseMikeLaser.pdf">Launch announcement: Michael Laser campaign</a><br />May 17, 2012
|
||||
</div>
|
||||
<div>
|
||||
<a href="/static/pdfs/PressReleaseJoeNassise.pdf">Launch announcement: Joseph Nassise campaign</a><br />May 17, 2012
|
||||
</div>
|
||||
<div>
|
||||
<a href="/static/pdfs/PressReleaseOpenBook.pdf">Launch announcement: Open Book Publishers campaign</a><br />May 17, 2012
|
||||
</div>
|
||||
<div>
|
||||
<a href="/static/pdfs/PressReleaseNancyRawles.pdf">Launch announcement: Nancy Rawles campaign</a><br />May 17, 2012
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<br /><br /><br /><br /><br /><br />
|
||||
{% endblock %}
|
|
@ -3,7 +3,7 @@
|
|||
{% load lib_acqs %}
|
||||
{% load purchased %}
|
||||
|
||||
{% block title %}Pledge{% endblock %}
|
||||
{% block title %}Purchase{% endblock %}
|
||||
|
||||
{% block extra_extra_head %}
|
||||
<script type="text/javascript" src="/static/js/reconcile_pledge.js"></script>
|
||||
|
@ -100,19 +100,18 @@
|
|||
{{ form.non_field_errors }}
|
||||
|
||||
{% if work.offers.all|length > 1 %}
|
||||
<div class="pledge_amount premium_level">Purchase Options: Individual or Library?</div>
|
||||
<div class="pledge_amount premium_level">Purchase Options: Individual, Gift or Library?</div>
|
||||
|
||||
<div style="height:10px;"></div>
|
||||
|
||||
<ul class="support menu" id="premiums_list">
|
||||
<ul class="support menu" id="offers_list">
|
||||
{% with work.last_campaign.individual_offer as offer %}
|
||||
<li class="first">
|
||||
{% if user_license.purchased %}
|
||||
<span class="menu-item-desc">Individual license already purchased!</span>
|
||||
<span class="menu-item-desc">Individual license already {% if user_license.purchased.gifts.all.count %}a gift to you!{% else %}purchased!{% endif %}</span>
|
||||
{% else %}
|
||||
<label for="offer_{{offer.id}}">
|
||||
<input type="hidden" name="copies" value="1" />
|
||||
<input type="radio" name="offer_id" id="offer_{{offer.id}}" value="{{offer.id}}" {% ifequal request.REQUEST.offer_id offer.id|stringformat:"s" %}checked="checked"{% else %} {% ifequal offer_id offer.id %}checked="checked"{% endifequal %}{% endifequal %} />
|
||||
<input type="radio" name="offer_id" id="offer_{{offer.id}}" value="{{offer.id}}" {% if not give %}{% ifequal offer_id offer.id|stringformat:"s" %}checked="checked"{% endifequal %}{% endif %} />
|
||||
<span class="menu-item-price">
|
||||
${{ offer.price|floatformat:2|intcomma }}
|
||||
</span>
|
||||
|
@ -122,12 +121,29 @@
|
|||
</label>
|
||||
{% endif %}
|
||||
</li>
|
||||
<li id="give_offer">
|
||||
<label for="give_{{offer.id}}">
|
||||
<input type="radio" name="offer_id" id="give_{{offer.id}}" value="give{{offer.id}}" {% if give %}checked="checked"{% endif %} />
|
||||
<span class="menu-item-price">
|
||||
${{ offer.price|floatformat:2|intcomma }}
|
||||
</span>
|
||||
<span class="menu-item-desc">
|
||||
Give this ebook as a gift.
|
||||
</span>
|
||||
<div class="menu-item-desc {% if give %}on{% else %}off{% endif %}" id="give_form">
|
||||
{{ form.give_to.errors }}
|
||||
<span class="give_label">Recipient email: </span>{{ form.give_to }}
|
||||
<span class="give_label">Gift Message:</span>
|
||||
<textarea id="give_message" rows="3" name="give_message" maxlength="512">I'm giving you '{{ work.title }}' at unglue.it. I hope you like it. - {{ request.user.username }} </textarea>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
{% endwith %}
|
||||
{% with work.last_campaign.library_offer as offer %}
|
||||
<li class="last">
|
||||
{% if request.user.profile.libraries %}
|
||||
<label for="offer_{{offer.id}}">
|
||||
<input type="radio" name="offer_id" id="offer_{{offer.id}}" value="{{offer.id}}" {% ifequal request.REQUEST.offer_id offer.id|stringformat:"s" %}checked="checked"{% else %} {% ifequal offer_id offer.id %}checked="checked"{% else %} {% if user.library %}checked="checked"{% endif %}{% endifequal %}{% endifequal %} />
|
||||
<input type="radio" name="offer_id" id="offer_{{offer.id}}" value="{{offer.id}}" {% ifequal offer_id offer.id|stringformat:"s" %}checked="checked"{% else %} {% if user.library %}checked="checked"{% endif %}{% endifequal %} />
|
||||
<span class="menu-item-price">
|
||||
${{ offer.price|floatformat:2|intcomma }}
|
||||
</span>
|
||||
|
@ -156,7 +172,7 @@
|
|||
{% endif %}
|
||||
|
||||
|
||||
<div id="anonbox"><I>{{ form.anonymous.label_tag }}</I> {{ form.anonymous.errors }}{{ form.anonymous }}</div>
|
||||
<div id="anonbox" {% if give %}class="off"{% endif %}><I>{{ form.anonymous.label_tag }}</I> {{ form.anonymous.errors }}{{ form.anonymous }}</div>
|
||||
<input name="pledge" type="submit" value="Buy Now" id="pledgesubmit" class="loader-gif" />
|
||||
<input name="decoy" type="submit" id="fakepledgesubmit" disabled="disabled" />
|
||||
{% if request.user.credit.available > 0 %}
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
stuff about stuff.
|
||||
will contain campaign info. maybe a cover image. (small.)
|
||||
{% comment %}
|
||||
<p class="pledge_complete">You just pledged ${{transaction.amount|intcomma}} to <a href="{% url work work.id %}">{{work.title}}</a>.</p>
|
||||
<p class="pledge_complete">You just pledged ${{transaction.amount|floatformat:2|intcomma}} to <a href="{% url work work.id %}">{{work.title}}</a>.</p>
|
||||
<p class="pledge_complete">If the campaign reaches its target of ${{campaign.target|floatformat:0|intcomma}} by {{campaign.deadline|date:"F d, Y"}},
|
||||
your PayPal account will be charged ${{transaction.amount|intcomma}}.</p>
|
||||
your PayPal account will be charged ${{transaction.amount|floatformat:2|intcomma}}.</p>
|
||||
|
||||
note: campaign (image, title, rights holder, deadline, maybe target)
|
||||
pledge amount
|
||||
|
|
|
@ -8,17 +8,23 @@
|
|||
<p>
|
||||
Below is a list of subjects for books that users have added to
|
||||
wishlists. It is here primarily to show what subjects are present
|
||||
in the database to guide further development. You can order by the
|
||||
<a href="{% url subjects %}">subject name</a> or by the
|
||||
<a href="{% url subjects %}?order=count">number</a> of works
|
||||
with that subject.
|
||||
in the database to guide further development.
|
||||
</p>
|
||||
<ul>
|
||||
<li> ordered by <a href="{% url subjects %}">subject name</a> </li>
|
||||
<li> ordered by <a href="{% url subjects %}?order=count">number</a> of works with the subject.</li>
|
||||
<li> ordered by <a href="{% url subjects %}?subset=free">subject name</a> (free works only)</li>
|
||||
<li> ordered by <a href="{% url subjects %}?order=count&subset=free">number</a> of free works with the subject.</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
<ul>
|
||||
{% for subject in subjects %}
|
||||
|
||||
<li><a href="{% url free %}kw.{{ subject.name }}/">{{ subject.name }}</a> ({{ subject.works__count }}). {% if request.user.is_staff %} <a href="{% url free %}?setkw={{ subject.name }}">set keywords</a>{% endif %}</li>
|
||||
<li><a href="{% url free %}kw.{{ subject.name }}/">{{ subject.name }}</a>
|
||||
({% if subject.works__is_free__count %}{{ subject.works__is_free__count }} free out of {{ subject.works.all.count }}{% else %}{{ subject.works__count }}{% endif %} total works).
|
||||
{% if request.user.is_staff %} <a href="{% url free %}?setkw={{ subject.name }}">set keywords</a>{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</p>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{% load libraryauthtags %}
|
||||
<div class="trans_summary">
|
||||
{% ifequal transaction.campaign.type 1 %}
|
||||
Your pledge: ${{transaction.amount|intcomma}}.<br />
|
||||
Your pledge: ${{transaction.amount|floatformat:2|intcomma}}.<br />
|
||||
Your premium: {% if transaction.premium %}{{ transaction.premium.description }}{% else %}You did not request a premium for this campaign.{% endif %}<br />
|
||||
{% if transaction.anonymous %}You asked to pledge anonymously, so you will be counted but not named on the list of supporters.<br />{% endif %}<br />
|
||||
Acknowledgements: <ul>
|
||||
|
@ -25,13 +25,13 @@
|
|||
{% endifequal %}
|
||||
{% ifequal transaction.campaign.type 2 %}
|
||||
{% ifequal transaction.host 'credit' %}
|
||||
Amount: ${{transaction.max_amount|intcomma}}.<br />
|
||||
Amount: ${{transaction.max_amount|floatformat:2|intcomma}}.<br />
|
||||
This amount has been deducted from your Unglue.it credit balance.<br />
|
||||
You have ${{request.user.credit.available|default:"0"}} of credit left.<br />
|
||||
{% else %}
|
||||
Total: ${{transaction.max_amount|intcomma}}.<br />
|
||||
Total: ${{transaction.max_amount|floatformat:2|intcomma}}.<br />
|
||||
{% if transaction.max_amount > transaction.amount %}
|
||||
Your credit card has been charged ${{transaction.amount}}.<br />
|
||||
Your credit card has been charged ${{transaction.amount|floatformat:2|intcomma}}.<br />
|
||||
The rest has been deducted from your unglue.it credit balance.<br />
|
||||
You have ${{request.user.credit.available|default:"0"}} of credit left.<br />
|
||||
{% else %}
|
||||
|
|
|
@ -639,7 +639,7 @@
|
|||
<ul class="support menu">
|
||||
{% if purchased %}
|
||||
<li class="first no_link">
|
||||
<span class="menu-item-desc">Purchased!</span>
|
||||
<span class="menu-item-desc">{% if purchased.gifts.all.count %}A gift to you!{% else %}Purchased!{% endif %}</span>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="first" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
|
||||
|
@ -651,6 +651,17 @@
|
|||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
<h3 class="jsmod-title"><span>Buy as a Gift</span></h3>
|
||||
<div class="jsmod-content">
|
||||
<ul class="support menu">
|
||||
<li class="first" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
|
||||
<a href="{% url purchase work_id %}?offer_id=give{{work.last_campaign.individual_offer.id}}">
|
||||
<span class="menu-item-price" itemprop="price">${{ work.last_campaign.individual_offer.price|floatformat:2|intcomma }}</span>
|
||||
<span class="menu-item-desc">{{ work.last_campaign.individual_offer.get_license_display }}</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{% if borrowed %}
|
||||
<h3 class="jsmod-title">
|
||||
<span class="on-wishlist">Borrowed!</span>
|
||||
|
|
|
@ -115,6 +115,8 @@ urlpatterns = patterns(
|
|||
url(r"^googlebooks/(?P<googlebooks_id>.+)/$", "googlebooks", name="googlebooks"),
|
||||
url(r"^download_ebook/(?P<ebook_id>\w+)/$", "download_ebook", name="download_ebook"),
|
||||
url(r"^download_ebook/acq/(?P<format>\w+)/(?P<nonce>\w+)/$", "download_acq", name="download_acq"),
|
||||
url(r"^receive_gift/(?P<nonce>\w+)/$", "receive_gift", name="receive_gift"),
|
||||
url(r"^display_gift/(?P<gift_id>\d+)/(?P<message>newuser|existing)/$", "display_gift", name="display_gift"),
|
||||
url(r"^gift/$", login_required(GiftView.as_view()), name="gift"),
|
||||
url(r"^gift/credit/(?P<token>.+)/$", login_required(GiftCredit.as_view()), name="gift_credit"),
|
||||
url(r"^pledge/(?P<work_id>\d+)/$", login_required(PledgeView.as_view(),login_url='/accounts/login/pledge/'), name="pledge"),
|
||||
|
|
|
@ -116,7 +116,9 @@ from regluit.frontend.forms import (
|
|||
PressForm,
|
||||
KindleEmailForm,
|
||||
LibModeForm,
|
||||
DateCalculatorForm
|
||||
DateCalculatorForm,
|
||||
UserNamePass,
|
||||
RegiftForm,
|
||||
)
|
||||
|
||||
from regluit.payment import baseprocessor, stripelib
|
||||
|
@ -141,7 +143,7 @@ from regluit.payment.parameters import (
|
|||
from regluit.utils.localdatetime import now, date_today
|
||||
from regluit.booxtream.exceptions import BooXtreamError
|
||||
from regluit.pyepub import InvalidEpub
|
||||
from regluit.libraryauth.views import Authenticator
|
||||
from regluit.libraryauth.views import Authenticator, superlogin, login_user
|
||||
from regluit.libraryauth.models import Library
|
||||
from regluit.marc.views import qs_marc_records
|
||||
|
||||
|
@ -768,12 +770,19 @@ def googlebooks(request, googlebooks_id):
|
|||
def subjects(request):
|
||||
order = request.GET.get('order')
|
||||
subjects = models.Subject.objects.all()
|
||||
subjects = subjects.annotate(Count('works'))
|
||||
|
||||
if request.GET.get('order') == 'count':
|
||||
subjects = subjects.order_by('-works__count')
|
||||
subjects = subjects
|
||||
if request.GET.get('subset') == 'free':
|
||||
subjects = models.Subject.objects.filter(works__is_free = True).annotate(Count('works__is_free'))
|
||||
if request.GET.get('order') == 'count':
|
||||
subjects = subjects.order_by('-works__is_free__count')
|
||||
else:
|
||||
subjects = subjects.order_by('name')
|
||||
else:
|
||||
subjects = subjects.order_by('name')
|
||||
subjects = models.Subject.objects.all().annotate(Count('works'))
|
||||
if request.GET.get('order') == 'count':
|
||||
subjects = subjects.order_by('-works__count')
|
||||
else:
|
||||
subjects = subjects.order_by('name')
|
||||
|
||||
return render(request, 'subjects.html', {'subjects': subjects})
|
||||
|
||||
|
@ -828,10 +837,10 @@ class WorkListView(FilterableListView):
|
|||
qs=self.get_queryset()
|
||||
context['ungluers'] = userlists.work_list_users(qs,5)
|
||||
context['facet'] = self.kwargs.get('facet','')
|
||||
works_unglued = qs.exclude(editions__ebooks__isnull=True).distinct() | qs.filter(campaigns__status='SUCCESSFUL').distinct()
|
||||
works_unglued = qs.filter(is_free = True).distinct() | qs.filter(campaigns__status='SUCCESSFUL').distinct()
|
||||
context['works_unglued'] = works_unglued[:self.max_works]
|
||||
context['works_active'] = qs.filter(campaigns__status='ACTIVE').distinct()[:self.max_works]
|
||||
context['works_wished'] = qs.exclude(editions__ebooks__isnull=False).exclude(campaigns__status='ACTIVE').exclude(campaigns__status='SUCCESSFUL').distinct()[:self.max_works]
|
||||
context['works_wished'] = qs.filter(is_free=False).exclude(campaigns__status='ACTIVE').exclude(campaigns__status='SUCCESSFUL').distinct()[:self.max_works]
|
||||
|
||||
counts={}
|
||||
counts['unglued'] = context['works_unglued'].count()
|
||||
|
@ -928,16 +937,16 @@ class UngluedListView(FilterableListView):
|
|||
def get_queryset_all(self):
|
||||
facet = self.kwargs['facet']
|
||||
if (facet == 'popular'):
|
||||
return models.Work.objects.filter(editions__ebooks__isnull=False).distinct().order_by('-num_wishes')
|
||||
return models.Work.objects.filter(is_free = True).distinct().order_by('-num_wishes')
|
||||
elif (facet == 'cc' or facet == 'creativecommons'):
|
||||
# assumes all ebooks have a PD or CC license. compare rights_badge property
|
||||
return models.Work.objects.filter(
|
||||
editions__ebooks__isnull=False,
|
||||
is_free = True,
|
||||
editions__ebooks__rights__in=cc.LICENSE_LIST
|
||||
).exclude(campaigns__status="SUCCESSFUL").distinct().order_by('-num_wishes')
|
||||
elif (facet == 'pd' or facet == 'publicdomain'):
|
||||
return models.Work.objects.filter(
|
||||
editions__ebooks__isnull=False,
|
||||
is_free = True,
|
||||
editions__ebooks__rights__in=['PD-US', 'CC0', '']
|
||||
).distinct().order_by('-num_wishes')
|
||||
else :
|
||||
|
@ -1220,6 +1229,7 @@ class PurchaseView(PledgeView):
|
|||
'cover_width': cover_width(self.work),
|
||||
'offer_id':self.offer_id,
|
||||
'user_license': self.work.get_user_license(self.request.user),
|
||||
'give': self.give
|
||||
})
|
||||
|
||||
return context
|
||||
|
@ -1242,6 +1252,9 @@ class PurchaseView(PledgeView):
|
|||
}
|
||||
if self.request.method == 'POST':
|
||||
self.data.update(self.request.POST.dict())
|
||||
self.data['give'] = self.give
|
||||
if self.give:
|
||||
self.data['offer_id'] = self.offer_id
|
||||
if not self.request.POST.has_key('anonymous'):
|
||||
del self.data['anonymous']
|
||||
return {'data':self.data}
|
||||
|
@ -1249,8 +1262,10 @@ class PurchaseView(PledgeView):
|
|||
return {'initial':self.data}
|
||||
|
||||
def get_preapproval_amount(self):
|
||||
|
||||
self.offer_id = self.request.REQUEST.get('offer_id', None)
|
||||
self.give = self.offer_id.startswith('give') if self.offer_id else False
|
||||
if self.give:
|
||||
self.offer_id = self.offer_id[4:]
|
||||
if not self.offer_id and self.work.last_campaign() and self.work.last_campaign().individual_offer:
|
||||
self.offer_id = self.work.last_campaign().individual_offer.id
|
||||
preapproval_amount = None
|
||||
|
@ -1581,21 +1596,22 @@ class FundCompleteView(TemplateView):
|
|||
if not self.user_is_ok():
|
||||
return context
|
||||
|
||||
# add the work corresponding to the Transaction on the user's wishlist if it's not already on the wishlist
|
||||
if self.transaction.user is not None and (campaign is not None) and (work is not None):
|
||||
self.transaction.user.wishlist.add_work(work, 'pledging', notify=True)
|
||||
gift = self.transaction.extra.has_key('give_to')
|
||||
if not gift:
|
||||
# add the work corresponding to the Transaction on the user's wishlist if it's not already on the wishlist
|
||||
if self.transaction.user is not None and (campaign is not None) and (work is not None):
|
||||
self.transaction.user.wishlist.add_work(work, 'pledging', notify=True)
|
||||
|
||||
#put info into session for download page to pick up.
|
||||
self.request.session['amount']= self.transaction.amount
|
||||
if self.transaction.receipt:
|
||||
self.request.session['receipt']= self.transaction.receipt
|
||||
self.request.session['amount']= self.transaction.amount
|
||||
if self.transaction.receipt:
|
||||
self.request.session['receipt']= self.transaction.receipt
|
||||
|
||||
|
||||
context["transaction"] = self.transaction
|
||||
context["work"] = work
|
||||
context["campaign"] = campaign
|
||||
context["faqmenu"] = "complete"
|
||||
context["slidelist"] = slideshow()
|
||||
context["site"] = Site.objects.get_current()
|
||||
|
||||
return context
|
||||
|
@ -1927,7 +1943,7 @@ def supporter(request, supporter_username, template_name, extra_context={}):
|
|||
# unglued tab is anything with an existing ebook or successful campaign
|
||||
## .order_by() may clash with .distinct() and this should be fixed
|
||||
unglueit_works = works_on_wishlist.filter(campaigns__status="SUCCESSFUL").distinct()
|
||||
works_otherwise_available = works_on_wishlist.filter(editions__ebooks__isnull=False).distinct()
|
||||
works_otherwise_available = works_on_wishlist.filter(is_free = True).distinct()
|
||||
works_unglued = unglueit_works | works_otherwise_available
|
||||
works_unglued = works_unglued.order_by('-campaigns__status', 'campaigns__deadline', '-num_wishes')
|
||||
|
||||
|
@ -2028,7 +2044,7 @@ def library(request,library_name):
|
|||
|
||||
|
||||
|
||||
def edit_user(request):
|
||||
def edit_user(request, redirect_to=None):
|
||||
if not request.user.is_authenticated():
|
||||
return HttpResponseRedirect(reverse('superlogin'))
|
||||
form=UserData()
|
||||
|
@ -2039,7 +2055,11 @@ def edit_user(request):
|
|||
if form.is_valid(): # All validation rules pass, go and change the username
|
||||
request.user.username=form.cleaned_data['username']
|
||||
request.user.save()
|
||||
return HttpResponseRedirect(reverse('home')) # Redirect after POST
|
||||
if 'set_password' in request.POST.keys() and form.cleaned_data.has_key('set_password'):
|
||||
if not request.user.has_usable_password():
|
||||
request.user.set_password(form.cleaned_data['set_password'])
|
||||
request.user.save()
|
||||
return HttpResponseRedirect(redirect_to if redirect_to else reverse('home')) # Redirect after POST
|
||||
return render(request,'registration/user_change_form.html', {'form': form})
|
||||
|
||||
class ManageAccount(FormView):
|
||||
|
@ -2952,6 +2972,88 @@ def about(request, facet):
|
|||
except TemplateDoesNotExist:
|
||||
return render(request, "about.html")
|
||||
|
||||
def receive_gift(request, nonce):
|
||||
try:
|
||||
gift = models.Gift.objects.get(acq__nonce=nonce)
|
||||
except models.Gift.DoesNotExist:
|
||||
return render(request, 'gift_error.html', )
|
||||
context = {'gift': gift, "site": Site.objects.get_current() }
|
||||
work = gift.acq.work
|
||||
context['work'] = work
|
||||
# put nonce in session so we know that a user has redeemed a Gift
|
||||
request.session['gift_nonce'] = nonce
|
||||
if gift.used:
|
||||
return render(request, 'gift_error.html', context )
|
||||
if request.user.is_authenticated() and not gift.used:
|
||||
user_license = work.get_user_license(request.user)
|
||||
if user_license and user_license.purchased:
|
||||
# check if previously purchased- there would be two user licenses if so.
|
||||
if user_license.is_duplicate or request.user.id == gift.giver.id:
|
||||
# regift
|
||||
if request.method == 'POST':
|
||||
form=RegiftForm( data=request.POST)
|
||||
if form.is_valid():
|
||||
giftee = models.Gift.giftee(form.cleaned_data['give_to'], request.user.username)
|
||||
new_acq = models.Acq.objects.create(user=giftee, work=gift.acq.work, license= gift.acq.license)
|
||||
new_gift = models.Gift.objects.create(acq=new_acq, message=form.cleaned_data['give_message'], giver=request.user , to = form.cleaned_data['give_to'])
|
||||
context['gift'] = new_gift
|
||||
gift.acq.expire_in(0)
|
||||
gift.use()
|
||||
notification.send([giftee], "purchase_gift", context, True)
|
||||
return render(request, 'gift_duplicate.html', context)
|
||||
context['form']= RegiftForm()
|
||||
return render(request, 'gift_duplicate.html', context)
|
||||
else:
|
||||
# new book!
|
||||
gift.use()
|
||||
request.user.wishlist.add_work(gift.acq.work, 'gift')
|
||||
return HttpResponseRedirect( reverse('display_gift', args=[gift.id,'existing'] ))
|
||||
else:
|
||||
# we'll just leave the old user inactive.
|
||||
gift.acq.user = request.user
|
||||
gift.acq.save()
|
||||
gift.use()
|
||||
request.user.wishlist.add_work(gift.acq.work, 'gift')
|
||||
return HttpResponseRedirect( reverse('display_gift', args=[gift.id,'existing'] ))
|
||||
if (gift.acq.created - gift.acq.user.date_joined) > timedelta(minutes=1) or gift.used:
|
||||
# giftee is established user (or gift has been used), ask them to log in
|
||||
return superlogin(request, extra_context=context, template_name='gift_login.html')
|
||||
else:
|
||||
# giftee is a new user, log them in
|
||||
gift.use()
|
||||
gift.acq.user.wishlist.add_work(gift.acq.work, 'gift')
|
||||
login_user(request, gift.acq.user)
|
||||
|
||||
return HttpResponseRedirect( reverse('display_gift', args=[gift.id, 'newuser'] ))
|
||||
|
||||
@login_required
|
||||
def display_gift(request, gift_id, message):
|
||||
try:
|
||||
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 :
|
||||
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 }
|
||||
if request.method == 'POST' and redeemed_gift:
|
||||
form=UserNamePass(data=request.POST)
|
||||
form.oldusername = request.user.username
|
||||
context['form'] = form
|
||||
if form.is_valid():
|
||||
request.user.username = form.cleaned_data['username']
|
||||
request.user.set_password(form.cleaned_data['password1'])
|
||||
request.user.save()
|
||||
context.pop('form')
|
||||
context['passmessage'] = "changed userpass"
|
||||
return render(request, 'gift_welcome.html', context)
|
||||
else:
|
||||
if redeemed_gift:
|
||||
form = UserNamePass(initial={'username':request.user.username})
|
||||
form.oldusername = request.user.username
|
||||
context['form'] = form
|
||||
return render(request, 'gift_welcome.html', context)
|
||||
|
||||
@login_required
|
||||
@csrf_exempt
|
||||
def ml_status(request):
|
||||
|
|
|
@ -279,7 +279,7 @@ JQUERY_HOME = "/static/js/jquery-1.7.1.min.js"
|
|||
JQUERY_UI_HOME = "/static/js/jquery-ui-1.8.16.custom.min.js"
|
||||
|
||||
# Mailchimp archive JavaScript URL
|
||||
CAMPAIGN_ARCHIVE_JS = "http://us2.campaign-archive1.com/generate-js/?u=15472878790f9faa11317e085&fid=28161&show=5"
|
||||
CAMPAIGN_ARCHIVE_JS = "http://us2.campaign-archive1.com/generate-js/?u=15472878790f9faa11317e085&fid=28161&show=10"
|
||||
|
||||
# periodic tasks for celery
|
||||
# start out with nothing scheduled
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -14,6 +14,8 @@ $j().ready(function() {
|
|||
var supporterName = $j('#pass_supporter_name').html();
|
||||
var ackName = $j('#id_ack_name').val();
|
||||
var ackDedication = $j('#id_ack_dedication').val();
|
||||
var giveForm = $j('#give_form');
|
||||
var activeOffer = $j('li:has(#offers_list input[type=radio]:checked)');
|
||||
if(ackDedication == 'None') {
|
||||
ackDedication = '';
|
||||
}
|
||||
|
@ -139,6 +141,7 @@ $j().ready(function() {
|
|||
// when user clicks a premium, ensure it is compatible with the pledge box amount
|
||||
// if pledge box was empty, assume they wanted value of premium
|
||||
$j('#premiums_list input').on("click", function() {
|
||||
|
||||
amount = canonicalize($j(this));
|
||||
current = inputbox.val();
|
||||
if (current == "" && !isNaN(amount)) {
|
||||
|
@ -151,6 +154,23 @@ $j().ready(function() {
|
|||
}
|
||||
});
|
||||
|
||||
// when user clicks an offer
|
||||
$j('#offers_list li').on("click", function() {
|
||||
if ( $j(this).attr('id') == 'give_offer'){
|
||||
$j('#anonbox').addClass('off');
|
||||
giveForm.removeClass('off').addClass('on');
|
||||
$j(this).find('input[type=radio]').attr('checked', 'checked');
|
||||
} else {
|
||||
var radio = $j(this).find('input[type=radio]');
|
||||
if (radio.length ) {
|
||||
giveForm.removeClass('on').addClass('off');
|
||||
$j('#anonbox').removeClass('off');
|
||||
radio.attr('checked', 'checked');
|
||||
};
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
// when user changes the pledge box contents, ensure they are compatible
|
||||
// with the selected pledge
|
||||
inputbox.keyup(function() {
|
||||
|
|
|
@ -78,6 +78,31 @@ span.menu-item-price {
|
|||
float: none !important;
|
||||
}
|
||||
|
||||
ul#offers_list li {
|
||||
|
||||
div.on {
|
||||
display: block;
|
||||
background: @pale-blue;
|
||||
margin-top: 1em;
|
||||
.give_label {
|
||||
padding: 4px;
|
||||
color: black;
|
||||
}
|
||||
}
|
||||
div.off {
|
||||
display: none;
|
||||
}
|
||||
input[type=text], textarea {
|
||||
width: 95%;
|
||||
font-size: @font-size-larger;
|
||||
color: @text-blue;
|
||||
margin: 0 10px 5px 5px;
|
||||
}
|
||||
input[type=text]{
|
||||
.height(@font-size-larger*1.3);
|
||||
}
|
||||
|
||||
}
|
||||
#mandatory_premiums {
|
||||
font-size: @font-size-larger;
|
||||
|
||||
|
@ -294,4 +319,8 @@ span.level2.menu.answer {
|
|||
float: left;
|
||||
width: 48%;
|
||||
padding: 1%;
|
||||
&.off {
|
||||
display: none;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue