Big merge from master
commit
e2ab3d75a8
|
@ -22,7 +22,7 @@ class ApiTests(TestCase):
|
|||
deadline=now(),
|
||||
target=Decimal('1000.00'),
|
||||
)
|
||||
self.user = User.objects.create_user('test', 'test@example.com', 'testpass')
|
||||
self.user = User.objects.create_user('test', 'test@example.org', 'testpass')
|
||||
self.client = Client()
|
||||
|
||||
def test_user(self):
|
||||
|
|
|
@ -477,6 +477,9 @@ def merge_works(w1, w2, user=None):
|
|||
w2source = wishlist.work_source(w2)
|
||||
wishlist.remove_work(w2)
|
||||
wishlist.add_work(w1, w2source)
|
||||
for subject in w2.subjects.all():
|
||||
if subject not in w1.subjects.all():
|
||||
w1.subjects.add(subject)
|
||||
|
||||
models.WasWork(was=w2.pk, work=w1, user=user).save()
|
||||
for ww in models.WasWork.objects.filter(work = w2):
|
||||
|
@ -485,6 +488,17 @@ def merge_works(w1, w2, user=None):
|
|||
|
||||
w2.delete()
|
||||
|
||||
def despam_description(description):
|
||||
""" a lot of descriptions from openlibrary have free-book promotion text; this removes some of it."""
|
||||
if description.find("GeneralBooksClub.com")>-1 or description.find("AkashaPublishing.Com")>-1:
|
||||
return ""
|
||||
pieces=description.split("1stWorldLibrary.ORG -")
|
||||
if len(pieces)>1:
|
||||
return pieces[1]
|
||||
pieces=description.split("a million books for free.")
|
||||
if len(pieces)>1:
|
||||
return pieces[1]
|
||||
return description
|
||||
|
||||
def add_openlibrary(work, hard_refresh = False):
|
||||
if (not hard_refresh) and work.openlibrary_lookup is not None:
|
||||
|
@ -538,6 +552,7 @@ def add_openlibrary(work, hard_refresh = False):
|
|||
if isinstance(description,dict):
|
||||
if description.has_key('value'):
|
||||
description=description['value']
|
||||
description=despam_description(description)
|
||||
if not work.description or work.description.startswith('{') or len(description) > len(work.description):
|
||||
work.description = description
|
||||
work.save()
|
||||
|
@ -707,3 +722,4 @@ def add_missing_isbn_to_editions(max_num=None, confirm=False):
|
|||
|
||||
class LookupFailure(Exception):
|
||||
pass
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ class SupporterWishlistFeed(Feed):
|
|||
return "Latest wishbooks for %s on unglue.it" % obj.username
|
||||
|
||||
def link(self, obj):
|
||||
return "/%s/feed/" % obj.username
|
||||
return "/supporter/%s/feed/" % obj.username
|
||||
|
||||
def item_title(self, item):
|
||||
return "%s" % item.title
|
||||
|
@ -24,4 +24,4 @@ class SupporterWishlistFeed(Feed):
|
|||
return "/work/%s" % item.id
|
||||
|
||||
def items(self, obj):
|
||||
return obj.wishlist.works.all().order_by('-id')[:5]
|
||||
return obj.wishlist.works.all().order_by('-id')[:100]
|
|
@ -0,0 +1,17 @@
|
|||
|
||||
from django.core.management.base import BaseCommand
|
||||
from regluit.core import models, bookloader
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = "check description db for free ebook spam"
|
||||
|
||||
def handle(self, **options):
|
||||
spam_strings=["1stWorldLibrary.ORG", "GeneralBooksClub.com", "million-books.com", "AkashaPublishing.Com"]
|
||||
for spam_string in spam_strings:
|
||||
qs=models.Work.objects.filter(description__icontains=spam_string)
|
||||
print "Number of Works with %s in description: %s" % (spam_string, qs.count())
|
||||
|
||||
for work in qs:
|
||||
work.description = bookloader.despam_description(work.description)
|
||||
print "updating work %s" % work
|
||||
bookloader.add_openlibrary(work, hard_refresh = True)
|
|
@ -0,0 +1,250 @@
|
|||
# -*- 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 index on 'Campaign', fields ['deadline']
|
||||
db.create_index('core_campaign', ['deadline'])
|
||||
|
||||
# Adding index on 'Work', fields ['num_wishes']
|
||||
db.create_index('core_work', ['num_wishes'])
|
||||
|
||||
# Adding index on 'Edition', fields ['publisher']
|
||||
db.create_index('core_edition', ['publisher'])
|
||||
|
||||
# Adding index on 'Ebook', fields ['rights']
|
||||
db.create_index('core_ebook', ['rights'])
|
||||
|
||||
|
||||
def backwards(self, orm):
|
||||
# Removing index on 'Ebook', fields ['rights']
|
||||
db.delete_index('core_ebook', ['rights'])
|
||||
|
||||
# Removing index on 'Edition', fields ['publisher']
|
||||
db.delete_index('core_edition', ['publisher'])
|
||||
|
||||
# Removing index on 'Work', fields ['num_wishes']
|
||||
db.delete_index('core_work', ['num_wishes'])
|
||||
|
||||
# Removing index on 'Campaign', fields ['deadline']
|
||||
db.delete_index('core_campaign', ['deadline'])
|
||||
|
||||
|
||||
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'})
|
||||
},
|
||||
'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.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'}),
|
||||
'amazon_receiver': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'deadline': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}),
|
||||
'description': ('ckeditor.fields.RichTextField', [], {'null': 'True'}),
|
||||
'details': ('ckeditor.fields.RichTextField', [], {'null': 'True', 'blank': 'True'}),
|
||||
'edition': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'campaigns'", 'null': 'True', 'to': "orm['core.Edition']"}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'left': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '14', 'decimal_places': '2'}),
|
||||
'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'}),
|
||||
'status': ('django.db.models.fields.CharField', [], {'default': "'INITIALIZED'", 'max_length': '15', 'null': 'True'}),
|
||||
'target': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '14', 'decimal_places': '2'}),
|
||||
'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(2013, 3, 6, 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': "'pending'", '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'},
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'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.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'}),
|
||||
'public_domain': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
|
||||
'publication_date': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
|
||||
'publisher': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'null': 'True', 'blank': 'True'}),
|
||||
'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.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': '31'}),
|
||||
'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.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.rightsholder': {
|
||||
'Meta': {'object_name': 'RightsHolder'},
|
||||
'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'},
|
||||
'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'}),
|
||||
'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', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'source': ('django.db.models.fields.CharField', [], {'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', 'blank': 'True'}),
|
||||
'description': ('django.db.models.fields.TextField', [], {'default': "''", 'null': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'language': ('django.db.models.fields.CharField', [], {'default': "'en'", 'max_length': '2'}),
|
||||
'num_wishes': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}),
|
||||
'openlibrary_lookup': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
|
||||
'title': ('django.db.models.fields.CharField', [], {'max_length': '1000'})
|
||||
}
|
||||
}
|
||||
|
||||
complete_apps = ['core']
|
|
@ -1,19 +1,23 @@
|
|||
import re
|
||||
import random
|
||||
import logging
|
||||
from regluit.utils.localdatetime import now, date_today
|
||||
from regluit.utils import crypto
|
||||
from datetime import timedelta
|
||||
from decimal import Decimal
|
||||
from notification import models as notification
|
||||
from ckeditor.fields import RichTextField
|
||||
from postmonkey import PostMonkey, MailChimpException
|
||||
|
||||
from django.db import models
|
||||
from django.db.models import Q, get_model
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.sites.models import Site
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.conf import settings
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
||||
import regluit
|
||||
import regluit.core.isbn
|
||||
from regluit.core.signals import successful_campaign, unsuccessful_campaign, wishlist_added
|
||||
|
@ -23,6 +27,9 @@ from regluit.payment.parameters import TRANSACTION_STATUS_ACTIVE, TRANSACTION_ST
|
|||
|
||||
from django.db.models import Q
|
||||
|
||||
pm = PostMonkey(settings.MAILCHIMP_API_KEY)
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
class UnglueitError(RuntimeError):
|
||||
pass
|
||||
|
@ -365,7 +372,7 @@ class Campaign(models.Model):
|
|||
self.save()
|
||||
|
||||
ungluers = self.work.wished_by()
|
||||
notification.queue(ungluers, "wishlist_active", {'campaign':self, 'site': Site.objects.get_current()}, True)
|
||||
notification.queue(ungluers, "wishlist_active", {'campaign':self}, True)
|
||||
return self
|
||||
|
||||
|
||||
|
@ -403,9 +410,13 @@ class Campaign(models.Model):
|
|||
return self
|
||||
|
||||
def supporters(self):
|
||||
# expensive query used in loop; stash it
|
||||
if hasattr(self, '_translist_'):
|
||||
return self._translist_
|
||||
|
||||
"""nb: returns (distinct) supporter IDs, not supporter objects"""
|
||||
translist = self.transactions().filter(status=TRANSACTION_STATUS_ACTIVE).values_list('user', flat=True).distinct()
|
||||
return translist
|
||||
self._translist_ = self.transactions().filter(status=TRANSACTION_STATUS_ACTIVE).values_list('user', flat=True).distinct()
|
||||
return self._translist_
|
||||
|
||||
@property
|
||||
def supporters_count(self):
|
||||
|
@ -432,8 +443,11 @@ class Campaign(models.Model):
|
|||
return None
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def ungluers(self):
|
||||
# expensive query used in loop; stash it
|
||||
if hasattr(self, '_ungluers_'):
|
||||
return self._ungluers_
|
||||
p = PaymentManager()
|
||||
ungluers={"all":[],"supporters":[], "patrons":[], "bibliophiles":[]}
|
||||
if self.status == "ACTIVE":
|
||||
|
@ -452,6 +466,7 @@ class Campaign(models.Model):
|
|||
elif transaction.amount >= Premium.TIERS["supporter"]:
|
||||
ungluers['supporters'].append(transaction.user)
|
||||
|
||||
self._ungluers_= ungluers
|
||||
return ungluers
|
||||
|
||||
def ungluer_transactions(self):
|
||||
|
@ -516,9 +531,28 @@ class Campaign(models.Model):
|
|||
@property
|
||||
def success_date(self):
|
||||
if self.status == 'SUCCESSFUL':
|
||||
return self.actions.filter(type='succeeded')[0].timestamp
|
||||
try:
|
||||
return self.actions.filter(type='succeeded')[0].timestamp
|
||||
except:
|
||||
return ''
|
||||
return ''
|
||||
|
||||
@property
|
||||
def countdown(self):
|
||||
from math import ceil
|
||||
time_remaining = self.deadline - now()
|
||||
countdown = ""
|
||||
|
||||
if time_remaining.days:
|
||||
countdown = "%s days" % str(time_remaining.days + 1)
|
||||
elif time_remaining.seconds > 3600:
|
||||
countdown = "%s hours" % str(time_remaining.seconds/3600 + 1)
|
||||
elif time_remaining.seconds > 60:
|
||||
countdown = "%s minutes" % str(time_remaining.seconds/60 + 1)
|
||||
else:
|
||||
countdown = "Seconds"
|
||||
|
||||
return countdown
|
||||
|
||||
class Identifier(models.Model):
|
||||
# olib, ltwk, goog, gdrd, thng, isbn, oclc, olwk, olib, gute, glue
|
||||
|
@ -803,6 +837,9 @@ class Work(models.Model):
|
|||
except:
|
||||
return False
|
||||
|
||||
def get_absolute_url(self):
|
||||
return reverse('work', args=[str(self.id)])
|
||||
|
||||
class Author(models.Model):
|
||||
created = models.DateTimeField(auto_now_add=True)
|
||||
name = models.CharField(max_length=500)
|
||||
|
@ -827,7 +864,7 @@ class Subject(models.Model):
|
|||
class Edition(models.Model):
|
||||
created = models.DateTimeField(auto_now_add=True)
|
||||
title = models.CharField(max_length=1000)
|
||||
publisher = models.CharField(max_length=255, null=True, blank=True)
|
||||
publisher = models.CharField(max_length=255, null=True, blank=True, db_index=True)
|
||||
publication_date = models.CharField(max_length=50, null=True, blank=True)
|
||||
public_domain = models.NullBooleanField(null=True, blank=True)
|
||||
work = models.ForeignKey("Work", related_name="editions", null=True)
|
||||
|
@ -1098,7 +1135,36 @@ class UserProfile(models.Model):
|
|||
return last.anonymous
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
@property
|
||||
def on_ml(self):
|
||||
try:
|
||||
return settings.MAILCHIMP_NEWS_ID in pm.listsForEmail(email_address=self.user.email)
|
||||
except MailChimpException, e:
|
||||
if e.code!=215: # don't log case where user is not on a list
|
||||
logger.error("error getting mailchimp status %s" % (e))
|
||||
except Exception, e:
|
||||
logger.error("error getting mailchimp status %s" % (e))
|
||||
return False
|
||||
|
||||
def ml_subscribe(self, **kwargs):
|
||||
if "@example.org" in self.user.email:
|
||||
# use @example.org email addresses for testing!
|
||||
return True
|
||||
try:
|
||||
if not self.on_ml:
|
||||
return pm.listSubscribe(id=settings.MAILCHIMP_NEWS_ID, email_address=self.user.email, **kwargs)
|
||||
except Exception, e:
|
||||
logger.error("error subscribing to mailchimp list %s" % (e))
|
||||
return False
|
||||
|
||||
def ml_unsubscribe(self):
|
||||
try:
|
||||
return pm.listUnsubscribe(id=settings.MAILCHIMP_NEWS_ID, email_address=self.user.email)
|
||||
except Exception, e:
|
||||
logger.error("error unsubscribing from mailchimp list %s" % (e))
|
||||
return False
|
||||
|
||||
#class CampaignSurveyResponse(models.Model):
|
||||
# # generic
|
||||
# campaign = models.ForeignKey("Campaign", related_name="surveyresponse", null=False)
|
||||
|
|
|
@ -44,7 +44,8 @@ def create_user_objects(sender, created, instance, **kwargs):
|
|||
UserProfile = get_model('core', 'UserProfile')
|
||||
if created:
|
||||
Wishlist.objects.create(user=instance)
|
||||
UserProfile.objects.create(user=instance)
|
||||
profile = UserProfile.objects.create(user=instance)
|
||||
profile.ml_subscribe()
|
||||
except DatabaseError:
|
||||
# this can happen when creating superuser during syncdb since the
|
||||
# core_wishlist table doesn't exist yet
|
||||
|
@ -91,7 +92,7 @@ def create_notice_types(app, created_models, verbosity, **kwargs):
|
|||
notification.create_notice_type("wishlist_successful", _("Successful Campaign"), _("An ungluing campaign that you have supported or followed has succeeded."))
|
||||
notification.create_notice_type("wishlist_unsuccessful", _("Unsuccessful Campaign"), _("An ungluing campaign that you supported didn't succeed this time."))
|
||||
notification.create_notice_type("wishlist_updated", _("Campaign Updated"), _("An ungluing campaign you support has been updated."), default = 1)
|
||||
notification.create_notice_type("wishlist_message", _("Campaign Communication"), _("There's a message about an ungluing campaign you're interested in."))
|
||||
notification.create_notice_type("wishlist_message", _("Campaign Communication"), _("You have a private message from unglue.it staff or the rights holder about a book on your wishlist."))
|
||||
notification.create_notice_type("wishlist_price_drop", _("Campaign Price Drop"), _("An ungluing campaign you're interested in has a reduced target."), default = 1)
|
||||
notification.create_notice_type("wishlist_unglued_book_released", _("Unglued Book!"), _("A book you wanted is now available to be downloaded."))
|
||||
notification.create_notice_type("pledge_you_have_pledged", _("Thanks For Your Pledge!"), _("Your ungluing pledge has been entered."))
|
||||
|
@ -113,14 +114,15 @@ from django.contrib.comments.signals import comment_was_posted
|
|||
def notify_comment(comment, request, **kwargs):
|
||||
logger.info('comment %s notifying' % comment.pk)
|
||||
other_commenters = User.objects.filter(comment_comments__content_type=comment.content_type, comment_comments__object_pk=comment.object_pk).distinct().exclude(id=comment.user.id)
|
||||
other_wishers = comment.content_object.wished_by().exclude(id=comment.user.id).exclude(id__in=other_commenters)
|
||||
all_wishers = comment.content_object.wished_by().exclude(id=comment.user.id)
|
||||
other_wishers = all_wishers.exclude(id__in=other_commenters)
|
||||
domain = Site.objects.get_current().domain
|
||||
if comment.content_object.last_campaign() and comment.user in comment.content_object.last_campaign().managers.all():
|
||||
#official
|
||||
notification.queue(other_wishers, "wishlist_official_comment", {'comment':comment, 'domain':domain}, True)
|
||||
notification.queue(all_wishers, "wishlist_official_comment", {'comment':comment, 'domain':domain}, True)
|
||||
else:
|
||||
notification.queue(other_commenters, "comment_on_commented", {'comment':comment, 'domain':domain}, True)
|
||||
notification.queue(other_wishers, "wishlist_comment", {'comment':comment, 'domain':domain}, True)
|
||||
notification.send(other_commenters, "comment_on_commented", {'comment':comment}, True, sender=comment.user)
|
||||
notification.send(other_wishers, "wishlist_comment", {'comment':comment}, True, sender=comment.user)
|
||||
from regluit.core.tasks import emit_notifications
|
||||
emit_notifications.delay()
|
||||
|
||||
|
@ -138,8 +140,7 @@ def notify_successful_campaign(campaign, **kwargs):
|
|||
staff = User.objects.filter(is_staff=True)
|
||||
supporters = (User.objects.get(id=k) for k in campaign.supporters())
|
||||
|
||||
site = Site.objects.get_current()
|
||||
notification.queue(itertools.chain(staff, supporters), "wishlist_successful", {'campaign':campaign, 'site':site}, True)
|
||||
notification.send(itertools.chain(staff, supporters), "wishlist_successful", {'campaign':campaign}, True)
|
||||
from regluit.core.tasks import emit_notifications
|
||||
emit_notifications.delay()
|
||||
|
||||
|
@ -155,8 +156,7 @@ def notify_unsuccessful_campaign(campaign, **kwargs):
|
|||
staff = User.objects.filter(is_staff=True)
|
||||
supporters = (User.objects.get(id=k) for k in campaign.supporters())
|
||||
|
||||
site = Site.objects.get_current()
|
||||
notification.queue(itertools.chain(staff, supporters), "wishlist_unsuccessful", {'campaign':campaign, 'site':site}, True)
|
||||
notification.send(itertools.chain(staff, supporters), "wishlist_unsuccessful", {'campaign':campaign}, True)
|
||||
from regluit.core.tasks import emit_notifications
|
||||
emit_notifications.delay()
|
||||
|
||||
|
@ -166,10 +166,7 @@ unsuccessful_campaign.connect(notify_unsuccessful_campaign)
|
|||
def handle_transaction_charged(sender,transaction=None, **kwargs):
|
||||
if transaction==None:
|
||||
return
|
||||
notification.queue([transaction.user], "pledge_charged", {
|
||||
'site':Site.objects.get_current(),
|
||||
'transaction':transaction
|
||||
}, True)
|
||||
notification.send([transaction.user], "pledge_charged", {'transaction':transaction}, True)
|
||||
from regluit.core.tasks import emit_notifications
|
||||
emit_notifications.delay()
|
||||
|
||||
|
@ -184,8 +181,7 @@ def handle_transaction_failed(sender,transaction=None, **kwargs):
|
|||
# window for recharging
|
||||
recharge_deadline = transaction.campaign.deadline + datetime.timedelta(settings.RECHARGE_WINDOW)
|
||||
|
||||
notification.queue([transaction.user], "pledge_failed", {
|
||||
'site':Site.objects.get_current(),
|
||||
notification.send([transaction.user], "pledge_failed", {
|
||||
'transaction':transaction,
|
||||
'recharge_deadline': recharge_deadline
|
||||
}, True)
|
||||
|
@ -204,8 +200,7 @@ def handle_pledge_modified(sender, transaction=None, up_or_down=None, **kwargs):
|
|||
return
|
||||
if up_or_down == 'canceled':
|
||||
transaction.user.profile.reset_pledge_badge()
|
||||
notification.queue([transaction.user], "pledge_status_change", {
|
||||
'site':Site.objects.get_current(),
|
||||
notification.send([transaction.user], "pledge_status_change", {
|
||||
'transaction': transaction,
|
||||
'up_or_down': up_or_down
|
||||
}, True)
|
||||
|
@ -222,8 +217,7 @@ def handle_you_have_pledged(sender, transaction=None, **kwargs):
|
|||
if not transaction.anonymous:
|
||||
transaction.user.profile.reset_pledge_badge()
|
||||
|
||||
notification.queue([transaction.user], "pledge_you_have_pledged", {
|
||||
'site':Site.objects.get_current(),
|
||||
notification.send([transaction.user], "pledge_you_have_pledged", {
|
||||
'transaction': transaction
|
||||
}, True)
|
||||
from regluit.core.tasks import emit_notifications
|
||||
|
@ -240,8 +234,7 @@ def handle_wishlist_unsuccessful_amazon(campaign, **kwargs):
|
|||
staff = User.objects.filter(is_staff=True)
|
||||
supporters = (User.objects.get(id=k) for k in campaign.supporters())
|
||||
|
||||
site = Site.objects.get_current()
|
||||
notification.queue(itertools.chain(staff, supporters), "wishlist_unsuccessful_amazon", {'campaign':campaign, 'site':site}, True)
|
||||
notification.send(itertools.chain(staff, supporters), "wishlist_unsuccessful_amazon", {'campaign':campaign}, True)
|
||||
from regluit.core.tasks import emit_notifications
|
||||
emit_notifications.delay()
|
||||
|
||||
|
@ -253,10 +246,10 @@ def handle_wishlist_added(supporter, work, **kwargs):
|
|||
"""send notification to confirmed rights holder when someone wishes for their work"""
|
||||
claim = work.claim.filter(status="active")
|
||||
if claim:
|
||||
notification.queue([claim[0].user], "new_wisher", {
|
||||
notification.send([claim[0].user], "new_wisher", {
|
||||
'supporter': supporter,
|
||||
'work': work,
|
||||
'base_url': settings.BASE_URL,
|
||||
'base_url': settings.BASE_URL_SECURE,
|
||||
}, True)
|
||||
|
||||
from regluit.core.tasks import emit_notifications
|
||||
|
@ -274,15 +267,15 @@ def handle_wishlist_near_deadline(campaign, **kwargs):
|
|||
pledgers = campaign.ungluers()['all']
|
||||
nonpledgers = campaign.work.wished_by().exclude(id__in=[p.id for p in pledgers])
|
||||
|
||||
notification.queue(pledgers, "wishlist_near_deadline", {
|
||||
notification.send(pledgers, "wishlist_near_deadline", {
|
||||
'campaign': campaign,
|
||||
'domain': settings.BASE_URL,
|
||||
'domain': settings.BASE_URL_SECURE,
|
||||
'pledged': True,
|
||||
}, True)
|
||||
|
||||
notification.queue(nonpledgers, "wishlist_near_deadline", {
|
||||
notification.send(nonpledgers, "wishlist_near_deadline", {
|
||||
'campaign': campaign,
|
||||
'domain': settings.BASE_URL,
|
||||
'domain': settings.BASE_URL_SECURE,
|
||||
'pledged': False,
|
||||
}, True)
|
||||
|
||||
|
@ -290,3 +283,16 @@ def handle_wishlist_near_deadline(campaign, **kwargs):
|
|||
emit_notifications.delay()
|
||||
|
||||
deadline_impending.connect(handle_wishlist_near_deadline)
|
||||
|
||||
supporter_message = Signal(providing_args=["supporter", "work", "msg"])
|
||||
|
||||
def notify_supporter_message(sender, work, supporter, msg, **kwargs):
|
||||
"""send notification in of supporter message"""
|
||||
logger.info('received supporter_message signal for {0}'.format(supporter))
|
||||
|
||||
site = Site.objects.get_current()
|
||||
notification.send( [supporter], "wishlist_message", {'work':work, 'msg':msg}, True, sender)
|
||||
from regluit.core.tasks import emit_notifications
|
||||
emit_notifications.delay()
|
||||
|
||||
supporter_message.connect(notify_supporter_message)
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
from django.contrib.sitemaps import Sitemap
|
||||
from django.core.urlresolvers import reverse
|
||||
from regluit.core.models import Work, Edition
|
||||
|
||||
class WorkSitemap(Sitemap):
|
||||
protocol = 'https'
|
||||
limit = 10000
|
||||
|
||||
def items(self):
|
||||
return Work.objects.all()
|
||||
|
||||
def priority(self,work):
|
||||
if work.last_campaign():
|
||||
return '1.0'
|
||||
if work.num_wishes>1000:
|
||||
return '0.8'
|
||||
if work.num_wishes>100:
|
||||
return '0.6'
|
||||
if work.num_wishes>10:
|
||||
return '0.4'
|
||||
if work.num_wishes>1:
|
||||
return '0.3'
|
||||
if work.num_wishes==1:
|
||||
return '0.2'
|
||||
if work.num_wishes==0:
|
||||
return '0.1'
|
||||
return '0.1'
|
||||
|
||||
class PublisherSitemap(Sitemap):
|
||||
priority = 0.2
|
||||
protocol = 'https'
|
||||
|
||||
def items(self):
|
||||
return Edition.objects.exclude(publisher__isnull=True).exclude(publisher="").order_by('publisher').values('publisher').distinct()
|
||||
|
||||
def location(self, pub):
|
||||
return reverse("bypub_list",args=[pub['publisher']])
|
|
@ -15,7 +15,7 @@ from django.contrib.sites.models import Site
|
|||
from django.http import Http404
|
||||
|
||||
from regluit.payment.models import Transaction
|
||||
from regluit.core.models import Campaign, Work, UnglueitError, Edition, RightsHolder, Claim, Key, Ebook, Premium
|
||||
from regluit.core.models import Campaign, Work, UnglueitError, Edition, RightsHolder, Claim, Key, Ebook, Premium, Subject
|
||||
from regluit.core import bookloader, models, search, goodreads, librarything
|
||||
from regluit.core import isbn
|
||||
from regluit.payment.parameters import PAYMENT_TYPE_AUTHORIZATION
|
||||
|
@ -112,11 +112,17 @@ class BookLoaderTests(TestCase):
|
|||
|
||||
def test_merge_works_mechanics(self):
|
||||
"""Make sure then merge_works is still okay when we try to merge works with themselves and with deleted works"""
|
||||
sub1= Subject(name='test1')
|
||||
sub1.save()
|
||||
sub2= Subject(name='test2')
|
||||
sub2.save()
|
||||
w1 = Work(title="Work 1")
|
||||
w1.save()
|
||||
w1.subjects.add(sub1)
|
||||
|
||||
w2 = Work(title="Work 2")
|
||||
w2.save()
|
||||
w2.subjects.add(sub1,sub2)
|
||||
|
||||
e1 = Edition(work=w1)
|
||||
e1.save()
|
||||
|
@ -145,7 +151,8 @@ class BookLoaderTests(TestCase):
|
|||
bookloader.merge_works(e1.work, e2.work)
|
||||
self.assertEqual(models.Work.objects.count(),1)
|
||||
self.assertEqual(models.WasWork.objects.count(),1)
|
||||
|
||||
self.assertEqual(w1.subjects.count(),2)
|
||||
|
||||
# getting proper view?
|
||||
anon_client = Client()
|
||||
r = anon_client.get("/work/%s/" % w1_id)
|
||||
|
@ -172,10 +179,10 @@ class BookLoaderTests(TestCase):
|
|||
self.assertEqual(models.Work.objects.count(), 2)
|
||||
|
||||
# add the stub works to a wishlist
|
||||
user = User.objects.create_user('test', 'test@example.com', 'testpass')
|
||||
user = User.objects.create_user('test', 'test@example.org', 'testpass')
|
||||
user.wishlist.add_work(e1.work, 'test')
|
||||
user.wishlist.add_work(e2.work, 'test')
|
||||
manager = User.objects.create_user('manager', 'manager@example.com', 'managerpass')
|
||||
manager = User.objects.create_user('manager', 'manager@example.org', 'managerpass')
|
||||
# create campaigns for the stub works
|
||||
c1 = models.Campaign.objects.create(
|
||||
name=e1.work.title,
|
||||
|
@ -383,7 +390,7 @@ class CampaignTests(TestCase):
|
|||
def test_campaign_status(self):
|
||||
|
||||
# need a user to associate with a transaction
|
||||
user = User.objects.create_user('test', 'test@example.com', 'testpass')
|
||||
user = User.objects.create_user('test', 'test@example.org', 'testpass')
|
||||
|
||||
w = Work()
|
||||
w.save()
|
||||
|
@ -397,7 +404,7 @@ class CampaignTests(TestCase):
|
|||
c2 = Campaign(target=D('1000.00'),deadline=datetime(2013,1,1),work=w)
|
||||
c2.save()
|
||||
self.assertEqual(c2.status, 'INITIALIZED')
|
||||
u = User.objects.create_user('claimer', 'claimer@example.com', 'claimer')
|
||||
u = User.objects.create_user('claimer', 'claimer@example.org', 'claimer')
|
||||
u.save()
|
||||
rh = RightsHolder(owner = u, rights_holder_name = 'rights holder name')
|
||||
rh.save()
|
||||
|
@ -479,7 +486,7 @@ class WishlistTest(TestCase):
|
|||
|
||||
def test_add_remove(self):
|
||||
# add a work to a user's wishlist
|
||||
user = User.objects.create_user('test', 'test@example.com', 'testpass')
|
||||
user = User.objects.create_user('test', 'test@example.org', 'testpass')
|
||||
edition = bookloader.add_by_isbn('0441007465')
|
||||
work = edition.work
|
||||
num_wishes=work.num_wishes
|
||||
|
@ -636,7 +643,7 @@ class DownloadPageTest(TestCase):
|
|||
e2.save()
|
||||
|
||||
eb1 = models.Ebook()
|
||||
eb1.url = "http://example.com"
|
||||
eb1.url = "http://example.org"
|
||||
eb1.edition = e1
|
||||
eb1.format = 'epub'
|
||||
|
||||
|
@ -650,7 +657,7 @@ class DownloadPageTest(TestCase):
|
|||
|
||||
anon_client = Client()
|
||||
response = anon_client.get("/work/%s/download/" % w.id)
|
||||
self.assertContains(response, "http://example.com", count=4)
|
||||
self.assertContains(response, "http://example.org", count=4)
|
||||
self.assertContains(response, "http://example2.com", count=3)
|
||||
|
||||
|
||||
|
@ -693,5 +700,14 @@ class LocaldatetimeTest(TestCase):
|
|||
else:
|
||||
reload(localdatetime)
|
||||
|
||||
class MailingListTests(TestCase):
|
||||
#mostly to check that MailChimp account is setp correctly
|
||||
|
||||
|
||||
def test_mailchimp(self):
|
||||
from postmonkey import PostMonkey
|
||||
pm = PostMonkey(settings.MAILCHIMP_API_KEY)
|
||||
self.assertEqual(pm.ping(),"Everything's Chimpy!" )
|
||||
self.user = User.objects.create_user('chimp_test', 'eric@gluejar.com', 'chimp_test')
|
||||
self.assertTrue(self.user.profile.on_ml)
|
||||
|
||||
|
||||
|
|
|
@ -444,3 +444,23 @@ class FeedbackForm(forms.Form):
|
|||
raise forms.ValidationError(_("Whoops, try that sum again."))
|
||||
|
||||
return cleaned_data
|
||||
|
||||
class MsgForm(forms.Form):
|
||||
msg = forms.CharField(widget=forms.Textarea(), error_messages={'required': 'Please specify a message.'})
|
||||
|
||||
def full_clean(self):
|
||||
super(MsgForm,self).full_clean()
|
||||
if self.data.has_key("supporter"):
|
||||
try:
|
||||
self.cleaned_data['supporter'] = User.objects.get(id=self.data["supporter"])
|
||||
except User.DoesNotExist:
|
||||
raise ValidationError("Supporter does not exist")
|
||||
else:
|
||||
raise ValidationError("Supporter is not specified")
|
||||
if self.data.has_key("work"):
|
||||
try:
|
||||
self.cleaned_data['work'] = Work.objects.get(id=self.data["work"])
|
||||
except Work.DoesNotExist:
|
||||
raise ValidationError("Work does not exist")
|
||||
else:
|
||||
raise ValidationError("Work is not specified")
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{% block title %} Everything You Always Wanted to Know {% endblock %}
|
||||
{% block doccontent %}
|
||||
<h2>About</h2>
|
||||
<p><a href="http://unglue.it">Unglue.it</a> is a service provided by <a href="http://gluejar.com">Gluejar, Inc.</a> It's a place for individuals and institutions to join together to liberate specific ebooks and other types of digital content by paying rights holders to relicense their works under <a href="http://creativecommons.org">Creative Commons</a> licenses.</p>
|
||||
<p><a href="https://unglue.it">Unglue.it</a> is a service provided by <a href="http://gluejar.com">Gluejar, Inc.</a> It's a place for individuals and institutions to join together to liberate specific ebooks and other types of digital content by paying rights holders to relicense their works under <a href="http://creativecommons.org">Creative Commons</a> licenses.</p>
|
||||
|
||||
<p>What does this mean?</p>
|
||||
<ul>
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
{% extends "work_list.html" %}
|
||||
{% load endless %}
|
||||
{% load lang_utils %}
|
||||
|
||||
{% block title %} Works published by {{ pubname }} {% endblock %}
|
||||
{% block userblock2 %}
|
||||
<span class="special-user-name">Books from {{ pubname }} {% if pub_lang %}( {{pub_lang|ez_lang_name}} ) {% endif %}</span>
|
||||
{% endblock %}
|
|
@ -1,16 +1,20 @@
|
|||
<div id="comments">
|
||||
{% for comment in comment_list reversed %}
|
||||
|
||||
<div class="work_supporter {% if comment.content_object.last_campaign and comment.user in comment.content_object.last_campaign.managers.all %}official{% endif %}">
|
||||
<a href="{% url supporter supporter_username=comment.user.username %}">
|
||||
<div class="work_supporter_avatar">
|
||||
{% if comment.user.profile.pic_url %}
|
||||
<img class="user-avatar" src="{{ comment.user.profile.pic_url }}" height="50" width="50" alt="Picture of {{ comment.user }}" title="{{ comment.user }}" />
|
||||
{% else %}
|
||||
<img class="user-avatar" src="/static/images/header/avatar.png" height="50" width="50" alt="Generic Ungluer Avatar" title="Ungluer" />
|
||||
<div itemprop="comment" itemscope itemtype="http://schema.org/UserComments" class="work_supporter {% if comment.content_object.last_campaign and comment.user in comment.content_object.last_campaign.managers.all %}official{% endif %}">
|
||||
<span itemprop="creator" itemscope itemtype="http://schema.org/Person">
|
||||
<a itemprop="url" href="{% url supporter supporter_username=comment.user.username %}">
|
||||
<span class="work_supporter_avatar">
|
||||
{% if comment.user.profile.pic_url %}
|
||||
<img class="user-avatar" src="{{ comment.user.profile.pic_url }}" height="50" width="50" alt="Picture of {{ comment.user }}" title="{{ comment.user }}" />
|
||||
{% else %}
|
||||
<img class="user-avatar" src="/static/images/header/avatar.png" height="50" width="50" alt="Generic Ungluer Avatar" title="Ungluer" />
|
||||
{% endif %}
|
||||
</div>
|
||||
<span class="comment_username">{{comment.user.username }}</span></a> <span>({{ comment.submit_date }})</span> <br /><span class="comment">{{ comment.comment|linebreaksbr }}<br /></span>
|
||||
</span>
|
||||
<span class="comment_username">{{comment.user.username }}</span>
|
||||
</a>
|
||||
</span>
|
||||
<span itemprop="commentTime">({{ comment.submit_date }})</span> <br /><span class="comment" itemProp="commentText">{{ comment.comment|linebreaksbr }}<br /></span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
|
|
@ -21,13 +21,13 @@
|
|||
<h1>{% trans "Preview your comment" %}</h1>
|
||||
<div class="work_supporter {% if content_object.last_campaign and user in content_object.last_campaign.managers.all %}official{% endif %}">
|
||||
<a href="{% url supporter supporter_username=user.username %}">
|
||||
<div class="work_supporter_avatar">
|
||||
<span class="work_supporter_avatar">
|
||||
{% if user.profile.pic_url %}
|
||||
<img class="user-avatar" src="{{ user.profile.pic_url }}" height="50" width="50" alt="Picture of {{ user }}" title="{{ user }}" />
|
||||
{% else %}
|
||||
<img class="user-avatar" src="/static/images/header/avatar.png" height="50" width="50" alt="Generic Ungluer Avatar" title="Ungluer" />
|
||||
{% endif %}
|
||||
</div>
|
||||
</span>
|
||||
<span class="comment_username">{{user.username }}</span></a> <span>( [today's date] )</span> <br /><span class="comment">{{ comment|linebreaksbr }}<br /></span>
|
||||
</div>
|
||||
<br /><br /><br />
|
||||
|
|
|
@ -20,6 +20,15 @@
|
|||
<li><a href="{% url work_list 'new' %}"><span>Newly Wished</span></a></li>
|
||||
<li><a href="{% url work_list 'recommended' %}"><span>Noteworthy</span></a></li>
|
||||
<li class="last"><a href="{% url unglued_list '' %}"><span>Ready to Read</span></a></li>
|
||||
{% if pubname %}
|
||||
<li>{{ pubname }}...
|
||||
<ul class="menu level3">
|
||||
<li class="first"><a href="{% url bypub_list 'popular' pubname %}"><span>Most popular</span></a></li>
|
||||
<li><a href="{% url bypub_list pubname %}"><span>By Title</span></a></li>
|
||||
<li><a href="{% url bypub_list 'pubdate' pubname %}"><span>By Date Published</span></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</li>
|
||||
{% if show_langs %}
|
||||
|
|
|
@ -140,7 +140,7 @@ $j(document).ready(function() {
|
|||
</div>
|
||||
<div class="form-row clearfix cvc">
|
||||
<label>CVC:</label>
|
||||
<input id="card_CVC" type="text" size="4" autocomplete="off" class="card-cvc" /> <span id="cvc_help">(what is this?)</span>
|
||||
<input id="card_CVC" type="password" size="4" autocomplete="off" class="card-cvc" /> <span id="cvc_help">(what is this?)</span>
|
||||
<div id="cvc_answer"><img src="/static/images/cvcimage.jpeg" alt="a typical credit card with CVC">For most cards, this is a 3-digit number at the end of the signature strip on the back. For American Express, it's a four-digit number in small print on the front.</div>
|
||||
</div>
|
||||
<div class="form-row clearfix initial_values">
|
||||
|
|
|
@ -108,6 +108,7 @@ $j(document).ready(function(){
|
|||
<ul>
|
||||
<li>Want to <a href="{% url auth_password_change %}">change your password</a>?</li>
|
||||
<li>Want to <a href="/accounts/edit/">change your username or email address</a>?</li>
|
||||
<li>Want to <a href="{% url notification_notice_settings %}">manage your contact preferences</a>?</li>
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
{% if request.user.profile.on_ml %}
|
||||
You are subscribed to the Unglue.it Newsletter. It comes roughly twice a month. <br />
|
||||
<form id="ml_unsubscribe" action="{% url ml_unsubscribe %}" method="POST">
|
||||
{% csrf_token %}
|
||||
<input type="submit" name="ml_unsubscribe" value="Unsubscribe" />
|
||||
</form>
|
||||
{% else %}
|
||||
You are NOT subscribed to the Unglue.it Newsletter. It comes roughly twice a month. If you have just become an ungluer, your list invitation should be on its way. Put "gluenews@gluejar.com" in your contact list to make sure you get it.<br />
|
||||
<form id="ml_subscribe" action="{% url ml_subscribe %}" method="POST">
|
||||
{% csrf_token %}
|
||||
<input type="submit" name="ml_subscribe" value="Subscribe" />
|
||||
</form>
|
||||
{% endif %}
|
|
@ -2,6 +2,6 @@
|
|||
|
||||
{{ comment.comment }}
|
||||
|
||||
You can see all comments on this book at https://{{ domain }}{% url work comment.content_object.id %}?tab=2 .
|
||||
You can see all comments on this book at https://{{ current_site.domain }}{% url work comment.content_object.id %}?tab=2 .
|
||||
|
||||
The Unglue.it team
|
|
@ -8,6 +8,18 @@
|
|||
<link type="text/css" rel="stylesheet" href="/static/css/notices.css" />
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_js %}
|
||||
|
||||
<script type="text/javascript" src="/static/js/definitions.js"></script>
|
||||
<script>
|
||||
$j(document).ready(function() {
|
||||
jQuery.post("/ml/status/", function(data){
|
||||
$j("#mailing_list").html(data);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% block doccontent %}
|
||||
<h2>{% trans "Notification Settings" %}</h2>
|
||||
|
||||
|
@ -126,8 +138,9 @@
|
|||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
<h3>Your mailing list subscription</h3>
|
||||
<div id="mailing_list"></div>
|
||||
<h3>Your email</h3>
|
||||
{% if user.email %}
|
||||
<p>
|
||||
|
|
|
@ -8,7 +8,7 @@ Pledge summary
|
|||
We will notify you when the unglued ebook is available for you to read. If you've requested special premiums, the rights holder, {{ transaction.campaign.rightsholder }}, will be in touch with you via email to request any information needed to deliver your premium.
|
||||
|
||||
If you'd like to visit the campaign page, click here:
|
||||
https://{{ site.domain }}{% url work transaction.campaign.work.id %}
|
||||
https://{{ current_site.domain }}{% url work transaction.campaign.work.id %}
|
||||
|
||||
Thank you again for your support.
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
{% load humanize %}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 in the amount of ${{ transaction.amount|intcomma }} failed ({{transaction.error}}). 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://{{ site.domain }}{% url manage_account %} by {{ recharge_deadline }} so that you can fulfill your pledge. Thank you!
|
||||
https://{{ current_site.domain }}{% url manage_account %} by {{ recharge_deadline }} so that you can fulfill your pledge. Thank you!
|
||||
|
||||
Pledge summary
|
||||
{% include "notification/pledge_summary.txt" %}
|
||||
|
||||
If you'd like to visit the campaign page, click here:
|
||||
https://{{ site.domain }}{% url work transaction.campaign.work.id %}
|
||||
https://{{ current_site.domain }}{% url work transaction.campaign.work.id %}
|
||||
|
||||
Thank you again for your support.
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
However, our attempt to charge your credit card for ${{ transaction.amount|intcomma }} failed.</p>
|
||||
|
||||
<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
|
||||
https://{{ site.domain }}{% url manage_account %} by {{ recharge_deadline }} so that you can fulfill your pledge. Thank you!</p>
|
||||
https://{{ current_site.domain }}{% url manage_account %} 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 />
|
||||
|
|
|
@ -11,7 +11,7 @@ Your new pledge summary
|
|||
{% endif %}
|
||||
|
||||
If you'd like to visit the campaign page or make changes, click here:
|
||||
https://{{site.domain}}{% url work transaction.campaign.work.id %}
|
||||
https://{{current_site.domain}}{% url work transaction.campaign.work.id %}
|
||||
|
||||
Thank you again for your support.
|
||||
|
||||
|
|
|
@ -9,5 +9,5 @@ You will also be acknowledged as follows:
|
|||
- You will be listed in the ebook as a Bibliophile using the name "{{ transaction.ack_name }}" with a link to your Unglue.it supporter page.{% endifequal %}{% endif %}{% ifequal transaction.tier 3 %}{% if transaction.ack_dedication %}
|
||||
- The following dedication will be included in the ebook:
|
||||
{{ transaction.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://{{ site.domain }}{% url pledge_modify work_id=transaction.campaign.work.id %}.
|
||||
- You were eligible to include a dedication in the unglued ebook, but did not choose to do so. If you like, you can change this at https://{{ current_site.domain }}{% url pledge_modify work_id=transaction.campaign.work.id %}.
|
||||
{% endif %}{% endifequal %}
|
||||
|
|
|
@ -6,16 +6,16 @@ Pledge summary
|
|||
|
||||
You can help even more by sharing this campaign with your friends.
|
||||
|
||||
Facebook: https://www.facebook.com/sharer.php?u=https://{{ site.domain }}{% url work transaction.campaign.work.id %}
|
||||
Facebook: https://www.facebook.com/sharer.php?u=https://{{ current_site.domain }}{% url work transaction.campaign.work.id %}
|
||||
|
||||
Twitter: https://twitter.com/intent/tweet?url=https://{{ site.domain }}{% url work transaction.campaign.work.id %}&text=I%27m%20ungluing%20{{ title|urlencode }}%20at%20%40unglueit.%20Join%20me%21"
|
||||
Twitter: https://twitter.com/intent/tweet?url=https://{{ current_site.domain }}{% url work transaction.campaign.work.id %}&text=I%27m%20ungluing%20{{ title|urlencode }}%20at%20%40unglueit.%20Join%20me%21"
|
||||
|
||||
You can also embed a widget for {{ transaction.campaign.work.title }} in your web site by copy/pasting the following:
|
||||
<iframe src="https://{{ site.domain }}/api/widget/{{ transaction.campaign.work.first_isbn_13 }}/" width="152" height="325" frameborder="0"></iframe>
|
||||
<iframe src="https://{{ current_site.domain }}/api/widget/{{ transaction.campaign.work.first_isbn_13 }}/" width="152" height="325" frameborder="0"></iframe>
|
||||
|
||||
Or the best idea: talk about it with those you love. We'll need lots of help from lots of people to make this a success.
|
||||
|
||||
If you want to change your pledge, just use the button at https://{{ site.domain }}{% url work transaction.campaign.work.id %}
|
||||
If you want to change your pledge, just use the button at https://{{ current_site.domain }}{% url work transaction.campaign.work.id %}
|
||||
|
||||
If you have any problems with your pledge, don't hesitate to contact us at support@gluejar.com
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
Congratulations! Your claim to {{ claim.work }} on Unglue.it has been approved.
|
||||
|
||||
You are now free to run a campaign to unglue your work. If you're logged in, you will see the option to open a campaign at https://{{ site.domain }}/rightsholders . (You can also find this page by clicking on "Rights Holder Tools" at the bottom of any Unglue.it page.)
|
||||
You are now free to run a campaign to unglue your work. If you're logged in, you will see the option to open a campaign at https://{{ current_site.domain }}/rightsholders . (You can also find this page by clicking on "Rights Holder Tools" at the bottom of any Unglue.it page.)
|
||||
|
||||
To run a campaign, you'll need to select a target price and a deadline. You'll also need to write a pitch. This will appear in the Description tab on your book's page (https://{{ site.domain }}{% url work claim.work.id %}). Think about who your book's audience is, and remind them why they love this book -- your pitch is not a catalog page! We encourage video, audio, and links to make your pitch come alive. Feel free to email us (rights@gluejar.com) if you need any help with this.
|
||||
To run a campaign, you'll need to select a target price and a deadline. You'll also need to write a pitch. This will appear in the Description tab on your book's page (https://{{ current_site.domain }}{% url work claim.work.id %}). Think about who your book's audience is, and remind them why they love this book -- your pitch is not a catalog page! We encourage video, audio, and links to make your pitch come alive. Feel free to email us (rights@gluejar.com) if you need any help with this.
|
||||
|
||||
You should also come up with some custom premiums to reward ungluers for supporting your book. Again, we can help you if you need ideas for what these should be or how to price them.
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<ul>
|
||||
<a href="{% url emailshare 'pledge' %}?next={{ work_url|urlencode:"" }}"><li>Email it!</li></a>
|
||||
<a href="https://twitter.com/intent/tweet?url=https://{{ site.domain }}{{ work_url|urlencode:"" }}&text=I%20just%20pledged%20to%20unglue%20{{ title|urlencode }}%20at%20%40unglueit.%20Will%20you%20join%20me%3F"><li>Tweet it!</li></a>
|
||||
<a href="https://www.facebook.com/sharer.php?u=https://{{ site.domain }}{{ work_url|urlencode:"" }}"><li>Share it on Facebook.</li></a>
|
||||
<a href="https://twitter.com/intent/tweet?url=https://{{ current_site.domain }}{{ work_url|urlencode:"" }}&text=I%20just%20pledged%20to%20unglue%20{{ title|urlencode }}%20at%20%40unglueit.%20Will%20you%20join%20me%3F"><li>Tweet it!</li></a>
|
||||
<a href="https://www.facebook.com/sharer.php?u=https://{{ current_site.domain }}{{ work_url|urlencode:"" }}"><li>Share it on Facebook.</li></a>
|
||||
<li>Best idea: talk about it with those you love.</li>
|
||||
</ul>
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
You can help!
|
||||
|
||||
Pledge toward ungluing. https://{{ site.domain }}{% url pledge work_id=campaign.work.id %}
|
||||
Pledge toward ungluing. https://{{ current_site.domain }}{% url pledge work_id=campaign.work.id %}
|
||||
|
||||
Tell your friends -- there are handy share options on the campaign page. There's even a widget you can put on your blog or home page. https://{{ site.domain }}{% url work campaign.work.id %}
|
||||
Tell your friends -- there are handy share options on the campaign page. There's even a widget you can put on your blog or home page. https://{{ current_site.domain }}{% url work campaign.work.id %}
|
||||
|
||||
Join the discussion: share why you love {{ campaign.work.title }} and the world will too. https://{{ site.domain }}{% url work campaign.work.id %}?tab=2
|
||||
Join the discussion: share why you love {{ campaign.work.title }} and the world will too. https://{{ current_site.domain }}{% url work campaign.work.id %}?tab=2
|
||||
|
||||
Thank you!
|
||||
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
|
||||
{{ comment.comment }}
|
||||
|
||||
You can see all comments on this book at https://{{ domain }}{% url work comment.content_object.id %}?tab=2 .
|
||||
You can see all comments on this book at https://{{ current_site.domain }}{% url work comment.content_object.id %}?tab=2 .
|
||||
|
||||
The Unglue.it team
|
|
@ -1,7 +1,8 @@
|
|||
Message! About {{ campaign.work.title}}
|
||||
(http://{{site.domain}}{% url work campaign.work.id %}?tab=2) something.
|
||||
You will something.
|
||||
Message from {{ sender.username }} {% if sender.is_staff %} (Unglue.it staff) {% endif %} about {{ work.title }}, on your Unglue.it wishlist.
|
||||
|
||||
You will be also something.
|
||||
{{ msg }}
|
||||
|
||||
Find out about {{ work.title }} at https://{{ current_site.domain }}{% url work work.id %}
|
||||
{{ sender.username }}'s Unglue.it user page is at https://{{ current_site.domain }}{% url supporter sender %}
|
||||
|
||||
Give ebooks to the world; give income to authors and publishers. Unglue.it.
|
|
@ -1,5 +1,19 @@
|
|||
{% extends "notification/notice_template.html" %}
|
||||
|
||||
{% comment %}
|
||||
Should possibly say something.
|
||||
{% endcomment %}
|
||||
{% block comments_book %}
|
||||
<a href="{% url work work.id %}">
|
||||
<img src="{{ work.cover_image_small }}" alt="cover image for {{ work.title }}" />
|
||||
</a>
|
||||
{% endblock %}
|
||||
{% block comments_graphical %}
|
||||
<a href="{% url supporter sender %}">
|
||||
{% if sender.profile.pic_url %}
|
||||
<img class="user-avatar" src="{{ sender.profile.pic_url }}" height="50" width="50" alt="Picture of {{ sender }}" title="{{ sender }}" />
|
||||
{% else %}
|
||||
<img class="user-avatar" src="/static/images/header/avatar.png" height="50" width="50" alt="Generic Ungluer Avatar" title="Ungluer" />
|
||||
{% endif %}
|
||||
</a>
|
||||
<span>Message from <a href="{% url supporter sender %}">{{ sender.username }}</a> {% if sender.is_staff %} (Unglue.it staff) {% endif %} on <a href="{% url work work.id %}">{{ work.title }}</a></span>
|
||||
{% endblock %}
|
||||
{% block comments_textual %}
|
||||
{{ msg }}
|
||||
{% endblock %}
|
||||
|
|
|
@ -1 +1 @@
|
|||
blurb for {{campaign.work.title}}
|
||||
Message from {{ sender }} about {{work.title}}, on your Unglue.it wishlist
|
|
@ -1,11 +1,11 @@
|
|||
{% load humanize %}The campaign to unglue a book you've wishlisted, {{ campaign.work.title}}, is close to succeeding! We only need to raise ${{ campaign.left|intcomma }} more by {{ campaign.deadline }} in order to give this book to the world.
|
||||
|
||||
{% if pledged %}
|
||||
Your pledge of {{ amount|intcomma }} is helping {{ campaign.work.title }} to reach its goal, but we can only unglue this book if the campaign succeeds. You can tip the balance by sharing the campaign (https://{{ site.domain }}{% url work work_id=campaign.work.id %}) with your friends through your favorite media: tweet, Facebook, Tumblr, blog, G+, Pinterest, email, carrier pigeon, or good old-fashioned conversation.
|
||||
Your pledge of {{ amount|intcomma }} is helping {{ campaign.work.title }} to reach its goal, but we can only unglue this book if the campaign succeeds. You can tip the balance by sharing the campaign (https://{{ current_site.domain }}{% url work work_id=campaign.work.id %}) with your friends through your favorite media: tweet, Facebook, Tumblr, blog, G+, Pinterest, email, carrier pigeon, or good old-fashioned conversation.
|
||||
{% else %}
|
||||
We need your pledge to reach this target. Any amount helps. You can chip in towards giving this book to the world at https://{{ site.domain }}{% url pledge work_id=campaign.work.id %} .
|
||||
We need your pledge to reach this target. Any amount helps. You can chip in towards giving this book to the world at https://{{ current_site.domain }}{% url pledge work_id=campaign.work.id %} .
|
||||
|
||||
You can also help by sharing the campaign (https://{{ site.domain }}{% url work work_id=campaign.work.id %}) with your friends through your favorite media: tweet, Facebook, Tumblr, blog, G+, Pinterest, email, carrier pigeon, or good old-fashioned conversation.
|
||||
You can also help by sharing the campaign (https://{{ current_site.domain }}{% url work work_id=campaign.work.id %}) with your friends through your favorite media: tweet, Facebook, Tumblr, blog, G+, Pinterest, email, carrier pigeon, or good old-fashioned conversation.
|
||||
{% endif %}
|
||||
|
||||
Thank you!
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
Premium: {{ premium.description }}
|
||||
Minimum pledge: {{ premium.amount|intcomma }}
|
||||
|
||||
If you'd like to claim the last one, pledge here: https://{{ site.domain }}{% url pledge work_id=campaign.work.id %}
|
||||
If you'd like to claim the last one, pledge here: https://{{ current_site.domain }}{% url pledge work_id=campaign.work.id %}
|
||||
|
||||
{{ campaign.rightsholder }} (rights holder for {{ campaign.work.title }}) and the Unglue.it team
|
|
@ -15,5 +15,5 @@
|
|||
Premium: {{ premium.description }}
|
||||
Minimum pledge: {{ premium.amount|intcomma }}
|
||||
|
||||
If you'd like to claim the last one, pledge here: https://{{ site.domain }}{% url pledge work_id=campaign.work.id %}
|
||||
If you'd like to claim the last one, pledge here: https://{{ current_site.domain }}{% url pledge work_id=campaign.work.id %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{% load humanize %}Good news! The rights holder, {{ campaign.rightsholder }}, has lowered the target price to ${{ campaign.target|intcomma }} for {{ campaign.work.title }}. Now we only need to raise ${{ campaign.left|intcomma }} by {{ campaign.deadline }} in order to give this book to the world.
|
||||
|
||||
{% if pledged %}
|
||||
Your pledge of {{ amount|intcomma }} is now going even farther toward helping {{ campaign.work.title }} to reach its goal. Still, we can only unglue this book if the campaign succeeds. You can help by sharing the campaign (https://{{ site.domain }}{% url work work_id=campaign.work.id %}) with your friends through your favorite media: tweet, Facebook, Tumblr, blog, G+, Pinterest, email, carrier pigeon, or good old-fashioned conversation.
|
||||
Your pledge of {{ amount|intcomma }} is now going even farther toward helping {{ campaign.work.title }} to reach its goal. Still, we can only unglue this book if the campaign succeeds. You can help by sharing the campaign (https://{{ current_site.domain }}{% url work work_id=campaign.work.id %}) with your friends through your favorite media: tweet, Facebook, Tumblr, blog, G+, Pinterest, email, carrier pigeon, or good old-fashioned conversation.
|
||||
{% else %}
|
||||
The target may be lower, but we still need your help to reach it. Pledges of any amount help. You can chip in towards giving this book to the world at https://{{ site.domain }}{% url pledge work_id=campaign.work.id %} .
|
||||
The target may be lower, but we still need your help to reach it. Pledges of any amount help. You can chip in towards giving this book to the world at https://{{ current_site.domain }}{% url pledge work_id=campaign.work.id %} .
|
||||
|
||||
You can also help by sharing the campaign (https://{{ site.domain }}{% url work work_id=campaign.work.id %}) with your friends through your favorite media: tweet, Facebook, Tumblr, blog, G+, Pinterest, email, carrier pigeon, or good old-fashioned conversation.
|
||||
You can also help by sharing the campaign (https://{{ current_site.domain }}{% url work work_id=campaign.work.id %}) with your friends through your favorite media: tweet, Facebook, Tumblr, blog, G+, Pinterest, email, carrier pigeon, or good old-fashioned conversation.
|
||||
{% endif %}
|
||||
|
||||
Thank you!
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
{% if pledged %}
|
||||
Your pledge of {{ amount|intcomma }} is now going even farther toward helping {{ campaign.work.title }} to reach its goal. Still, we can only unglue this book if the campaign succeeds. You can help again by sharing this campaign:
|
||||
{% else %}
|
||||
The target may be lower, but we still need your help to reach it. Pledges of any amount help. You can chip in towards giving this book to the world at https://{{ site.domain }}{% url pledge campaign.work.id %} . You can also help by sharing this campaign:
|
||||
The target may be lower, but we still need your help to reach it. Pledges of any amount help. You can chip in towards giving this book to the world at https://{{ current_site.domain }}{% url pledge campaign.work.id %} . You can also help by sharing this campaign:
|
||||
{% endif %}
|
||||
|
||||
{% url work campaign.work.id as work_url %}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{% if pledged %}Congratulations! You pledged toward{% else %}Hooray! You wished for{% endif %} it, and now the campaign
|
||||
for {{ campaign.work.title}} (https://{{site.domain}}{% url work campaign.work.id %}) has succeeded.
|
||||
for {{ campaign.work.title}} (https://{{current_site.domain}}{% url work campaign.work.id %}) has succeeded.
|
||||
|
||||
You will notified when an Unglued ebook edition is available, within 90 days.
|
||||
{% if pledged %}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Alas. The campaign to unglue {{ campaign.work.title }} (https://{{site.domain}}{% url work campaign.work.id %}) has not succeeded.
|
||||
Alas. The campaign to unglue {{ campaign.work.title }} (https://{{current_site.domain}}{% url work campaign.work.id %}) has not succeeded.
|
||||
|
||||
If you pledged toward this work, your pledge will expire shortly and your credit card will not be charged, nor will you receive any premiums.
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Amazon Payments has informed us that they will no longer process pledge payments for new crowdfunding companies, including Unglue.it. Therefore the campaign to unglue {{ campaign.work.title }} (https://{{site.domain}}{% url work campaign.work.id %}) has been closed.
|
||||
Amazon Payments has informed us that they will no longer process pledge payments for new crowdfunding companies, including Unglue.it. Therefore the campaign to unglue {{ campaign.work.title }} (https://{{current_site.domain}}{% url work campaign.work.id %}) has been closed.
|
||||
|
||||
If you pledged toward this work, your pledge will expire shortly and your credit card will not be charged, nor will you receive any premiums.
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
There's new information about a work on your wishlist! {{ campaign.rightsholder }}, the rights holder for {{ campaign.work.title}}, has updated the campaign. See the details at https://{{site.domain}}{% url work campaign.work.id %}.
|
||||
There's new information about a work on your wishlist! {{ campaign.rightsholder }}, the rights holder for {{ campaign.work.title}}, has updated the campaign. See the details at https://{{current_site.domain}}{% url work campaign.work.id %}.
|
||||
|
||||
{{ campaign.rightsholder }} and the Unglue.it team
|
|
@ -2,7 +2,7 @@ Hooray! A rights holder, {{ rightsholder }}, has claimed {{ claim.work.title }}
|
|||
|
||||
What does this mean for you? Rights holders are the people who are legally authorized to license works. This means they're the only people who can run campaigns on Unglue.it.
|
||||
|
||||
{{ rightsholder }} may be running a campaign soon, or later, but isn't obligated to. Want to make that campaign happen? Leave a comment (https://{{site.domain}}{% url work campaign.work.id %}?tab=2) and tell your friends: make sure {{ rightsholder }} knows how much you want to give this book to the world.
|
||||
{{ rightsholder }} may be running a campaign soon, or later, but isn't obligated to. Want to make that campaign happen? Leave a comment (https://{{current_site.domain}}{% url work campaign.work.id %}?tab=2) and tell your friends: make sure {{ rightsholder }} knows how much you want to give this book to the world.
|
||||
|
||||
Thanks for your help!
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
{% block comments_textual %}
|
||||
What does this mean for you? Rights holders are the people who are legally authorized to license works. This means they're the only people who can run campaigns on Unglue.it.
|
||||
|
||||
{{ rightsholder }} may be running a campaign soon, or later, but isn't obligated to. Want to make that campaign happen? <a href="https://{{site.domain}}{% url work claim.work.id %}?tab=2">Leave a comment</a> and tell your friends:
|
||||
{{ rightsholder }} may be running a campaign soon, or later, but isn't obligated to. Want to make that campaign happen? <a href="https://{{current_site.domain}}{% url work claim.work.id %}?tab=2">Leave a comment</a> and tell your friends:
|
||||
|
||||
{% url work claim.work.id as work_url %}
|
||||
{% include "notification/sharing_block.html" %}
|
||||
|
|
|
@ -31,21 +31,31 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="jsmodule rounded pledge">
|
||||
<div class="jsmod-content">
|
||||
${{ work.last_campaign.target|floatformat:0|intcomma }} needed by<br />
|
||||
{{ work.last_campaign.deadline }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pledged-info">
|
||||
<div class="pledged-group">
|
||||
{{ work.last_campaign.supporters_count }} Ungluers have pledged ${{ work.last_campaign.current_total|intcomma }}
|
||||
</div>
|
||||
<div class="status">
|
||||
<img src="/static/images/images/icon-book-37by25-{{ work.percent_unglued }}.png" title="book list status" alt="book list status" />
|
||||
</div>
|
||||
<div>
|
||||
<div class="thermometer">
|
||||
<div class="cover" style="width: {{ cover_width }}%;">
|
||||
</div>
|
||||
<span>{{ work.percent_of_goal }}% of goal</span>
|
||||
</div>
|
||||
<div class="pledged-info noborder">
|
||||
<div class="campaign-status-info">
|
||||
<span>${{ work.last_campaign.current_total|floatformat:0|intcomma }}</span> pledged
|
||||
</div>
|
||||
<div class="campaign-status-info">
|
||||
<span>${{ work.last_campaign.target|floatformat:0|intcomma }}</span> goal
|
||||
</div>
|
||||
<div class="campaign-status-info">
|
||||
{% if work.last_campaign.supporters_count == 1 %}
|
||||
<span>1</span> ungluer
|
||||
{% else %}
|
||||
<span> {{ work.last_campaign.supporters_count }}</span> ungluers
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="campaign-status-info">
|
||||
<span>{{ work.last_campaign.countdown }}</span> to go
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
{% extends "work_list.html" %}
|
||||
{% load endless %}
|
||||
{% load lang_utils %}
|
||||
|
||||
{% block title %} Works published by {{ pubname }} {% endblock %}
|
||||
{% block noworks %}
|
||||
Check back soon to see what we're recommending.
|
||||
{% endblock %}
|
||||
|
||||
{% block userblock %}
|
||||
<div id="user-block1">
|
||||
<div id="block-intro-text"><span class="special-user-name">Staff Picks</span></div>
|
||||
</div>
|
||||
<div class="user-block2"><span class="user-short-info">Here are the {% if pub_lang %}{{pub_lang|ez_lang_name}} language {% endif %}books <a href="{% url supporter 'AmandaM' %}">Amanda</a>, <a href="{% url supporter 'andromeda' %}">Andromeda</a>, <a href="{% url supporter 'eric' %}">Eric</a>, and <a href="{% url supporter 'rdhyee' %}">Raymond</a> are loving lately.</span>
|
||||
</div>
|
||||
<div class="user-block3 recommended">
|
||||
<a href="{% url supporter 'AmandaM' %}"><img class="user-avatar" src="https://si0.twimg.com/profile_images/1801686082/image_normal.jpg" height="50" width="50" alt="Picture of Amanda" title="Amanda" /></a>
|
||||
<a href="{% url supporter 'andromeda' %}"><img class="user-avatar" src="https://si0.twimg.com/profile_images/611713549/andromeda_by_molly_color_normal.jpg" height="50" width="50" alt="Picture of Andromeda" title="Andromeda" /></a>
|
||||
<a href="{% url supporter 'eric' %}"><img class="user-avatar" src="https://graph.facebook.com/1009077800/picture" height="50" width="50" alt="Picture of Eric" title="Eric" /></a>
|
||||
<a href="{% url supporter 'RaymondYee' %}"><img class="user-avatar" src="https://graph.facebook.com/1229336/picture" height="50" width="50" alt="Picture of Raymond" title="Raymond" /></a>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -3,7 +3,7 @@
|
|||
{% block doccontent %}
|
||||
{% if not user.is_authenticated %}
|
||||
|
||||
An activation email has been sent. Please check your email and click on the link to activate your account.
|
||||
An account activation email has been sent. Please check your email and click on the link to activate your account. We're also sending you an invitation to our email newsletter. It comes out about twice a month. Put "gluenews@gluejar.com" in your contact list to make sure you get it.
|
||||
{% else %}
|
||||
<div>
|
||||
You are logged in as <a href="{% url supporter supporter_username=request.user.username %}">{{ request.user.username }}</a>.
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
</div>
|
||||
<br />
|
||||
<div class="welcomealternatives">
|
||||
Or you can <a href="{{editurl}}">change your username</a> — <a href="{% url work_list 'popular' %}">see the most wishlisted books</a> — <a href="/feedback/">send us feedback</a>
|
||||
Or you can <a href="{{editurl}}">change your username</a> — <a href="{% url work_list 'popular' %}">see the most wishlisted books</a> — <a href="/feedback/">send us feedback</a> — <a href="{% url notification_notice_settings %}">manage your contact preferences</a>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -52,6 +52,8 @@ function stripeResponseHandler(status, response) {
|
|||
if (response.error) {
|
||||
// re-enable the submit button
|
||||
$j('.submit-button').removeAttr("disabled");
|
||||
// stop the spinny thing
|
||||
$j('.submit-button').removeClass("show-loading");
|
||||
// show the errors on the form
|
||||
$j(".payment-errors").html(response.error.message).show();
|
||||
} else {
|
||||
|
|
|
@ -96,7 +96,7 @@ there's no tab for seeing ALL my books, only the filters! huh.
|
|||
<div class="js-topnews1">
|
||||
<div class="js-topnews2">
|
||||
<div class="js-topnews3">
|
||||
<div class="user-block">
|
||||
<div class="user-block" itemscope itemtype="http://schema.org/Person">
|
||||
<div id="user-block1">
|
||||
<div class="block-inner">
|
||||
{% if supporter.profile.pic_url %}
|
||||
|
@ -105,7 +105,7 @@ there's no tab for seeing ALL my books, only the filters! huh.
|
|||
<img class="user-avatar" src="/static/images/header/avatar.png" height="50" width="50" alt="Generic Ungluer Avatar" title="Ungluer" />
|
||||
{% endif %}
|
||||
<span class="user-name">
|
||||
<a href="#">{{ supporter.username }}</a>
|
||||
<a href="#"><span itemprop="name">{{ supporter.username }}</span></a>
|
||||
</span>
|
||||
</div>
|
||||
<span class="user-badges">
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
{% block extra_css %}
|
||||
<link type="text/css" rel="stylesheet" href="/static/css/campaign.css" />
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_js %}
|
||||
|
@ -20,29 +21,6 @@
|
|||
<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
|
||||
<script type="text/javascript" src="/static/js/counter.js"></script>
|
||||
<script type="text/javascript" src="/static/js/embed.js"></script>
|
||||
|
||||
<script>
|
||||
var $j = jQuery.noConflict();
|
||||
$j(document).ready(function(){
|
||||
$j('.show_more_edition').click(function(){
|
||||
if ($j(this).html() == 'less...') {
|
||||
$j(this).html('more...')
|
||||
} else {
|
||||
$j(this).html('less...')
|
||||
}
|
||||
$j(this).next().toggle();
|
||||
});
|
||||
});
|
||||
$j(document).ready(function(){
|
||||
var img = $j('#book-detail-img');
|
||||
var googimg = $j('#find-google img');
|
||||
img.mouseover(function(){
|
||||
googimg.css({"background": "#8dc63f"}).animate(
|
||||
{backgroundColor: "white"}, 1500
|
||||
);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% block topsection %}
|
||||
|
@ -71,473 +49,497 @@ $j(document).ready(function(){
|
|||
{% with work.last_campaign_status as status %}
|
||||
{% with work.id as work_id %}
|
||||
<div id="main-container">
|
||||
<div class="js-main">
|
||||
<div id="js-leftcol">
|
||||
<div class="jsmodule rounded">
|
||||
<div class="jsmod-content {{ status }}">
|
||||
{% if work.first_ebook %}
|
||||
AVAILABLE! <br />
|
||||
{% if wishers == 1 %}
|
||||
1 Ungluer is
|
||||
{% else %}
|
||||
{{ wishers }} Ungluers are
|
||||
{% endif %} enjoying this book
|
||||
{% else %}{% if work.last_campaign %}
|
||||
{% if status == 'ACTIVE' %}
|
||||
Unglue it! <br />
|
||||
${{ work.last_campaign.current_total|floatformat:0|intcomma }}/${{ work.last_campaign.target|floatformat:0|intcomma }} <br />
|
||||
Ending {{ countdown }}
|
||||
{% else %}
|
||||
{% if status == 'SUCCESSFUL' %}
|
||||
Unglued on {{ work.last_campaign.success_date|date:"M j, Y"}}! <br />
|
||||
${{ work.last_campaign.current_total|floatformat:0|intcomma }} raised of ${{ work.last_campaign.target|floatformat:0|intcomma }} goal<br />
|
||||
Ebook in progress
|
||||
{% else %}{% if status == 'INITIALIZED' %}
|
||||
Campaign starting soon
|
||||
{% else %}{% if status == 'SUSPENDED' %}
|
||||
Campaign suspended. <br />See <a href="/faq">FAQ</a>.
|
||||
{% else %}{% if status == 'WITHDRAWN' %}
|
||||
Campaign withdrawn. <br />See <a href="/faq">FAQ</a>.
|
||||
{% else %}{% if wishers == 0 %}
|
||||
<span class="findtheungluers">No ungluers are wishing yet.</span>
|
||||
<br />
|
||||
Be the first!
|
||||
{% else %}{% if wishers == 1 %}
|
||||
<span class="findtheungluers">{{ wishers }} Ungluer is wishing</span>
|
||||
<br />
|
||||
You can too!
|
||||
{% else %}
|
||||
<span class="findtheungluers">{{ wishers }} Ungluers are wishing</span>
|
||||
<br />
|
||||
You can too!
|
||||
{% endif %}{% endif %}{% endif %}{% endif %}{% endif %}{% endif %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if wishers == 0 %}
|
||||
<span class="findtheungluers">
|
||||
No ungluers are wishing yet.
|
||||
</span>
|
||||
<br />
|
||||
Be the first!
|
||||
{% else %}{% if wishers == 1 %}
|
||||
<span class="findtheungluers">
|
||||
{{ wishers }} Ungluer is wishing
|
||||
</span>
|
||||
<br />
|
||||
You can too!
|
||||
{% else %}
|
||||
<span class="findtheungluers">
|
||||
{{ wishers }} Ungluers are wishing
|
||||
</span>
|
||||
<br />
|
||||
You can too!
|
||||
{% endif %}{% endif %}
|
||||
{% endif %}{% endif %}
|
||||
</div>
|
||||
<div class="js-main">
|
||||
<div id="js-leftcol">
|
||||
{% include "explore.html" %}
|
||||
</div>
|
||||
{% include "explore.html" %}
|
||||
</div>
|
||||
<div id="js-maincol">
|
||||
<div class="js-maincol-inner">
|
||||
<div id="content-block">
|
||||
<div class="book-detail">
|
||||
{% if work.googlebooks_id %}
|
||||
<div id="book-detail-img"><a href="{{ work.googlebooks_url }}">
|
||||
<img src="{{ work.cover_image_thumbnail }}" alt="Find {{ work.title }} at Google Books" title="Find {{ work.title }} at Google Books" width="131" height="192" /></a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div id="book-detail-img">
|
||||
<img src="{% if work.cover_image_thumbnail %}{{ work.cover_image_thumbnail }}{% else %}/static/images/generic_cover_larger.png{% endif %}" alt="{{ work.title }}" title="{{ work.title }}" width="131" height="192" />
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="book-detail-info">
|
||||
<div class="layout">
|
||||
<h2 class="book-name">{{ work.title }}</h2>
|
||||
<div>
|
||||
<div class="pubinfo">
|
||||
<h3 class="book-author">{{ work.author }}</h3>
|
||||
<h3 class="book-year">{{ work.publication_date_year }}</h3>
|
||||
</div>
|
||||
{% if status == 'ACTIVE' %}
|
||||
{% if pledged %}
|
||||
<div class="btn_support modify"><form action="{% url pledge_modify work_id %}" method="get"><input type="submit" value="Modify Pledge" /></form></div>
|
||||
{% else %}
|
||||
<div class="btn_support"><form action="{% url pledge work_id %}" method="get"><input type="submit" value="Pledge" /></form></div>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if work.first_ebook %}
|
||||
<div class="btn_support">
|
||||
<a href="{% url download work_id %}" class="fakeinput hijax">Download</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="find-book">
|
||||
<label>Learn more at...</label>
|
||||
<div class="find-link">
|
||||
{% if work.googlebooks_id %}
|
||||
<a id="find-google" href="{{ work.googlebooks_url }}"><img src="/static/images/supporter_icons/googlebooks_square.png" title="Find on Google Books" alt="Find on Google Books" /></a>
|
||||
{% endif %}
|
||||
{% if work.first_oclc %}
|
||||
<a rel="nofollow" id="find-oclc" href="http://www.worldcat.org/oclc/{{ work.first_oclc }}"><img src="/static/images/supporter_icons/worldcat_square.png" title="Find on Worldcat" alt="Find on Worldcat" /></a>
|
||||
{% endif %}
|
||||
<a rel="nofollow" class="find-openlibrary" href="{% url work_openlibrary work_id %}"><img src="/static/images/supporter_icons/openlibrary_square.png" title="Find on OpenLibrary" alt="Find on OpenLibrary" /></a>
|
||||
{% if not request.user.is_anonymous %}
|
||||
{% if request.user.profile.goodreads_user_link %}
|
||||
<a rel="nofollow" class="find-goodreads" href="{% url work_goodreads work_id %}"><img src="/static/images/supporter_icons/goodreads_square.png" title="Find on GoodReads" alt="Find on GoodReads" /></a>
|
||||
{% endif %}
|
||||
{% if request.user.profile.librarything_id %}
|
||||
<a rel="nofollow" class="find-librarything" href="{% url work_librarything work_id %}"><img src="/static/images/supporter_icons/librarything_square.png" title="Find on LibraryThing" alt="Find on LibraryThing" /></a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% if not work.first_ebook %}
|
||||
<div class="pledged-info"><div class="pledged-group">
|
||||
{% if status == 'ACTIVE' %}
|
||||
{% if work.last_campaign.supporters_count == 1 %}
|
||||
One Ungluer has
|
||||
{% else %}
|
||||
{{ work.last_campaign.supporters_count }} Ungluers have
|
||||
<div id="js-maincol">
|
||||
<div class="js-maincol-inner">
|
||||
<div id="content-block" itemscope itemtype="http://schema.org/Book">
|
||||
<div class="book-detail">
|
||||
{% if work.googlebooks_id %}
|
||||
<div id="book-detail-img">
|
||||
<a href="{{ work.googlebooks_url }}">
|
||||
<img src="{{ work.cover_image_thumbnail }}" alt="Find {{ work.title }} at Google Books" title="Find {{ work.title }} at Google Books" width="131" height="192" /></a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div id="book-detail-img">
|
||||
<img itemprop="image" src="{% if work.cover_image_thumbnail %}{{ work.cover_image_thumbnail }}{% else %}/static/images/generic_cover_larger.png{% endif %}" alt="{{ work.title }}" title="{{ work.title }}" width="131" height="192" />
|
||||
</div>
|
||||
{% endif %}
|
||||
pledged ${{ work.last_campaign.current_total|floatformat:0|intcomma }}<br />toward a ${{ work.last_campaign.target|floatformat:0|intcomma }} goal
|
||||
{% else %}
|
||||
{% if wishers == 1 %}
|
||||
1 Ungluer has
|
||||
{% else %}
|
||||
{{ wishers }} Ungluers have
|
||||
{% endif %} wished for this Work
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="status">{% if status == 'ACTIVE' %}{{ work.percent_of_goal }}% {% endif %}<img src="/static/images/images/icon-book-37by25-{% if work.first_ebook %}6{%else%}{{ work.percent_unglued }}{%endif%}.png" title="book list status" alt="book list status" /></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="btn_wishlist" id="wishlist_actions">
|
||||
{% if request.user.is_anonymous %}
|
||||
<div class="create-account">
|
||||
<span title="{% url work work_id %}">Login to Add</span>
|
||||
</div>
|
||||
{% else %}{% if request.user.id in work.last_campaign.supporters %}
|
||||
<div class="add-wishlist">
|
||||
<span class="on-wishlist">On your wishlist!</span>
|
||||
</div>
|
||||
{% else %}{% if work in request.user.wishlist.works.all %}
|
||||
<div class="remove-wishlist-workpage">
|
||||
<span id="w{{ work_id }}">Remove from Wishlist</span>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="add-wishlist">
|
||||
<span class="work_id" id="w{{ work_id }}">Add to Wishlist</span>
|
||||
</div>
|
||||
{% endif %}{% endif %}{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% get_comment_count for work as comment_count %}
|
||||
<div class="content-block-heading" id="tabs">
|
||||
<ul class="tabs">
|
||||
<li class="tabs1 {% if activetab == '1' %}active{% endif %}"><a href="#">{% if status == 'ACTIVE' %}Campaign{% else %}Description{% endif %}</a></li>
|
||||
<li class="tabs2 {% if activetab == '2' %}active{% endif %}"><a href="#">Comments {% if comment_count > 0 %}({{ comment_count }}){% endif %}</a></li>
|
||||
<li class="tabs3 {% if activetab == '3' %}active{% endif %}" id="supporters"><a href="#">Ungluers {% if wishers > 0 %}<br />({{ wishers }}){% endif %}</a></li>
|
||||
<li class="tabs4 {% if activetab == '4' %}active{% endif %}"><a href="#">Rights</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content-block-content">
|
||||
<div id="tabs-1" class="tabs {% if activetab == '1' %}active{% endif %}">
|
||||
<div class="tabs-content">
|
||||
{% if status == 'ACTIVE' or status == 'SUCCESSFUL' %}
|
||||
{{ work.last_campaign.description|safe }}
|
||||
{% else %}
|
||||
<h3 class="tabcontent-title">{{work.title}}</h3>
|
||||
<p>{{ work.description|safe }}
|
||||
{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tabs-2" class="tabs {% if activetab == '2' %}active{% endif %}">
|
||||
<h3>Why unglue this? Have your say.</h3>
|
||||
<div class="tabs-content">
|
||||
{% render_comment_list for work %}
|
||||
{% if user.is_authenticated %}
|
||||
{% render_comment_form for work %}
|
||||
{% else %}
|
||||
<p>You must be <a href="{% url auth_login %}?next={{ request.path }}">logged in</a> to comment.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div id="tabs-3" class="tabs {% if activetab == '3' %}active{% endif %}">
|
||||
<div class="tabs-content">
|
||||
{% for wish in work.wishes.all reversed %}
|
||||
{% with wish.wishlist.user as supporter %}
|
||||
<div class="work_supporter_nocomment">
|
||||
<a href="{% url supporter supporter_username=supporter.username %}">
|
||||
<div class="work_supporter_avatar">
|
||||
{% if supporter.profile.pic_url %}
|
||||
<img class="user-avatar" src="{{ supporter.profile.pic_url }}" height="50" width="50" alt="Picture of {{ supporter }}" title="{{ supporter }}" />
|
||||
{% else %}
|
||||
<img class="user-avatar" src="/static/images/header/avatar.png" height="50" width="50" alt="Generic Ungluer Avatar" title="Ungluer" />
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="work_supporter_name">{{ supporter }}</div>
|
||||
</a>
|
||||
</div>
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div id="tabs-4" class="tabs {% if activetab == '4' %}active{% endif %}">
|
||||
<div class="tabs-content">
|
||||
{% if status == 'ACTIVE' %}
|
||||
<h3 class="tabcontent-title">A campaign is running to unglue <i>{{work.title}}</i>!</h3>
|
||||
<p>The rights holder, {% for claim in work.claim.all %}
|
||||
{% if claim.status == 'active' %}
|
||||
{{ claim.rights_holder.rights_holder_name }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
, has agreed to release <i>{{work.title}}</i> to the world as a Creative Commons licensed ebook (<a href="{{ work.last_campaign.license_url }}">{{ work.last_campaign.license }}</a>) if ungluers can join together to raise ${{ work.last_campaign.target|floatformat:0|intcomma }} by {{ work.last_campaign.deadline }}.
|
||||
You can help!</p>
|
||||
|
||||
<h4>Campaign details: the fine print</h4>
|
||||
{{ work.last_campaign.details|safe }}
|
||||
{% endif %}
|
||||
|
||||
{% if status == 'SUCCESSFUL' %}
|
||||
<h3 class="tabcontent-title">A campaign has succeeded to unglue <i>{{work.title}}</i>!</h3>
|
||||
<p>The rights holder, {% for claim in work.claim.all %}
|
||||
{% if claim.status == 'active' %}
|
||||
{{ claim.rights_holder.rights_holder_name }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
, has agreed to release <i>{{work.title}}</i> to the world as a Creative Commons licensed ebook (<a href="{{ work.last_campaign.license_url }}">{{ work.last_campaign.license }}</a>) thanks to the efforts of ungluers like you.</p>
|
||||
<h4>Campaign details: the fine print</h4>
|
||||
{{ work.last_campaign.details|safe }}
|
||||
{% endif %}
|
||||
{% if status != 'ACTIVE' and status != 'SUCCESSFUL' %}
|
||||
<h4> Rights Information </h4>
|
||||
{% if claimstatus == 'one_active' %}
|
||||
<p>This work has been claimed by {{ rights_holder_name }}.</p>
|
||||
{% else %}
|
||||
{% if claimstatus == 'disputed' %}
|
||||
<p>Rights claims are pending.</p>
|
||||
{% else %}
|
||||
{% if claimstatus == 'one_pending' %}
|
||||
<p>A claim for this work by {{ rights_holder_name }} is pending.</p>
|
||||
{% else %}
|
||||
{% if request.user.rights_holder.all.count %}
|
||||
Is this work yours? Claim it: <br /><br />
|
||||
|
||||
<form method="GET" action="{% url claim %}">
|
||||
{% csrf_token %}
|
||||
{{ claimform.user }}
|
||||
{{ claimform.work }}
|
||||
{{ claimform.rights_holder }}
|
||||
<input type="submit" name="submit" value="Claim">
|
||||
</form><br />
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<p>If you'd like to contact us regarding rights for this work, please email <a href="mailto:rights@gluejar.com">rights@gluejar.com</a>.</p>
|
||||
{% if user.is_staff %}<h4>Related Works</h4>
|
||||
<a href="{% url merge work_id %}">Merge other works into this one</a><br />
|
||||
{% endif %}
|
||||
|
||||
{% if work.subjects.all.count > 0 %}
|
||||
<h4>Subjects</h4>
|
||||
<ul>
|
||||
{% for subject in work.subjects.all %}
|
||||
<li>{{ subject.name }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
<h4>Editions</h4>
|
||||
{% if user.is_staff %}
|
||||
<div><a href="{% url new_edition work_id edition.id %}">Create a new edition for this work</a><br /><br /></div>
|
||||
{% endif %}
|
||||
|
||||
{% if alert %}<div class="alert"><b>Ebook Contribution:</b><br />{{ alert }}</div>{% endif %}
|
||||
{% for edition in editions %}
|
||||
<div class="clearfix">
|
||||
<div class="editions">
|
||||
{% if edition.googlebooks_id %}
|
||||
<div class="image">
|
||||
<img src="{{ edition.cover_image_small }}" title="edition cover" alt="edition cover" />
|
||||
<div class="book-detail-info">
|
||||
<div class="layout">
|
||||
<h2 class="book-name" itemprop="name">{{ work.title }}</h2>
|
||||
<div>
|
||||
<div class="pubinfo">
|
||||
<h3 class="book-author" itemprop="author">{{ work.author }}</h3>
|
||||
<h3 class="book-year" itemprop="datePublished">{{ work.publication_date_year }}</h3>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="metadata" id="edition_{{edition.id}}">{% if edition.publisher %}Publisher: {{edition.publisher}}<br />{% endif %}
|
||||
{% if edition.publication_date %}Published: {{edition.publication_date}}<br />{% endif %}
|
||||
{% if edition.isbn_13 %}
|
||||
ISBN: {{ edition.isbn_13 }}<br />
|
||||
{% endif %}
|
||||
{% if edition.oclc %}
|
||||
OCLC: <a href="http://www.worldcat.org/oclc/{{ edition.oclc }}">{{ edition.oclc }}</a><br />
|
||||
{% endif %}
|
||||
{% if user.is_staff %}
|
||||
<a href="{% url new_edition work_id edition.id %}">Edit this edition</a><br />
|
||||
{% endif %}
|
||||
{% if edition.googlebooks_id %}
|
||||
See <a href="https://encrypted.google.com/books?id={{ edition.googlebooks_id }}">this edition on Google Books</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% if edition.ebook_form %}{% ifnotequal status 'ACTIVE' %}
|
||||
{% if edition.hide_details %}
|
||||
<div class="show_more_edition" >more...</div>
|
||||
{% endif %}
|
||||
<div {% if edition.hide_details %} class="more_edition" {% endif %}>
|
||||
{% if edition.ebooks.count %}
|
||||
<h5>eBooks for this Edition</h5>
|
||||
{% for ebook in edition.ebooks.all %}
|
||||
<a href="{{ebook.url}}">{{ ebook.format }}</a> {{ebook.rights}} at {{ebook.provider}}<br />
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
<h5>Add an eBook for this Edition:</h5>
|
||||
<span>If you know that this edition is available as a public domain or Creative Commons ebook, you can enter the link here and "unglue" it. Right now, we're only accepting URLs that point to Internet Archive, Wikisources, Hathitrust, Project Gutenberg, or Google Books.</span>
|
||||
<form method="POST" action="#edition_{{edition.id}}">
|
||||
{% csrf_token %}{{ edition.ebook_form.edition.errors }}{{ edition.ebook_form.edition }}{{ edition.ebook_form.user.errors }}{{ edition.ebook_form.user }}{{ edition.ebook_form.provider.errors }}{{ edition.ebook_form.provider }}
|
||||
{{ edition.ebook_form.url.errors }}<span>URL: {{ edition.ebook_form.url }}</span><br />
|
||||
{{ edition.ebook_form.format.errors }}<span>File Format: {{ edition.ebook_form.format }}</span>
|
||||
{{ edition.ebook_form.rights.errors }}<span>License: {{ edition.ebook_form.rights }}</span><br />
|
||||
<input type="submit" name="add_ebook" value="add ebook" />
|
||||
</form>
|
||||
{% ifequal status 'ACTIVE' %}
|
||||
<div class="thermometer" title="{{ work.percent_of_goal }}% of goal">
|
||||
<div class="cover" style="width: {{ cover_width }}%;">
|
||||
</div>
|
||||
<span>{{ work.percent_of_goal }}% of goal</span>
|
||||
</div>
|
||||
<div class="pledged-info noborder">
|
||||
<div class="campaign-status-info">
|
||||
<span>${{ work.last_campaign.current_total|floatformat:0|intcomma }}</span> pledged
|
||||
</div>
|
||||
<div class="campaign-status-info">
|
||||
<span>${{ work.last_campaign.target|floatformat:0|intcomma }}</span> goal
|
||||
</div>
|
||||
<div class="campaign-status-info">
|
||||
{% if work.last_campaign.supporters_count == 1 %}
|
||||
<span>1</span> ungluer
|
||||
{% else %}
|
||||
<span>{{ work.last_campaign.supporters_count }}</span> ungluers
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="campaign-status-info">
|
||||
<span>{{ work.last_campaign.countdown }}</span> to go
|
||||
</div>
|
||||
</div>
|
||||
{% endifnotequal %}{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="js-rightcol">
|
||||
<div class="js-rightcol-pad rounded">
|
||||
|
||||
<div class="jsmodule">
|
||||
<h3 class="jsmod-title"><span>Share</span></h3>
|
||||
<div class="jsmod-content">
|
||||
<ul class="social menu">
|
||||
<a href="https://www.facebook.com/sharer.php?u={{request.build_absolute_uri|urlencode:"" }}"><li class="facebook first"><span>Facebook</span></li></a>
|
||||
{% if work.first_ebook %}
|
||||
<a href="https://twitter.com/intent/tweet?url={{request.build_absolute_uri|urlencode:"" }}&text=I%27m%20enjoying%20{{ work.title|urlencode }}%2C%20a%20free%2C%20DRM%2Dfree%20ebook%2E%20You%20can%20too%21"><li class="twitter"><span>Twitter</span></li></a>
|
||||
{% else %}
|
||||
{% ifequal status 'SUCCESSFUL' %}
|
||||
<a href="https://twitter.com/intent/tweet?url={{request.build_absolute_uri|urlencode:"" }}&text=I%27m%20looking%20forward%20to the%20free%2C%20non%2DDRM%20ebook%20of%20{{ work.title|urlencode }}%2E%20You%20can%20too%21 "><li class="twitter"><span>Twitter</span></li></a>
|
||||
{% else %}
|
||||
<a href="https://twitter.com/intent/tweet?url={{request.build_absolute_uri|urlencode:"" }}&text=I%27m%20ungluing%20{{ work.title|urlencode }}%20at%20%40unglueit.%20Join%20me%21"><li class="twitter"><span>Twitter</span></li></a>
|
||||
{% endifequal %}
|
||||
{% endif %}
|
||||
{% if request.user.is_authenticated %}<a href="{% url emailshare '' %}?next={{request.build_absolute_uri|urlencode:""}}"><li class="email"><span>Email</span></li></a>{% endif %}
|
||||
<a href="#" id="embed"><li class="embed"><span>Embed</span></li></a>
|
||||
</ul>
|
||||
<div id="widgetcode">Copy/paste this into your site:<br /><textarea rows="7" cols="22"><iframe src="https://{{request.META.HTTP_HOST}}/api/widget/{{work.first_isbn_13}}/" width="152" height="325" frameborder="0"></iframe></textarea></div>
|
||||
</div>
|
||||
</div>
|
||||
{% if status == 'ACTIVE' %}
|
||||
{% if premiums %}
|
||||
<div class="jsmodule">
|
||||
<a href="{% url pledge work_id %}"><h3 class="jsmod-title"><span>Premiums</span></h3></a>
|
||||
<div class="jsmod-content">
|
||||
<ul class="support menu">
|
||||
{% if pledged %}
|
||||
{% for premium in premiums %}
|
||||
{% if premium.limit == 0 or premium.limit > premium.premium_count %}
|
||||
<li class="{% if forloop.first %}first{% else %}{% if forloop.last %}last{% endif %}{% endif %}">
|
||||
<a href="{% url pledge_modify work_id %}?premium_id={{premium.id}}">
|
||||
<span class="menu-item-price">{% if premium.amount %}${{ premium.amount|floatformat:0|intcomma }}{% else %}Any amount{% endif %}</span>{% if pledged.0.premium == premium %}<div class="you_pledged">Yours!</div>{% endif %}
|
||||
<span class="menu-item-desc">{{ premium.description }}</span>
|
||||
{% ifnotequal premium.limit 0 %}<br /> Only {{ premium.premium_remaining }} remaining! {% endifnotequal %}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{% for premium in premiums %}
|
||||
{% if premium.limit == 0 or premium.limit > premium.premium_count %}
|
||||
<li class="{% if forloop.first %}first{% else %}{% if forloop.last %}last{% endif %}{% endif %}">
|
||||
<a href="{% url pledge work_id %}?premium_id={{premium.id}}">
|
||||
<span class="menu-item-price">${{ premium.amount|floatformat:0|intcomma }}</span>
|
||||
<span class="menu-item-desc">{{ premium.description }}</span>
|
||||
{% ifnotequal premium.limit 0 %}<br /> Only {{ premium.premium_remaining }} remaining! {% endifnotequal %}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% ifequal status 'SUCCESSFUL' %}
|
||||
<div class="thermometer successful">
|
||||
This campaign succeeded on {{ work.last_campaign.success_date|date:"M j, Y" }}.
|
||||
</div>
|
||||
<div class="pledged-info noborder">
|
||||
<div class="campaign-status-info">
|
||||
{% if work.last_campaign.supporters_count == 1 %}
|
||||
<span>1</span> ungluer
|
||||
{% else %}
|
||||
<span>{{ work.last_campaign.supporters_count }}</span> ungluers
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="campaign-status-info">
|
||||
<span>${{ work.last_campaign.current_total|floatformat:0|intcomma }}</span> pledged
|
||||
</div>
|
||||
<div class="campaign-status-info">
|
||||
<span>${{ work.last_campaign.target|floatformat:0|intcomma }}</span> goal
|
||||
</div>
|
||||
<div class="campaign-status-info">
|
||||
<span>Unglued!</span>
|
||||
</div>
|
||||
</div>
|
||||
{% endifequal %}
|
||||
|
||||
<div class="pledged-info">
|
||||
{% if wishers == 1 %}
|
||||
1 Ungluer has
|
||||
{% else %}
|
||||
{{ wishers }} Ungluers have
|
||||
{% endif %} wished for this Work
|
||||
</div>
|
||||
{% endifequal %}
|
||||
<div class="find-book">
|
||||
<label>Learn more at...</label>
|
||||
<div class="find-link">
|
||||
{% if work.googlebooks_id %}
|
||||
<a id="find-google" href="{{ work.googlebooks_url }}"><img src="/static/images/supporter_icons/googlebooks_square.png" title="Find on Google Books" alt="Find on Google Books" /></a>
|
||||
{% endif %}
|
||||
{% if work.first_oclc %}
|
||||
<a rel="nofollow" id="find-oclc" href="http://www.worldcat.org/oclc/{{ work.first_oclc }}"><img src="/static/images/supporter_icons/worldcat_square.png" title="Find on Worldcat" alt="Find on Worldcat" /></a>
|
||||
{% endif %}
|
||||
<a rel="nofollow" class="find-openlibrary" href="{% url work_openlibrary work_id %}"><img src="/static/images/supporter_icons/openlibrary_square.png" title="Find on OpenLibrary" alt="Find on OpenLibrary" /></a>
|
||||
{% if not request.user.is_anonymous %}
|
||||
{% if request.user.profile.goodreads_user_link %}
|
||||
<a rel="nofollow" class="find-goodreads" href="{% url work_goodreads work_id %}"><img src="/static/images/supporter_icons/goodreads_square.png" title="Find on GoodReads" alt="Find on GoodReads" /></a>
|
||||
{% endif %}
|
||||
{% if request.user.profile.librarything_id %}
|
||||
<a rel="nofollow" class="find-librarything" href="{% url work_librarything work_id %}"><img src="/static/images/supporter_icons/librarything_square.png" title="Find on LibraryThing" alt="Find on LibraryThing" /></a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn_wishlist" id="wishlist_actions">
|
||||
{% if request.user.is_anonymous %}
|
||||
<div class="create-account">
|
||||
<span title="{% url work work_id %}">Login to Add</span>
|
||||
</div>
|
||||
{% else %}{% if request.user.id in work.last_campaign.supporters %}
|
||||
<div class="add-wishlist">
|
||||
<span class="on-wishlist">On your wishlist!</span>
|
||||
</div>
|
||||
{% else %}{% if work in request.user.wishlist.works.all %}
|
||||
<div class="remove-wishlist-workpage">
|
||||
<span id="w{{ work_id }}">Remove from Wishlist</span>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="add-wishlist">
|
||||
<span class="work_id" id="w{{ work_id }}">Add to Wishlist</span>
|
||||
</div>
|
||||
{% endif %}{% endif %}{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="jsmodule">
|
||||
<a href="{% url pledge work_id %}"><h3 class="jsmod-title"><span>Acknowledgements</span></h3></a>
|
||||
<div class="jsmod-content">
|
||||
In addition to any premiums you're eligible for, you'll automatically be acknowledged in the unglued ebook as follows:
|
||||
<ul class="support menu">
|
||||
{% if pledged %}
|
||||
{% with pledged.0.amount as amount %}
|
||||
<li class="first">
|
||||
<a href="{% url pledge_modify work_id %}?preapproval_amount=1">
|
||||
<span class="menu-item-price">Any amount</span>{% if amount < 25 %}<div class="you_pledged">Yours!</div>{% endif %}
|
||||
<span class="menu-item-desc">The unglued ebook, free for you to read and share.</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{% url pledge_modify work_id %}?preapproval_amount=25">
|
||||
<span class="menu-item-price">$25 and up</span>{% if amount >= 25 and amount < 50 %}<div class="you_pledged">Yours!</div>{% endif %}
|
||||
<span class="menu-item-desc">Your name in the acknowledgements section of the unglued ebook under "Supporters".</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{% url pledge_modify work_id %}?preapproval_amount=50">
|
||||
<span class="menu-item-price">$50 and up</span>{% if amount >= 50 and amount < 100 %}<div class="you_pledged">Yours!</div>{% endif %}
|
||||
<span class="menu-item-desc">Your name & profile link in the acknowledgements section of the unglued ebook under "Benefactors".</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="last">
|
||||
<a href="{% url pledge_modify work_id %}?preapproval_amount=100">
|
||||
<span class="menu-item-price">$100 and up</span>{% if amount >= 100 %}<div class="you_pledged">Yours!</div>{% endif %}
|
||||
<span class="menu-item-desc">Your name, profile link, & a dedication of your choice in the acknowledgements section of the unglued ebook under "Bibliophiles".</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endwith %}
|
||||
{% else %}
|
||||
<li class="first">
|
||||
<a href="{% url pledge work_id %}?preapproval_amount=1">
|
||||
<span class="menu-item-price">Any amount</span>
|
||||
<span class="menu-item-desc">The unglued ebook, free for you to read and share.</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{% url pledge work_id %}?preapproval_amount=25">
|
||||
<span class="menu-item-price">$25 and up</span>
|
||||
<span class="menu-item-desc">Your name in the acknowledgements section of the unglued ebook under "Supporters".</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{% url pledge work_id %}?preapproval_amount=50">
|
||||
<span class="menu-item-price">$50 and up</span>
|
||||
<span class="menu-item-desc">Your name & profile link in the acknowledgements section of the unglued ebook under "Benefactors".</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="last">
|
||||
<a href="{% url pledge work_id %}?preapproval_amount=100">
|
||||
<span class="menu-item-price">$100 and up</span>
|
||||
<span class="menu-item-desc">Your name, profile link, & a dedication of your choice in the acknowledgements section of the unglued ebook under "Bibliophiles".</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% get_comment_count for work as comment_count %}
|
||||
<div class="content-block-heading" id="tabs">
|
||||
<ul class="tabs">
|
||||
<li class="tabs1 {% if activetab == '1' %}active{% endif %}"><a href="#">{% if status == 'ACTIVE' %}Campaign{% else %}Description{% endif %}</a></li>
|
||||
<li class="tabs2 {% if activetab == '2' %}active{% endif %}"><a href="#">Comments {% if comment_count > 0 %}({{ comment_count }}){% endif %}</a></li>
|
||||
<li class="tabs3 {% if activetab == '3' %}active{% endif %}" id="supporters"><a href="#">Ungluers {% if wishers > 0 %}<br />({{ wishers }}){% endif %}</a></li>
|
||||
<li class="tabs4 {% if activetab == '4' %}active{% endif %}"><a href="#">Rights</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="content-block-content">
|
||||
<div id="tabs-1" class="tabs {% if activetab == '1' %}active{% endif %}">
|
||||
<div class="tabs-content">
|
||||
{% if status == 'ACTIVE' or status == 'SUCCESSFUL' %}
|
||||
<div itemprop="description">{{ work.last_campaign.description|safe }}</div>
|
||||
{% else %}
|
||||
<h3 class="tabcontent-title">{{work.title}}</h3>
|
||||
<p itemprop="description">{{ work.description|safe }}
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div id="tabs-2" class="tabs {% if activetab == '2' %}active{% endif %}">
|
||||
<h3>Why unglue this? Have your say.</h3>
|
||||
<div class="tabs-content">
|
||||
{% render_comment_list for work %}
|
||||
{% if user.is_authenticated %}
|
||||
{% render_comment_form for work %}
|
||||
{% else %}
|
||||
<p>You must be <a href="{% url auth_login %}?next={{ request.path }}">logged in</a> to comment.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div id="tabs-3" class="tabs {% if activetab == '3' %}active{% endif %}">
|
||||
<div class="tabs-content">
|
||||
{% if request.user.is_staff or request.user in work.last_campaign.managers.all %}
|
||||
<form id="contact_form" method="POST" action="#" >
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="work" value="{{ work.id }}" />
|
||||
{% for wish in work.wishes.all reversed %}
|
||||
{% with wish.wishlist.user as supporter %}
|
||||
<div class="work_supporter_wide">
|
||||
<a href="{% url supporter supporter_username=supporter.username %}">
|
||||
<span class="work_supporter_avatar">
|
||||
{% if supporter.profile.pic_url %}
|
||||
<img class="user-avatar" src="{{ supporter.profile.pic_url }}" height="50" width="50" alt="Picture of {{ supporter }}" title="{{ supporter }}" />
|
||||
{% else %}
|
||||
<img class="user-avatar" src="/static/images/header/avatar.png" height="50" width="50" alt="Generic Ungluer Avatar" title="Ungluer" />
|
||||
{% endif %}
|
||||
</span>
|
||||
</a>
|
||||
<div class="show_supporter_contact_form" >
|
||||
<img src="/static/images/icons/email.png" title="contact supporter" />
|
||||
</div>
|
||||
<div class="info_for_managers">
|
||||
{{ supporter }}<br />
|
||||
Wished: {{ wish.created }}<br />
|
||||
{% if supporter.id in work.last_campaign.supporters %}Pledged!</br />{% endif %}
|
||||
{% if supporter in work.last_campaign.ungluers.all %}Supported!</br />{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="supporter_contact_form" ></div>
|
||||
<input class="supporter_contact_form" type="submit" name="msg_{{supporter.id}}" value="Send Message to {{ supporter.username }}" />
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
</form>
|
||||
{% else %}
|
||||
{% for wish in work.wishes.all reversed %}
|
||||
{% with wish.wishlist.user as supporter %}
|
||||
<div class="work_supporter_nocomment" itemscope itemtype="http://schema.org/Person">
|
||||
<a itemprop="url" href="{% url supporter supporter_username=supporter.username %}">
|
||||
<span class="work_supporter_avatar">
|
||||
{% if supporter.profile.pic_url %}
|
||||
<img class="user-avatar" src="{{ supporter.profile.pic_url }}" height="50" width="50" alt="Picture of {{ supporter }}" title="{{ supporter }}" />
|
||||
{% else %}
|
||||
<img class="user-avatar" src="/static/images/header/avatar.png" height="50" width="50" alt="Generic Ungluer Avatar" title="Ungluer" />
|
||||
{% endif %}
|
||||
</span>
|
||||
<span class="work_supporter_name">{{ supporter }}</span>
|
||||
</a>
|
||||
</div>
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div id="tabs-4" class="tabs {% if activetab == '4' %}active{% endif %}">
|
||||
<div class="tabs-content">
|
||||
{% if status == 'ACTIVE' %}
|
||||
<h3 class="tabcontent-title">A campaign is running to unglue <i>{{work.title}}</i>!</h3>
|
||||
<p>The rights holder, {% for claim in work.claim.all %}
|
||||
{% if claim.status == 'active' %}
|
||||
{{ claim.rights_holder.rights_holder_name }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
, has agreed to release <i>{{work.title}}</i> to the world as a Creative Commons licensed ebook (<a href="{{ work.last_campaign.license_url }}">{{ work.last_campaign.license }}</a>) if ungluers can join together to raise ${{ work.last_campaign.target|floatformat:0|intcomma }} by {{ work.last_campaign.deadline }}.
|
||||
You can help!</p>
|
||||
|
||||
<h4>Campaign details: the fine print</h4>
|
||||
{{ work.last_campaign.details|safe }}
|
||||
{% endif %}
|
||||
|
||||
{% if status == 'SUCCESSFUL' %}
|
||||
<h3 class="tabcontent-title">A campaign has succeeded to unglue <i>{{work.title}}</i>!</h3>
|
||||
<p>The rights holder, {% for claim in work.claim.all %}
|
||||
{% if claim.status == 'active' %}
|
||||
{{ claim.rights_holder.rights_holder_name }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
, has agreed to release <i>{{work.title}}</i> to the world as a Creative Commons licensed ebook (<a href="{{ work.last_campaign.license_url }}">{{ work.last_campaign.license }}</a>) thanks to the efforts of ungluers like you.</p>
|
||||
<h4>Campaign details: the fine print</h4>
|
||||
{{ work.last_campaign.details|safe }}
|
||||
{% endif %}
|
||||
{% if status != 'ACTIVE' and status != 'SUCCESSFUL' %}
|
||||
<h4> Rights Information </h4>
|
||||
{% if claimstatus == 'one_active' %}
|
||||
<p>This work has been claimed by {{ rights_holder_name }}.</p>
|
||||
{% else %}
|
||||
{% if claimstatus == 'disputed' %}
|
||||
<p>Rights claims are pending.</p>
|
||||
{% else %}
|
||||
{% if claimstatus == 'one_pending' %}
|
||||
<p>A claim for this work by {{ rights_holder_name }} is pending.</p>
|
||||
{% else %}
|
||||
{% if request.user.rights_holder.all.count %}
|
||||
Is this work yours? Claim it: <br /><br />
|
||||
|
||||
<form method="GET" action="{% url claim %}">
|
||||
{% csrf_token %}
|
||||
{{ claimform.user }}
|
||||
{{ claimform.work }}
|
||||
{{ claimform.rights_holder }}
|
||||
<input type="submit" name="submit" value="Claim" />
|
||||
</form><br />
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<p>If you'd like to contact us regarding rights for this work, please email <a href="mailto:rights@gluejar.com">rights@gluejar.com</a>.</p>
|
||||
{% if user.is_staff %}
|
||||
<h4>Related Works</h4>
|
||||
<a href="{% url merge work_id %}">Merge other works into this one</a><br />
|
||||
{% endif %}
|
||||
{% if work.subjects.all.count > 0 %}
|
||||
<h4>Subjects</h4>
|
||||
<ul>
|
||||
{% for subject in work.subjects.all %}
|
||||
<li itemprop="keywords">{{ subject.name }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
<h4>Editions</h4>
|
||||
{% if user.is_staff %}
|
||||
<div><a href="{% url new_edition work_id edition.id %}">Create a new edition for this work</a><br /><br /></div>
|
||||
{% endif %}
|
||||
|
||||
{% if alert %}
|
||||
<div class="alert"><b>Ebook Contribution:</b><br />{{ alert }}</div>
|
||||
{% endif %}
|
||||
{% for edition in editions %}
|
||||
<div class="clearfix">
|
||||
<div class="editions">
|
||||
{% if edition.googlebooks_id %}
|
||||
<div class="image">
|
||||
<img src="{{ edition.cover_image_small }}" title="edition cover" alt="edition cover" />
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="metadata" id="edition_{{edition.id}}">
|
||||
{% if edition.publisher %}
|
||||
Publisher: <a href="{% url bypub_list edition.publisher %}">{{edition.publisher}}</a><br />
|
||||
{% endif %}
|
||||
{% if edition.publication_date %}
|
||||
Published: {{ edition.publication_date }}<br />
|
||||
{% endif %}
|
||||
{% if edition.isbn_13 %}
|
||||
ISBN: <span itemprop="isbn">{{ edition.isbn_13 }}</span><br />
|
||||
{% endif %}
|
||||
{% if edition.oclc %}
|
||||
OCLC: <a href="http://www.worldcat.org/oclc/{{ edition.oclc }}">{{ edition.oclc }}</a><br />
|
||||
{% endif %}
|
||||
{% if user.is_staff %}
|
||||
<a href="{% url new_edition work_id edition.id %}">Edit this edition</a><br />
|
||||
{% endif %}
|
||||
{% if edition.googlebooks_id %}
|
||||
See <a href="https://encrypted.google.com/books?id={{ edition.googlebooks_id }}">this edition on Google Books</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% if edition.ebook_form %}
|
||||
{% ifnotequal status 'ACTIVE' %}
|
||||
{% if edition.hide_details %}
|
||||
<div class="show_more_edition" >
|
||||
more...
|
||||
</div>
|
||||
{% endif %}
|
||||
<div {% if edition.hide_details %} class="more_edition" {% endif %}>
|
||||
{% if edition.ebooks.count %}
|
||||
<h5>eBooks for this Edition</h5>
|
||||
{% for ebook in edition.ebooks.all %}
|
||||
<a href="{{ebook.url}}">{{ ebook.format }}</a> {{ebook.rights}} at {{ebook.provider}}<br />
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
<h5>Add an eBook for this Edition:</h5>
|
||||
|
||||
<span>If you know that this edition is available as a public domain or Creative Commons ebook, you can enter the link here and "unglue" it. Right now, we're only accepting URLs that point to Internet Archive, Wikisources, Hathitrust, Project Gutenberg, or Google Books.</span>
|
||||
|
||||
<form method="POST" action="#edition_{{edition.id}}">
|
||||
{% csrf_token %}{{ edition.ebook_form.edition.errors }}{{ edition.ebook_form.edition }}{{ edition.ebook_form.user.errors }}{{ edition.ebook_form.user }}{{ edition.ebook_form.provider.errors }}{{ edition.ebook_form.provider }}
|
||||
{{ edition.ebook_form.url.errors }}<span>URL: {{ edition.ebook_form.url }}</span><br />
|
||||
{{ edition.ebook_form.format.errors }}<span>File Format: {{ edition.ebook_form.format }}</span>
|
||||
{{ edition.ebook_form.rights.errors }}<span>License: {{ edition.ebook_form.rights }}</span><br />
|
||||
<input type="submit" name="add_ebook" value="add ebook" />
|
||||
</form>
|
||||
</div>
|
||||
{% endifnotequal %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="js-rightcol">
|
||||
<div class="clearfix">
|
||||
{% if status == 'ACTIVE' %}
|
||||
{% if pledged %}
|
||||
<div class="btn_support modify"><form action="{% url pledge_modify work_id %}" method="get"><input type="submit" value="Modify Pledge" /></form></div>
|
||||
{% else %}
|
||||
<div class="btn_support"><form action="{% url pledge work_id %}" method="get"><input type="submit" value="Pledge" /></form></div>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if work.first_ebook %}
|
||||
<div class="btn_support">
|
||||
<a href="{% url download work_id %}" class="hijax"><span>Download</span></a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<br />
|
||||
<div class="js-rightcol-pad rounded">
|
||||
<div class="jsmodule">
|
||||
<h3 class="jsmod-title"><span>Share</span></h3>
|
||||
<div class="jsmod-content">
|
||||
<ul class="social menu">
|
||||
<a href="https://www.facebook.com/sharer.php?u={{request.build_absolute_uri|urlencode:"" }}"><li class="facebook first"><span>Facebook</span></li></a>
|
||||
{% if work.first_ebook %}
|
||||
<a href="https://twitter.com/intent/tweet?url={{request.build_absolute_uri|urlencode:"" }}&text=I%27m%20enjoying%20{{ work.title|urlencode }}%2C%20a%20free%2C%20DRM%2Dfree%20ebook%2E%20You%20can%20too%21"><li class="twitter"><span>Twitter</span></li></a>
|
||||
{% else %}
|
||||
{% ifequal status 'SUCCESSFUL' %}
|
||||
<a href="https://twitter.com/intent/tweet?url={{request.build_absolute_uri|urlencode:"" }}&text=I%27m%20looking%20forward%20to the%20free%2C%20non%2DDRM%20ebook%20of%20{{ work.title|urlencode }}%2E%20You%20can%20too%21 "><li class="twitter"><span>Twitter</span></li></a>
|
||||
{% else %}
|
||||
<a href="https://twitter.com/intent/tweet?url={{request.build_absolute_uri|urlencode:"" }}&text=I%27m%20ungluing%20{{ work.title|urlencode }}%20at%20%40unglueit.%20Join%20me%21"><li class="twitter"><span>Twitter</span></li></a>
|
||||
{% endifequal %}
|
||||
{% endif %}
|
||||
{% if request.user.is_authenticated %}<a href="{% url emailshare '' %}?next={{request.build_absolute_uri|urlencode:""}}"><li class="email"><span>Email</span></li></a>{% endif %}
|
||||
<a href="#" id="embed"><li class="embed"><span>Embed</span></li></a>
|
||||
</ul>
|
||||
<div id="widgetcode">
|
||||
Copy/paste this into your site:<br /><textarea rows="7" cols="22"><iframe src="https://{{request.META.HTTP_HOST}}/api/widget/{{work.first_isbn_13}}/" width="152" height="325" frameborder="0"></iframe></textarea></div>
|
||||
</div>
|
||||
</div>
|
||||
{% if status == 'ACTIVE' %}
|
||||
{% if premiums %}
|
||||
<div class="jsmodule">
|
||||
<a href="{% url pledge work_id %}"><h3 class="jsmod-title"><span>Premiums</span></h3></a>
|
||||
<div class="jsmod-content">
|
||||
<ul class="support menu">
|
||||
{% if pledged %}
|
||||
{% for premium in premiums %}
|
||||
{% if premium.limit == 0 or premium.limit > premium.premium_count %}
|
||||
<li class="{% if forloop.first %}first{% else %}{% if forloop.last %}last{% endif %}{% endif %}">
|
||||
<a href="{% url pledge_modify work_id %}?premium_id={{premium.id}}">
|
||||
<span class="menu-item-price">{% if premium.amount %}${{ premium.amount|floatformat:0|intcomma }}{% else %}Any amount{% endif %}</span>{% if pledged.0.premium == premium %}<div class="you_pledged">Yours!</div>{% endif %}
|
||||
<span class="menu-item-desc">{{ premium.description }}</span>
|
||||
{% ifnotequal premium.limit 0 %}<br /> Only {{ premium.premium_remaining }} remaining! {% endifnotequal %}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{% for premium in premiums %}
|
||||
{% if premium.limit == 0 or premium.limit > premium.premium_count %}
|
||||
<li class="{% if forloop.first %}first{% else %}{% if forloop.last %}last{% endif %}{% endif %}">
|
||||
<a href="{% url pledge work_id %}?premium_id={{premium.id}}">
|
||||
<span class="menu-item-price">${{ premium.amount|floatformat:0|intcomma }}</span>
|
||||
<span class="menu-item-desc">{{ premium.description }}</span>
|
||||
{% ifnotequal premium.limit 0 %}<br /> Only {{ premium.premium_remaining }} remaining! {% endifnotequal %}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="jsmodule">
|
||||
<a href="{% url pledge work_id %}"><h3 class="jsmod-title"><span>Acknowledgements</span></h3></a>
|
||||
<div class="jsmod-content">
|
||||
In addition to any premiums you're eligible for, you'll automatically be acknowledged in the unglued ebook as follows:
|
||||
<ul class="support menu">
|
||||
{% if pledged %}
|
||||
{% with pledged.0.amount as amount %}
|
||||
<li class="first">
|
||||
<a href="{% url pledge_modify work_id %}?preapproval_amount=1">
|
||||
<span class="menu-item-price">Any amount</span>{% if amount < 25 %}<div class="you_pledged">Yours!</div>{% endif %}
|
||||
<span class="menu-item-desc">The unglued ebook, free for you to read and share.</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{% url pledge_modify work_id %}?preapproval_amount=25">
|
||||
<span class="menu-item-price">$25 and up</span>{% if amount >= 25 and amount < 50 %}<div class="you_pledged">Yours!</div>{% endif %}
|
||||
<span class="menu-item-desc">Your name in the acknowledgements section of the unglued ebook under "Supporters".</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{% url pledge_modify work_id %}?preapproval_amount=50">
|
||||
<span class="menu-item-price">$50 and up</span>{% if amount >= 50 and amount < 100 %}<div class="you_pledged">Yours!</div>{% endif %}
|
||||
<span class="menu-item-desc">Your name & profile link in the acknowledgements section of the unglued ebook under "Benefactors".</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="last">
|
||||
<a href="{% url pledge_modify work_id %}?preapproval_amount=100">
|
||||
<span class="menu-item-price">$100 and up</span>{% if amount >= 100 %}<div class="you_pledged">Yours!</div>{% endif %}
|
||||
<span class="menu-item-desc">Your name, profile link, & a dedication of your choice in the acknowledgements section of the unglued ebook under "Bibliophiles".</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endwith %}
|
||||
{% else %}
|
||||
<li class="first">
|
||||
<a href="{% url pledge work_id %}?preapproval_amount=1">
|
||||
<span class="menu-item-price">Any amount</span>
|
||||
<span class="menu-item-desc">The unglued ebook, free for you to read and share.</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{% url pledge work_id %}?preapproval_amount=25">
|
||||
<span class="menu-item-price">$25 and up</span>
|
||||
<span class="menu-item-desc">Your name in the acknowledgements section of the unglued ebook under "Supporters".</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{% url pledge work_id %}?preapproval_amount=50">
|
||||
<span class="menu-item-price">$50 and up</span>
|
||||
<span class="menu-item-desc">Your name & profile link in the acknowledgements section of the unglued ebook under "Benefactors".</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="last">
|
||||
<a href="{% url pledge work_id %}?preapproval_amount=100">
|
||||
<span class="menu-item-price">$100 and up</span>
|
||||
<span class="menu-item-desc">Your name, profile link, & a dedication of your choice in the acknowledgements section of the unglued ebook under "Bibliophiles".</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -27,26 +27,18 @@
|
|||
<div class="js-topnews2">
|
||||
<div class="js-topnews3">
|
||||
<div class="user-block">
|
||||
<div id="user-block1">
|
||||
{% if facet == 'recommended' %}
|
||||
<div id="block-intro-text"><span class="special-user-name">Staff Picks</span></div>
|
||||
</div>
|
||||
<div class="user-block2"><span class="user-short-info">Here are the {% if pub_lang %}{{pub_lang|ez_lang_name}} language {% endif %}books <a href="{% url supporter 'AmandaM' %}">Amanda</a>, <a href="{% url supporter 'andromeda' %}">Andromeda</a>, <a href="{% url supporter 'eric' %}">Eric</a>, and <a href="{% url supporter 'rdhyee' %}">Raymond</a> are loving lately.</span>
|
||||
</div>
|
||||
<div class="user-block3 recommended">
|
||||
<a href="{% url supporter 'AmandaM' %}"><img class="user-avatar" src="https://si0.twimg.com/profile_images/1801686082/image_normal.jpg" height="50" width="50" alt="Picture of Amanda" title="Amanda" /></a>
|
||||
<a href="{% url supporter 'andromeda' %}"><img class="user-avatar" src="https://si0.twimg.com/profile_images/611713549/andromeda_by_molly_color_normal.jpg" height="50" width="50" alt="Picture of Andromeda" title="Andromeda" /></a>
|
||||
<a href="{% url supporter 'eric' %}"><img class="user-avatar" src="https://graph.facebook.com/1009077800/picture" height="50" width="50" alt="Picture of Eric" title="Eric" /></a>
|
||||
<a href="{% url supporter 'RaymondYee' %}"><img class="user-avatar" src="https://graph.facebook.com/1229336/picture" height="50" width="50" alt="Picture of Raymond" title="Raymond" /></a>
|
||||
</div>
|
||||
{% else %}
|
||||
{% block userblock %}
|
||||
<div id="user-block1">
|
||||
<div id="block-intro-text"><span class="special-user-name">{{ facet|capfirst }}</span></div>
|
||||
</div>
|
||||
<div class="user-block2"><span class="user-short-info">With your help we're raising money to buy the rights to give these {% if pub_lang %}{{pub_lang|ez_lang_name}} language {% endif %}books to the world.</span>
|
||||
<div class="user-block2">
|
||||
{% block userblock2 %}
|
||||
<span class="user-short-info">With your help we're raising money to buy the rights to give these {% if pub_lang %}{{pub_lang|ez_lang_name}} language {% endif %}books to the world.</span>
|
||||
{% endblock %}
|
||||
</div>
|
||||
<div class="user-block3">
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -90,16 +82,11 @@
|
|||
</div>
|
||||
<div id="content-block-content">
|
||||
{% ifequal work_list.count 0 %}
|
||||
{% if facet == 'recommended' %}
|
||||
Check back soon to see what we're recommending.
|
||||
{% else %}
|
||||
{% block noworks %}
|
||||
There aren't any {{ pub_lang|ez_lang_name }} works in this list yet. Why not add your favorite books to your wishlist, so we can feature them here?
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% else %}
|
||||
{% comment %}
|
||||
pagination commented out for now because it was causing huge db hits/pageload times. These sets have been limited in views.py to 20 on the theory that people only want to see the MOST popular works, and the other facets are unlikely to produce sets exceeding this anyway.
|
||||
{% lazy_paginate 20 works_unglued using "works_unglued" %}
|
||||
{% endcomment %}
|
||||
{% for work in works_unglued %}
|
||||
<div class="{% cycle 'row1' 'row2' %}">
|
||||
{% with work.last_campaign_status as status %}
|
||||
|
@ -109,18 +96,13 @@
|
|||
{% endwith %}{% endwith %}{% endwith %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% comment %}
|
||||
<div class="pagination content-block-heading tabs-1">
|
||||
{% get_pages %}
|
||||
{% for page in pages %}
|
||||
<a href="{{ page.path }}#1" class="endless_page_link">{{ page.number }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endcomment %}
|
||||
|
||||
{% comment %}
|
||||
{% lazy_paginate 20 works_active using "works_active" %}
|
||||
{% endcomment %}
|
||||
{% for work in works_active %}
|
||||
<div class="{% cycle 'row1' 'row2' %}">
|
||||
{% with work.last_campaign_status as status %}
|
||||
|
@ -130,18 +112,14 @@
|
|||
{% endwith %}{% endwith %}{% endwith %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% comment %}
|
||||
<div class="pagination content-block-heading tabs-2">
|
||||
{% get_pages %}
|
||||
{% for page in pages %}
|
||||
<a href="{{ page.path }}#2" class="endless_page_link">{{ page.number }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endcomment %}
|
||||
|
||||
{% comment %}
|
||||
{% lazy_paginate 20 works_wished using "works_wished" %}
|
||||
{% endcomment %}
|
||||
{% for work in works_wished %}
|
||||
<div class="{% cycle 'row1' 'row2' %}">
|
||||
{% with work.last_campaign_status as status %}
|
||||
|
@ -151,14 +129,12 @@
|
|||
{% endwith %}{% endwith %}{% endwith %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% comment %}
|
||||
<div class="pagination content-block-heading tabs-3">
|
||||
{% get_pages %}
|
||||
{% for page in pages %}
|
||||
<a href="{{ page.path }}#3" class="endless_page_link">{{ page.number }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endcomment %}
|
||||
{% endifequal %}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -31,7 +31,7 @@ class WishlistTests(TestCase):
|
|||
# add a book to the wishlist
|
||||
r = self.client.post("/wishlist/", {"googlebooks_id": "2NyiPwAACAAJ"},
|
||||
HTTP_X_REQUESTED_WITH="XMLHttpRequest")
|
||||
self.assertEqual(r.status_code, 302)
|
||||
self.assertEqual(r.status_code, 200)
|
||||
self.assertEqual(self.user.wishlist.works.all().count(), 1)
|
||||
wished= self.user.wishlist.works.all()[0]
|
||||
# test the work page
|
||||
|
@ -138,7 +138,7 @@ class PledgingUiTests(TestCase):
|
|||
# load a Work by putting it on the User's wishlist
|
||||
r = self.client.post("/wishlist/", {"googlebooks_id": "2NyiPwAACAAJ"},
|
||||
HTTP_X_REQUESTED_WITH="XMLHttpRequest")
|
||||
self.assertEqual(r.status_code, 302)
|
||||
self.assertEqual(r.status_code, 200)
|
||||
self.assertEqual(self.user.wishlist.works.all().count(), 1)
|
||||
wished= self.user.wishlist.works.all()[0]
|
||||
# test the work page
|
||||
|
|
|
@ -11,7 +11,7 @@ from regluit.core.feeds import SupporterWishlistFeed
|
|||
from regluit.core.models import Campaign
|
||||
from regluit.frontend.views import GoodreadsDisplayView, LibraryThingView, PledgeView, PledgeCompleteView, PledgeCancelView, PledgeRechargeView, FAQView
|
||||
from regluit.frontend.views import CampaignListView, WorkListView, UngluedListView, InfoPageView, InfoLangView, DonationView, FundPledgeView
|
||||
from regluit.frontend.views import NonprofitCampaign, DonationCredit, PledgeModifiedView, ManageAccount, MergeView
|
||||
from regluit.frontend.views import NonprofitCampaign, DonationCredit, PledgeModifiedView, ManageAccount, MergeView, ByPubListView
|
||||
|
||||
urlpatterns = patterns(
|
||||
"regluit.frontend.views",
|
||||
|
@ -35,8 +35,11 @@ urlpatterns = patterns(
|
|||
url(r"^faq/(?P<location>\w*)/$", FAQView.as_view(), {'sublocation':'all'}, name="faq_location"),
|
||||
url(r"^faq/(?P<location>\w*)/(?P<sublocation>\w*)/$", FAQView.as_view(), name="faq_sublocation"),
|
||||
url(r"^wishlist/$", "wishlist", name="wishlist"),
|
||||
url(r"^msg/$", "msg", name="msg"),
|
||||
url(r"^campaigns/(?P<facet>\w*)$", CampaignListView.as_view(), name='campaign_list'),
|
||||
url(r"^lists/(?P<facet>\w*)$", WorkListView.as_view(), name='work_list'),
|
||||
url(r"^bypub/all/(?P<pubname>.*)$", ByPubListView.as_view(), name='bypub_list'),
|
||||
url(r"^bypub/(?P<facet>\w*)/(?P<pubname>.*)$", ByPubListView.as_view(), name='bypub_list'),
|
||||
url(r"^unglued/(?P<facet>\w*)$", UngluedListView.as_view(), name='unglued_list'),
|
||||
url(r"^goodreads/auth/$", "goodreads_auth", name="goodreads_auth"),
|
||||
url(r"^goodreads/auth_cb/$", "goodreads_cb", name="goodreads_cb"),
|
||||
|
@ -92,6 +95,9 @@ urlpatterns = patterns(
|
|||
get_context_data=lambda: {'site': Site.objects.get_current()}
|
||||
),
|
||||
name="libraries"),
|
||||
url(r"^ml/status/$","ml_status", name="ml_status"),
|
||||
url(r"^ml/subscribe/$","ml_subscribe", name="ml_subscribe"),
|
||||
url(r"^ml/unsubscribe/$","ml_unsubscribe", name="ml_unsubscribe"),
|
||||
)
|
||||
|
||||
if settings.DEBUG:
|
||||
|
|
|
@ -43,13 +43,16 @@ from regluit.core.tasks import send_mail_task, emit_notifications
|
|||
from regluit.core import models, bookloader, librarything
|
||||
from regluit.core import userlists
|
||||
from regluit.core.search import gluejar_search
|
||||
from regluit.core import goodreads
|
||||
from regluit.core.goodreads import GoodreadsClient
|
||||
from regluit.core.bookloader import merge_works
|
||||
from regluit.core.signals import supporter_message
|
||||
from regluit.frontend.forms import UserData, UserEmail, ProfileForm, CampaignPledgeForm, GoodreadsShelfLoadingForm
|
||||
from regluit.frontend.forms import RightsHolderForm, UserClaimForm, LibraryThingForm, OpenCampaignForm
|
||||
from regluit.frontend.forms import getManageCampaignForm, DonateForm, CampaignAdminForm, EmailShareForm, FeedbackForm
|
||||
from regluit.frontend.forms import EbookForm, CustomPremiumForm, EditManagersForm, EditionForm, PledgeCancelForm
|
||||
from regluit.frontend.forms import getTransferCreditForm, CCForm, CloneCampaignForm, PlainCCForm, WorkForm, OtherWorkForm
|
||||
from regluit.frontend.forms import MsgForm
|
||||
from regluit.payment.manager import PaymentManager
|
||||
from regluit.payment.models import Transaction, Account
|
||||
from regluit.payment import baseprocessor
|
||||
|
@ -57,7 +60,6 @@ from regluit.payment.parameters import TRANSACTION_STATUS_ACTIVE, TRANSACTION_ST
|
|||
from regluit.payment.parameters import PAYMENT_TYPE_AUTHORIZATION, PAYMENT_TYPE_INSTANT
|
||||
from regluit.payment.parameters import PAYMENT_HOST_STRIPE, PAYMENT_HOST_NONE
|
||||
from regluit.payment.credit import credit_transaction
|
||||
from regluit.core import goodreads
|
||||
from tastypie.models import ApiKey
|
||||
from regluit.payment.models import Transaction, Sent, CreditLog
|
||||
from notification import models as notification
|
||||
|
@ -113,6 +115,14 @@ def safe_get_work(work_id):
|
|||
except models.WasWork.DoesNotExist:
|
||||
raise Http404
|
||||
return work
|
||||
|
||||
def cover_width(work):
|
||||
if work.percent_of_goal() < 100:
|
||||
cover_width = 100 - work.percent_of_goal()
|
||||
else:
|
||||
cover_width = 0
|
||||
|
||||
return cover_width
|
||||
|
||||
def home(request, landing=False):
|
||||
if request.user.is_authenticated() and landing == False:
|
||||
|
@ -141,7 +151,6 @@ def work(request, work_id, action='display'):
|
|||
if request.method == 'POST' and not request.user.is_anonymous():
|
||||
activetab = '4'
|
||||
else:
|
||||
alert=''
|
||||
try:
|
||||
activetab = request.GET['tab']
|
||||
if activetab not in ['1', '2', '3', '4']:
|
||||
|
@ -149,7 +158,7 @@ def work(request, work_id, action='display'):
|
|||
except:
|
||||
activetab = '1';
|
||||
|
||||
context = {}
|
||||
alert=''
|
||||
campaign = work.last_campaign()
|
||||
if campaign and campaign.edition and not request.user.is_staff:
|
||||
editions = [campaign.edition]
|
||||
|
@ -161,7 +170,7 @@ def work(request, work_id, action='display'):
|
|||
pledged = None
|
||||
|
||||
logger.info("pledged: {0}".format(pledged))
|
||||
countdown = ""
|
||||
cover_width_number = 0
|
||||
|
||||
try:
|
||||
assert not (work.last_campaign_status() == 'ACTIVE' and work.first_ebook())
|
||||
|
@ -169,25 +178,7 @@ def work(request, work_id, action='display'):
|
|||
logger.warning("Campaign running for %s when ebooks are already available: why?" % work.title )
|
||||
|
||||
if work.last_campaign_status() == 'ACTIVE':
|
||||
from math import ceil
|
||||
time_remaining = campaign.deadline - now()
|
||||
|
||||
'''
|
||||
we want to round up on all of these; if it's the 3rd and the
|
||||
campaign ends the 8th, users expect to see 5 days remaining,
|
||||
not 4 (as an artifact of 4 days 11 hours or whatever)
|
||||
time_remaining.whatever is an int, so just adding 1 will do
|
||||
that for us (except in the case where .days exists and both other
|
||||
fields are 0, which is unlikely enough I'm not defending against it)
|
||||
'''
|
||||
if time_remaining.days:
|
||||
countdown = "in %s days" % str(time_remaining.days + 1)
|
||||
elif time_remaining.seconds > 3600:
|
||||
countdown = "in %s hours" % str(time_remaining.seconds/3600 + 1)
|
||||
elif time_remaining.seconds > 60:
|
||||
countdown = "in %s minutes" % str(time_remaining.seconds/60 + 1)
|
||||
else:
|
||||
countdown = "right now"
|
||||
cover_width_number = cover_width(work)
|
||||
|
||||
if action == 'preview':
|
||||
work.last_campaign_status = 'ACTIVE'
|
||||
|
@ -250,7 +241,7 @@ def work(request, work_id, action='display'):
|
|||
'alert': alert,
|
||||
'claimstatus': claimstatus,
|
||||
'rights_holder_name': rights_holder_name,
|
||||
'countdown': countdown,
|
||||
'cover_width': cover_width_number
|
||||
})
|
||||
|
||||
def new_edition(request, work_id, edition_id, by=None):
|
||||
|
@ -484,15 +475,17 @@ recommended_user = User.objects.filter( username=settings.UNGLUEIT_RECOMMENDED_U
|
|||
class WorkListView(FilterableListView):
|
||||
template_name = "work_list.html"
|
||||
context_object_name = "work_list"
|
||||
max_works=100000
|
||||
|
||||
def get_queryset_all(self):
|
||||
facet = self.kwargs['facet']
|
||||
if (facet == 'popular'):
|
||||
return models.Work.objects.order_by('-num_wishes', 'id')
|
||||
return models.Work.objects.exclude(num_wishes=0).order_by('-num_wishes', 'id')
|
||||
elif (facet == 'recommended'):
|
||||
self.template_name = "recommended.html"
|
||||
return models.Work.objects.filter(wishlists__user=recommended_user).order_by('-num_wishes')
|
||||
elif (facet == 'new'):
|
||||
return models.Work.objects.filter(num_wishes__gt=0).order_by('-created', '-num_wishes' ,'id')
|
||||
return models.Work.objects.exclude(num_wishes=0).order_by('-created', '-num_wishes' ,'id')
|
||||
else:
|
||||
return models.Work.objects.all().order_by('-created', 'id')
|
||||
|
||||
|
@ -500,11 +493,11 @@ class WorkListView(FilterableListView):
|
|||
context = super(WorkListView, self).get_context_data(**kwargs)
|
||||
qs=self.get_queryset()
|
||||
context['ungluers'] = userlists.work_list_users(qs,5)
|
||||
context['facet'] = self.kwargs['facet']
|
||||
works_unglued = qs.filter(editions__ebooks__isnull=False).distinct() | qs.filter(campaigns__status='SUCCESSFUL').distinct()
|
||||
context['works_unglued'] = works_unglued.order_by('-campaigns__status', 'campaigns__deadline', '-num_wishes')[:20]
|
||||
context['works_active'] = qs.filter(campaigns__status='ACTIVE').distinct()[:20]
|
||||
context['works_wished'] = qs.exclude(editions__ebooks__isnull=False).exclude(campaigns__status='ACTIVE').exclude(campaigns__status='SUCCESSFUL').distinct()[:20]
|
||||
context['facet'] = self.kwargs.get('facet','')
|
||||
works_unglued = qs.exclude(editions__ebooks__isnull=True).distinct() | qs.filter(campaigns__status='SUCCESSFUL').distinct()
|
||||
context['works_unglued'] = works_unglued.order_by('-campaigns__status', 'campaigns__deadline', '-num_wishes')[: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['activetab'] = "#3"
|
||||
|
||||
|
@ -516,6 +509,29 @@ class WorkListView(FilterableListView):
|
|||
|
||||
return context
|
||||
|
||||
class ByPubListView(WorkListView):
|
||||
template_name = "bypub_list.html"
|
||||
context_object_name = "work_list"
|
||||
max_works=100000
|
||||
|
||||
def get_queryset_all(self):
|
||||
facet = self.kwargs.get('facet','')
|
||||
pubname = self.kwargs['pubname']
|
||||
objects = models.Work.objects.filter(editions__publisher__iexact=pubname).distinct()
|
||||
if (facet == 'popular'):
|
||||
return objects.order_by('-num_wishes', 'id')
|
||||
elif (facet == 'pubdate'):
|
||||
return objects.order_by('-editions__publication_date') # turns out this messes up distinct, and MySQL doesn't support DISTINCT ON
|
||||
elif (facet == 'new'):
|
||||
return objects.filter(num_wishes__gt=0).order_by('-created', '-num_wishes' ,'id')
|
||||
else:
|
||||
return objects.order_by('title', 'id')
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(ByPubListView, self).get_context_data(**kwargs)
|
||||
context['pubname'] = self.kwargs['pubname']
|
||||
return context
|
||||
|
||||
class UngluedListView(FilterableListView):
|
||||
template_name = "unglued_list.html"
|
||||
context_object_name = "work_list"
|
||||
|
@ -738,6 +754,7 @@ class PledgeView(FormView):
|
|||
'faqmenu': 'modify' if self.transaction else 'pledge',
|
||||
'transaction': self.transaction,
|
||||
'tid': self.transaction.id if self.transaction else None,
|
||||
'cover_width': cover_width(self.work)
|
||||
})
|
||||
|
||||
return context
|
||||
|
@ -887,7 +904,7 @@ class NonprofitCampaign(FormView):
|
|||
forward['amount']= int(amount)
|
||||
forward['sent']= Sent.objects.create(user=username,amount=form.cleaned_data['preapproval_amount']).pk
|
||||
token=signing.dumps(forward)
|
||||
return HttpResponseRedirect(settings.BASE_URL + reverse('donation_credit',kwargs={'token':token}))
|
||||
return HttpResponseRedirect(settings.BASE_URL_SECURE + reverse('donation_credit',kwargs={'token':token}))
|
||||
|
||||
class DonationCredit(TemplateView):
|
||||
template_name="donation_credit.html"
|
||||
|
@ -1582,12 +1599,14 @@ def wishlist(request):
|
|||
# add related editions asynchronously
|
||||
tasks.populate_edition.delay(edition.isbn_13)
|
||||
request.user.wishlist.add_work(edition.work,'user', notify=True)
|
||||
return HttpResponse('added googlebooks id')
|
||||
except bookloader.LookupFailure:
|
||||
logger.warning("failed to load googlebooks_id %s" % googlebooks_id)
|
||||
return HttpResponse('error addin googlebooks id')
|
||||
except Exception, e:
|
||||
logger.warning("Error in wishlist adding %s" % (e))
|
||||
return HttpResponse('error adding googlebooks id')
|
||||
# TODO: redirect to work page, when it exists
|
||||
return HttpResponseRedirect('/')
|
||||
elif remove_work_id:
|
||||
try:
|
||||
work = models.Work.objects.get(id=int(remove_work_id))
|
||||
|
@ -1597,8 +1616,7 @@ def wishlist(request):
|
|||
except models.WasWork.DoesNotExist:
|
||||
raise Http404
|
||||
request.user.wishlist.remove_work(work)
|
||||
# TODO: where to redirect?
|
||||
return HttpResponseRedirect('/')
|
||||
return HttpResponse('removed work from wishlist')
|
||||
elif add_work_id:
|
||||
# if adding from work page, we have may work.id, not googlebooks_id
|
||||
try:
|
||||
|
@ -1610,7 +1628,7 @@ def wishlist(request):
|
|||
raise Http404
|
||||
|
||||
request.user.wishlist.add_work(work,'user', notify=True)
|
||||
return HttpResponseRedirect('/')
|
||||
return HttpResponse('added work to wishlist')
|
||||
|
||||
class InfoPageView(TemplateView):
|
||||
|
||||
|
@ -1893,7 +1911,21 @@ def clear_wishlist(request):
|
|||
except Exception, e:
|
||||
return HttpResponse("Error in clearing wishlist: %s " % (e))
|
||||
logger.info("Error in clearing wishlist for user %s: %s ", request.user, e)
|
||||
|
||||
|
||||
@require_POST
|
||||
@login_required
|
||||
def msg(request):
|
||||
form = MsgForm(data=request.POST)
|
||||
if form.is_valid():
|
||||
if not request.user.is_staff and request.user not in form.cleaned_data['work'].last_campaign().managers.all():
|
||||
logger.warning("unauthorized attempt to send message by %s for %s"% (request.user,form.cleaned_data['work']))
|
||||
raise Http404
|
||||
supporter_message.send(sender=request.user,msg=form.cleaned_data["msg"], work=form.cleaned_data["work"],supporter=form.cleaned_data["supporter"])
|
||||
return HttpResponse("message sent")
|
||||
else:
|
||||
logger.info("Invalid form for user %s", request.user)
|
||||
raise Http404
|
||||
|
||||
|
||||
class LibraryThingView(FormView):
|
||||
template_name="librarything.html"
|
||||
|
@ -2007,7 +2039,7 @@ def emailshare(request, action):
|
|||
next = form.cleaned_data['next']
|
||||
except:
|
||||
# if we totally failed to have a next value, we should still redirect somewhere useful
|
||||
next = 'http://unglue.it'
|
||||
next = 'https://unglue.it'
|
||||
return HttpResponseRedirect(next)
|
||||
|
||||
else:
|
||||
|
@ -2162,7 +2194,7 @@ def download(request, work_id):
|
|||
'unglued_ebooks': unglued_ebooks,
|
||||
'other_ebooks': other_ebooks,
|
||||
'readmill_epub_url': readmill_epub_url,
|
||||
'base_url': settings.BASE_URL
|
||||
'base_url': settings.BASE_URL_SECURE
|
||||
})
|
||||
|
||||
return render(request, "download.html", context)
|
||||
|
@ -2171,3 +2203,19 @@ def about(request, facet):
|
|||
template = "about_" + facet + ".html"
|
||||
return render(request, template)
|
||||
|
||||
@login_required
|
||||
@csrf_exempt
|
||||
def ml_status(request):
|
||||
return render(request, "ml_status.html")
|
||||
|
||||
@require_POST
|
||||
@login_required
|
||||
def ml_subscribe(request):
|
||||
request.user.profile.ml_subscribe(double_optin=False,send_welcome=True, merge_vars = {"OPTIN_IP":request.META['REMOTE_ADDR'],"OPTIN_TIME":now().isoformat()})
|
||||
return HttpResponseRedirect(reverse("notification_notice_settings"))
|
||||
|
||||
@require_POST
|
||||
@login_required
|
||||
def ml_unsubscribe(request):
|
||||
request.user.profile.ml_unsubscribe()
|
||||
return HttpResponseRedirect(reverse("notification_notice_settings"))
|
||||
|
|
|
@ -565,7 +565,7 @@ class PaymentManager( object ):
|
|||
if return_url is None:
|
||||
return_path = "{0}?{1}".format(reverse('pledge_complete'),
|
||||
urllib.urlencode({'tid':transaction.id}))
|
||||
return_url = urlparse.urljoin(settings.BASE_URL, return_path)
|
||||
return_url = urlparse.urljoin(settings.BASE_URL_SECURE, return_path)
|
||||
|
||||
p = transaction.get_payment_class().Preapproval(transaction, transaction.max_amount, expiry, return_url=return_url, paymentReason=paymentReason)
|
||||
|
||||
|
@ -657,7 +657,7 @@ class PaymentManager( object ):
|
|||
credit.pledge_transaction(t,user,amount)
|
||||
return_path = "{0}?{1}".format(reverse('pledge_complete'),
|
||||
urllib.urlencode({'tid':t.id}))
|
||||
return_url = urlparse.urljoin(settings.BASE_URL, return_path)
|
||||
return_url = urlparse.urljoin(settings.BASE_URL_SECURE, return_path)
|
||||
pledge_created.send(sender=self, transaction=t)
|
||||
return t, return_url
|
||||
else:
|
||||
|
@ -762,7 +762,7 @@ class PaymentManager( object ):
|
|||
credit.pledge_transaction(transaction,transaction.user,amount)
|
||||
return_path = "{0}?{1}".format(reverse('pledge_complete'),
|
||||
urllib.urlencode({'tid':transaction.id}))
|
||||
return_url = urlparse.urljoin(settings.BASE_URL, return_path)
|
||||
return_url = urlparse.urljoin(settings.BASE_URL_SECURE, return_path)
|
||||
|
||||
logger.info("Updated amount of transaction to %f" % amount)
|
||||
pledge_modified.send(sender=self, transaction=transaction,up_or_down=up_or_down)
|
||||
|
|
|
@ -306,8 +306,8 @@ class CreditTest(TestCase):
|
|||
def setUp(self):
|
||||
"""
|
||||
"""
|
||||
self.user1 = User.objects.create_user('credit_test1', 'support@gluejar.com', 'credit_test1')
|
||||
self.user2 = User.objects.create_user('credit_test2', 'support+1@gluejar.com', 'credit_test2')
|
||||
self.user1 = User.objects.create_user('credit_test1', 'support@example.org', 'credit_test1')
|
||||
self.user2 = User.objects.create_user('credit_test2', 'support+1@example.org', 'credit_test2')
|
||||
|
||||
def testSimple(self):
|
||||
"""
|
||||
|
@ -333,7 +333,7 @@ class TransactionTest(TestCase):
|
|||
create a single transaction with PAYMENT_TYPE_AUTHORIZATION / ACTIVE with a $12.34 pledge and see whether the payment
|
||||
manager can query and get the right amount.
|
||||
"""
|
||||
user = User.objects.create_user('payment_test', 'support@gluejar.com', 'payment_test')
|
||||
user = User.objects.create_user('payment_test', 'support@example.org', 'payment_test')
|
||||
|
||||
w = Work()
|
||||
w.save()
|
||||
|
@ -389,9 +389,9 @@ class AccountTest(TestCase):
|
|||
|
||||
def setUp(self):
|
||||
# create a user
|
||||
self.user1 = User.objects.create_user('account_test1', 'account_test1@gluejar.com', 'account_test1_pw')
|
||||
self.user1 = User.objects.create_user('account_test1', 'account_test1@example.org', 'account_test1_pw')
|
||||
self.user1.save()
|
||||
self.user2 = User.objects.create_user('account_test2', 'account_test2@gluejar.com', 'account_test2_pw')
|
||||
self.user2 = User.objects.create_user('account_test2', 'account_test2@example.org', 'account_test2_pw')
|
||||
self.user2.save()
|
||||
self.account1 = Account(host='host1', account_id='1', user=self.user1)
|
||||
self.account1.save()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Django==1.4.2
|
||||
Django==1.4.5
|
||||
Fabric==1.4.3
|
||||
MySQL-python==1.2.3
|
||||
Pillow==1.7.7
|
||||
|
@ -16,7 +16,7 @@ distribute==0.6.28
|
|||
django-celery==3.0.9
|
||||
#django-ckeditor==3.6.2.1
|
||||
git+ssh://git@github.com/Gluejar/django-ckeditor.git@24350a6fba78e38682008e468741661a75483591
|
||||
django-endless-pagination==1.1
|
||||
django-endless-pagination==2.0
|
||||
django-extensions==0.9
|
||||
django-kombu==0.9.4
|
||||
django-maintenancemode==0.10
|
||||
|
@ -26,7 +26,7 @@ git+git://github.com/aladagemre/django-notification.git@2927346f4c513a217ac8ad07
|
|||
django-registration==0.8
|
||||
django-selectable==0.5.2
|
||||
django-smtp-ssl==1.0
|
||||
django-social-auth==0.7.5
|
||||
django-social-auth==0.7.20
|
||||
django-storages==1.1.6
|
||||
django-tastypie==0.9.11
|
||||
feedparser==5.1.2
|
||||
|
@ -39,6 +39,7 @@ mimeparse==0.1.3
|
|||
nose==1.1.2
|
||||
oauth2==1.5.211
|
||||
paramiko==1.7.7.2
|
||||
postmonkey==1.0a4
|
||||
pyasn1==0.1.4
|
||||
pycrypto==2.6
|
||||
python-dateutil==2.1
|
||||
|
|
|
@ -119,6 +119,7 @@ INSTALLED_APPS = (
|
|||
'django.contrib.contenttypes',
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.sites',
|
||||
'django.contrib.sitemaps',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'django.contrib.comments',
|
||||
|
@ -209,6 +210,12 @@ AUTHENTICATION_BACKENDS = (
|
|||
SOCIAL_AUTH_ENABLED_BACKENDS = ['google', 'facebook', 'twitter']
|
||||
SOCIAL_AUTH_ASSOCIATE_BY_MAIL = True
|
||||
SOCIAL_AUTH_NEW_USER_REDIRECT_URL = '/'
|
||||
# following is needed because of length limitations in a unique constrain for MySQL
|
||||
# see https://github.com/omab/django-social-auth/issues/539
|
||||
SOCIAL_AUTH_UID_LENGTH = 222
|
||||
SOCIAL_AUTH_NONCE_SERVER_URL_LENGTH = 200
|
||||
SOCIAL_AUTH_ASSOCIATION_SERVER_URL_LENGTH = 135
|
||||
SOCIAL_AUTH_ASSOCIATION_HANDLE_LENGTH = 125
|
||||
|
||||
TWITTER_EXTRA_DATA = [('profile_image_url', 'profile_image_url')]
|
||||
|
||||
|
@ -216,7 +223,7 @@ LOGIN_URL = "/accounts/login/"
|
|||
LOGIN_REDIRECT_URL = "/"
|
||||
LOGOUT_URL = "/accounts/logout/"
|
||||
|
||||
USER_AGENT = "unglue.it.bot v0.0.1 <http://unglue.it>"
|
||||
USER_AGENT = "unglue.it.bot v0.0.1 <https://unglue.it>"
|
||||
|
||||
SOUTH_TESTS_MIGRATE = True
|
||||
|
||||
|
@ -287,6 +294,8 @@ NOTIFY_ENDING_SOON_JOB = {
|
|||
|
||||
# by default, in common, we don't turn any of the celerybeat jobs on -- turn them on in the local settings file
|
||||
|
||||
# set notification queueing on
|
||||
NOTIFICATION_QUEUE_ALL = True
|
||||
# amazon or paypal for now.
|
||||
PAYMENT_PROCESSOR = 'stripelib'
|
||||
|
||||
|
@ -314,4 +323,5 @@ AWS_ACCESS_KEY_ID = ''
|
|||
AWS_SECRET_ACCESS_KEY = ''
|
||||
AWS_STORAGE_BUCKET_NAME = ''
|
||||
|
||||
|
||||
MAILCHIMP_API_KEY = '5f8e846a2bbc847807ed89086de4b4bf-us2'
|
||||
MAILCHIMP_NEWS_ID = u'c5cce92fe1'
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
.header-text{height:36px;line-height:36px;display:block;text-decoration:none;font-weight:bold;letter-spacing:-0.05em}.panelborders{border-width:1px 0;border-style:solid none;border-color:#fff}.roundedspan{border:1px solid #d4d4d4;-moz-border-radius:7px;-webkit-border-radius:7px;border-radius:7px;padding:1px;color:#fff;margin:0 8px 0 0;display:inline-block}.roundedspan>span{padding:7px 7px;min-width:15px;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;text-align:center;display:inline-block}.roundedspan>span .hovertext{display:none}.roundedspan>span:hover .hovertext{display:inline}.mediaborder{padding:5px;border:solid 5px #edf3f4}.actionbuttons{width:auto;height:36px;line-height:36px;background:#8dc63f;-moz-border-radius:32px;-webkit-border-radius:32px;border-radius:32px;color:white;cursor:pointer;font-size:13px;font-weight:bold;padding:0 15px;border:0;margin:5px 0}.errors{-moz-border-radius:16px 16px 0 0;-webkit-border-radius:16px 16px 0 0;border-radius:16px 16px 0 0;border:solid #e35351 3px;clear:both;width:90%;height:auto;line-height:16px;padding:7px 0;font-weight:bold;font-size:13px;text-align:center}.errors li{list-style:none;border:0}.notices_menu{float:right;-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;background:#edf3f4;padding:10px 20px;margin:-15px auto 7px 7px}.notices_menu a{font-size:13px;font-weight:bold}#js-main-container{float:none!important;padding-right:15px}th{text-align:left}tr{line-height:24px}tr.row1{background:#edf3f4}td{padding-left:7px;padding-right:7px}td#last{padding:0}input[type="submit"]{float:right;margin-right:0}.comments{border:solid 3px #d6dde0;margin:3px auto}.comments hr{margin:10px auto 5px;color:#d6dde0;background-color:#d6dde0;height:2px;border:0}.comments .comments_book{padding:5px;border:solid 5px #edf3f4;margin-right:10px;margin-bottom:10px;max-width:80px}.comments .comments_book img{max-width:80px}.comments .comments_textual{padding:10px 5px 5px}.comments .comments_textual div{margin-bottom:5px}.comments .comments_info{border-bottom:solid 1px #d6dde0;padding:5px}.comments .comments_info div{float:left}.comments .comments_info .comments_graphical{padding:5px auto}.comments .comments_info span{text-indent:0}
|
||||
.header-text{height:36px;line-height:36px;display:block;text-decoration:none;font-weight:bold;letter-spacing:-0.05em}.panelborders{border-width:1px 0;border-style:solid none;border-color:#fff}.roundedspan{border:1px solid #d4d4d4;-moz-border-radius:7px;-webkit-border-radius:7px;border-radius:7px;padding:1px;color:#fff;margin:0 8px 0 0;display:inline-block}.roundedspan>span{padding:7px 7px;min-width:15px;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;text-align:center;display:inline-block}.roundedspan>span .hovertext{display:none}.roundedspan>span:hover .hovertext{display:inline}.mediaborder{padding:5px;border:solid 5px #edf3f4}.actionbuttons{width:auto;height:36px;line-height:36px;background:#8dc63f;-moz-border-radius:32px;-webkit-border-radius:32px;border-radius:32px;color:white;cursor:pointer;font-size:13px;font-weight:bold;padding:0 15px;border:0;margin:5px 0}.errors{-moz-border-radius:16px 16px 0 0;-webkit-border-radius:16px 16px 0 0;border-radius:16px 16px 0 0;border:solid #e35351 3px;clear:both;width:90%;height:auto;line-height:16px;padding:7px 0;font-weight:bold;font-size:13px;text-align:center}.errors li{list-style:none;border:0}.notices_menu{float:right;-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;background:#edf3f4;padding:10px 20px;margin:-15px auto 7px 7px}.notices_menu a{font-size:13px;font-weight:bold}#js-main-container{float:none!important;padding-right:15px}th{text-align:left}tr{line-height:24px}tr.row1{background:#edf3f4}td{padding-left:7px;padding-right:7px}td#last{padding:0}table input[type="submit"]{float:right;margin-right:0}.comments{border:solid 3px #d6dde0;margin:3px auto}.comments hr{margin:10px auto 5px;color:#d6dde0;background-color:#d6dde0;height:2px;border:0}.comments .comments_book{padding:5px;border:solid 5px #edf3f4;margin-right:10px;margin-bottom:10px;max-width:80px}.comments .comments_book img{max-width:80px}.comments .comments_textual{padding:10px 5px 5px}.comments .comments_textual div{margin-bottom:5px}.comments .comments_info{border-bottom:solid 1px #d6dde0;padding:5px}.comments .comments_info div{float:left}.comments .comments_info .comments_graphical{padding:5px auto}.comments .comments_info span{text-indent:0}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,61 +1,104 @@
|
|||
var $j = jQuery.noConflict();
|
||||
$j(document).ready(function(){
|
||||
// caching the selections to speed up response
|
||||
var tabs = $j('#tabs');
|
||||
var tabs1 = $j('li.tabs1');
|
||||
var tabs2 = $j('li.tabs2');
|
||||
var tabs3 = $j('li.tabs3');
|
||||
var tabs4 = $j('li.tabs4');
|
||||
var tabId1 = $j('#tabs-1');
|
||||
var tabId2 = $j('#tabs-2');
|
||||
var tabId3 = $j('#tabs-3');
|
||||
var tabId4 = $j('#tabs-4');
|
||||
var contentBlockContent = $j('#content-block-content');
|
||||
|
||||
var $j = jQuery.noConflict();
|
||||
$j(document).ready(function(){
|
||||
// caching the selections to speed up response
|
||||
var tabs = $j('#tabs');
|
||||
var tabs1 = $j('li.tabs1');
|
||||
var tabs2 = $j('li.tabs2');
|
||||
var tabs3 = $j('li.tabs3');
|
||||
var tabs4 = $j('li.tabs4');
|
||||
var tabId1 = $j('#tabs-1');
|
||||
var tabId2 = $j('#tabs-2');
|
||||
var tabId3 = $j('#tabs-3');
|
||||
var tabId4 = $j('#tabs-4');
|
||||
var contentBlockContent = $j('#content-block-content');
|
||||
|
||||
tabs1.click(function(){
|
||||
tabs.find('.active').removeClass('active');
|
||||
$j(this).addClass('active');
|
||||
contentBlockContent.find('div.active').removeClass('active');
|
||||
tabId1.addClass('active').show(300);
|
||||
tabId2.hide(200);
|
||||
tabId3.hide(200);
|
||||
tabId4.hide(200);
|
||||
});
|
||||
tabs2.click(function(){
|
||||
tabs.find('.active').removeClass('active');
|
||||
$j(this).addClass('active');
|
||||
contentBlockContent.find('div.active').removeClass('active');
|
||||
tabId2.addClass('active').show(300);
|
||||
tabId1.hide(200);
|
||||
tabId3.hide(200);
|
||||
tabId4.hide(200);
|
||||
});
|
||||
tabs3.click(function(){
|
||||
tabs.find('.active').removeClass('active');
|
||||
$j(this).addClass('active');
|
||||
contentBlockContent.find('div.active').removeClass('active');
|
||||
tabId3.addClass('active').show(300);
|
||||
tabId2.hide(200);
|
||||
tabId1.hide(200);
|
||||
tabId4.hide(200);
|
||||
});
|
||||
tabs4.click(function(){
|
||||
tabs.find('.active').removeClass('active');
|
||||
$j(this).addClass('active');
|
||||
contentBlockContent.find('div.active').removeClass('active');
|
||||
tabId4.addClass('active').show(300);
|
||||
tabId2.hide(200);
|
||||
tabId1.hide(200);
|
||||
tabId3.hide(200);
|
||||
});
|
||||
$j('.findtheungluers').click(function(){
|
||||
tabs.find('.active').removeClass('active');
|
||||
$j('#supporters').addClass('active');
|
||||
contentBlockContent.find('div.active').removeClass('active');
|
||||
tabId3.addClass('active').show(300);
|
||||
tabId2.hide(200);
|
||||
tabId1.hide(200);
|
||||
tabId4.hide(200);
|
||||
});
|
||||
});
|
||||
tabs1.click(function(){
|
||||
tabs.find('.active').removeClass('active');
|
||||
$j(this).addClass('active');
|
||||
contentBlockContent.find('div.active').removeClass('active');
|
||||
tabId1.addClass('active').show(300);
|
||||
tabId2.hide(200);
|
||||
tabId3.hide(200);
|
||||
tabId4.hide(200);
|
||||
});
|
||||
tabs2.click(function(){
|
||||
tabs.find('.active').removeClass('active');
|
||||
$j(this).addClass('active');
|
||||
contentBlockContent.find('div.active').removeClass('active');
|
||||
tabId2.addClass('active').show(300);
|
||||
tabId1.hide(200);
|
||||
tabId3.hide(200);
|
||||
tabId4.hide(200);
|
||||
});
|
||||
tabs3.click(function(){
|
||||
tabs.find('.active').removeClass('active');
|
||||
$j(this).addClass('active');
|
||||
contentBlockContent.find('div.active').removeClass('active');
|
||||
tabId3.addClass('active').show(300);
|
||||
tabId2.hide(200);
|
||||
tabId1.hide(200);
|
||||
tabId4.hide(200);
|
||||
});
|
||||
tabs4.click(function(){
|
||||
tabs.find('.active').removeClass('active');
|
||||
$j(this).addClass('active');
|
||||
contentBlockContent.find('div.active').removeClass('active');
|
||||
tabId4.addClass('active').show(300);
|
||||
tabId2.hide(200);
|
||||
tabId1.hide(200);
|
||||
tabId3.hide(200);
|
||||
});
|
||||
$j('.findtheungluers').click(function(){
|
||||
tabs.find('.active').removeClass('active');
|
||||
$j('#supporters').addClass('active');
|
||||
contentBlockContent.find('div.active').removeClass('active');
|
||||
tabId3.addClass('active').show(300);
|
||||
tabId2.hide(200);
|
||||
tabId1.hide(200);
|
||||
tabId4.hide(200);
|
||||
});
|
||||
$j('.show_supporter_contact_form').click(function(){
|
||||
if ($j(this).parents(".work_supporter_wide").next().html() == ''){
|
||||
$j('div.supporter_contact_form').html('').hide();
|
||||
$j('input.supporter_contact_form').hide();
|
||||
$j(this).parents(".work_supporter_wide").next().html('<br /><textarea name="msg" rows="4" cols="60" \>');
|
||||
$j(this).parent().nextUntil('.work_supporter_wide').show();
|
||||
} else {
|
||||
$j('div.supporter_contact_form').html('');
|
||||
$j('input.supporter_contact_form').hide();
|
||||
}
|
||||
});
|
||||
$j('#contact_form').submit(function(){
|
||||
var theTextarea = $j(this).find("textarea")
|
||||
var theInput = theTextarea.parent().next();
|
||||
var supporter_id = theInput.attr("name").substring(4);
|
||||
var msgReq = jQuery.post('/msg/', $j(this).serialize()+'&supporter='+supporter_id)
|
||||
.done(function() {
|
||||
theTextarea.parent().prev().find(".info_for_managers").append("<div class='contact_form_result'>Message Sent<br /></div>");
|
||||
theInput.hide();
|
||||
theTextarea.hide();
|
||||
})
|
||||
.fail(function() {
|
||||
theTextarea.parent().prev().find(".info_for_managers").append("<div class='contact_form_result'>Couldn't Send Message<br /></div>");
|
||||
theInput.hide();
|
||||
theTextarea.hide();
|
||||
});
|
||||
|
||||
return false;
|
||||
})
|
||||
$j('.show_more_edition').click(function(){
|
||||
if ($j(this).html() == 'less...') {
|
||||
$j(this).html('more...')
|
||||
} else {
|
||||
$j(this).html('less...')
|
||||
}
|
||||
$j(this).next().toggle();
|
||||
});
|
||||
var img = $j('#book-detail-img');
|
||||
var googimg = $j('#find-google img');
|
||||
img.mouseover(function(){
|
||||
googimg.css({"background": "#8dc63f"}).animate(
|
||||
{backgroundColor: "white"}, 1500
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -58,36 +58,16 @@
|
|||
float: left;
|
||||
width: auto;
|
||||
padding-bottom: 7px;
|
||||
}
|
||||
|
||||
div.btn_support {
|
||||
float: right;
|
||||
margin-top: 9px;
|
||||
|
||||
input {
|
||||
font-size: @font-size-larger;
|
||||
}
|
||||
|
||||
&.modify input {
|
||||
background:@blue-grey;
|
||||
font-size: @font-size-default;
|
||||
border: double white;
|
||||
line-height: 17px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn_wishlist span {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.find-book {
|
||||
margin-top:15px;
|
||||
|
||||
label {
|
||||
float:left;
|
||||
line-height:31px;
|
||||
}
|
||||
.find-book label {
|
||||
float:left;
|
||||
line-height:31px;
|
||||
}
|
||||
|
||||
.find-link {
|
||||
|
@ -100,13 +80,80 @@
|
|||
}
|
||||
|
||||
.pledged-info {
|
||||
padding:0;
|
||||
padding:10px 0;
|
||||
position: relative;
|
||||
|
||||
&.noborder {
|
||||
border-top: none;
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.campaign-status-info {
|
||||
float: left;
|
||||
width: 50%;
|
||||
margin-top: @font-size-default;
|
||||
|
||||
span {
|
||||
font-size: @font-size-larger;
|
||||
color: @medium-blue;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.pledged-group {
|
||||
padding:10px 40px 10px 0;
|
||||
float:left;
|
||||
.thermometer {
|
||||
.one-border-radius(10px);
|
||||
border: solid 2px @blue-grey;
|
||||
width: 291px;
|
||||
padding: 7px;
|
||||
position: relative;
|
||||
overflow: visible;
|
||||
|
||||
/* looks better if we start the gradient a little closer to the success color */
|
||||
@greener-than-alert: #CF6944;
|
||||
|
||||
background: -webkit-gradient(linear, left top, right top, from(@call-to-action), to(@greener-than-alert));
|
||||
background: -webkit-linear-gradient(left, @greener-than-alert, @call-to-action);
|
||||
background: -moz-linear-gradient(left, @greener-than-alert, @call-to-action);
|
||||
background: -ms-linear-gradient(left, @greener-than-alert, @call-to-action);
|
||||
background: -o-linear-gradient(left, @greener-than-alert, @call-to-action);
|
||||
background: linear-gradient(left, @greener-than-alert, @call-to-action);
|
||||
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='@alert', endColorstr='@call-to-action'); /* IE6 & IE7 */
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='@alert', endColorstr='@call-to-action')"; /* IE8+ */
|
||||
|
||||
&.successful {
|
||||
border-color: @bright-blue;
|
||||
background: @pale-blue;
|
||||
}
|
||||
|
||||
.cover {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
.border-radius(0, 10px, 10px, 0);
|
||||
width: 50px;
|
||||
height: 14px;
|
||||
margin-top: -7px;
|
||||
background: lighten(@blue-grey, 10%);
|
||||
}
|
||||
|
||||
span {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&:hover span {
|
||||
display: block;
|
||||
position: absolute;
|
||||
z-index: 200;
|
||||
right: 0;
|
||||
top:-7px;
|
||||
font-size: @font-size-header;
|
||||
color: @medium-blue;
|
||||
background: white;
|
||||
border: 2px solid @blue-grey;
|
||||
.one-border-radius(10px);
|
||||
padding: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.status {
|
||||
|
|
|
@ -201,7 +201,46 @@ div#content-block-content {
|
|||
min-width: 235px;
|
||||
float: left;
|
||||
}
|
||||
.show_supporter_contact_form
|
||||
{
|
||||
display:block;
|
||||
margin-left: 5px;
|
||||
float: right;
|
||||
}
|
||||
.supporter_contact_form
|
||||
{
|
||||
display:none;
|
||||
margin-left: 5px;
|
||||
}
|
||||
.contact_form_result
|
||||
{
|
||||
display:block;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.work_supporter_wide
|
||||
{
|
||||
display: block;
|
||||
height: 65px;
|
||||
margin-top: 5px;
|
||||
float: none;
|
||||
margin-left: 5px;
|
||||
}
|
||||
.info_for_managers
|
||||
{
|
||||
display: block;
|
||||
}
|
||||
.show_supporter_contact_form
|
||||
{
|
||||
cursor:pointer;
|
||||
opacity:0.5
|
||||
|
||||
}
|
||||
.show_supporter_contact_form:hover
|
||||
{
|
||||
cursor:pointer;
|
||||
opacity:1
|
||||
}
|
||||
.official {
|
||||
border: 3px @bright-blue solid;
|
||||
padding: 3px;
|
||||
|
@ -259,6 +298,18 @@ div#content-block-content {
|
|||
}
|
||||
|
||||
/* Right column */
|
||||
|
||||
/* Right - add/remove actions below big green button */
|
||||
#js-rightcol {
|
||||
.add-wishlist, .on-wishlist, .create-account {
|
||||
float: none;
|
||||
}
|
||||
|
||||
.on-wishlist {
|
||||
margin-left: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
#js-rightcol, #pledge-rightcol {
|
||||
float:right;
|
||||
width:235px;
|
||||
|
@ -308,6 +359,57 @@ div#content-block-content {
|
|||
padding:10px;
|
||||
}
|
||||
|
||||
.btn_support {
|
||||
margin: 10px;
|
||||
width: 215px;
|
||||
|
||||
a, form input, > span {
|
||||
font-size: @font-size-shout;
|
||||
border: 4px solid @blue-grey;
|
||||
.one-border-radius(10px);
|
||||
display: block;
|
||||
text-align: center;
|
||||
padding-top: @font-size-header*.75;
|
||||
padding-bottom: @font-size-header*.75;
|
||||
background-color: @call-to-action;
|
||||
|
||||
span {
|
||||
color: white !important;
|
||||
font-weight: bold;
|
||||
padding-left: 0;
|
||||
margin-left: 0 !important;
|
||||
background: none;
|
||||
}
|
||||
}
|
||||
|
||||
&.create-account span {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
background: none;
|
||||
}
|
||||
|
||||
a:hover, form input:hover {
|
||||
background-color: darken(@call-to-action, 7%);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a {
|
||||
width: 207px;
|
||||
}
|
||||
|
||||
form input {
|
||||
width: 215px;
|
||||
}
|
||||
|
||||
&.modify a, &.modify form input {
|
||||
background-color: @medium-blue-grey;
|
||||
|
||||
&:hover {
|
||||
background-color: darken(@medium-blue-grey, 7%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Right column - support tiers */
|
||||
ul.support li {
|
||||
border-bottom:1px solid @blue-grey;
|
||||
|
|
|
@ -40,7 +40,7 @@ td {
|
|||
}
|
||||
}
|
||||
|
||||
input[type="submit"] {
|
||||
table input[type="submit"] {
|
||||
float: right;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
|
|
@ -201,7 +201,7 @@ span.menu-item-price {
|
|||
padding: 10px;
|
||||
|
||||
div.innards {
|
||||
input[type="text"] {
|
||||
input[type="text"],input[type="password"] {
|
||||
font-size: @font-size-larger;
|
||||
line-height: @font-size-larger*1.5;
|
||||
border-width: 2px;
|
||||
|
|
|
@ -28,6 +28,11 @@
|
|||
border-color: @blue-grey;
|
||||
font-size: @font-size-default;
|
||||
}
|
||||
|
||||
&.alert {
|
||||
border-color: @alert;
|
||||
font-size: @font-size-default;
|
||||
}
|
||||
}
|
||||
|
||||
.preview_content {
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
@font-size-default: 13px;
|
||||
@font-size-larger: 15px;
|
||||
@font-size-header: 19px;
|
||||
@font-size-shout: 22px;
|
||||
@link-color: #6994a3;
|
||||
|
||||
.header-text {
|
||||
|
|
11
urls.py
11
urls.py
|
@ -3,6 +3,12 @@ from frontend.forms import ProfileForm
|
|||
from django.views.generic.simple import direct_to_template
|
||||
from regluit.admin import admin_site
|
||||
import notification.urls
|
||||
from regluit.core.sitemaps import WorkSitemap, PublisherSitemap
|
||||
|
||||
sitemaps = {
|
||||
'works': WorkSitemap,
|
||||
'publishers': PublisherSitemap,
|
||||
}
|
||||
|
||||
urlpatterns = patterns('',
|
||||
url(r'^accounts/activate/complete/$','django.contrib.auth.views.login',
|
||||
|
@ -23,3 +29,8 @@ urlpatterns = patterns('',
|
|||
(r'^notification/', include(notification.urls)),
|
||||
(r'^ckeditor/', include('ckeditor.urls')),
|
||||
)
|
||||
|
||||
urlpatterns += patterns('django.contrib.sitemaps.views',
|
||||
(r'^sitemap\.xml$', 'index', {'sitemaps': sitemaps}),
|
||||
(r'^sitemap-(?P<section>.+)\.xml$', 'sitemap', {'sitemaps': sitemaps}),
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue