resolve conflict

pull/1/head
eric 2012-09-07 16:26:09 -04:00
commit 4700e63b06
35 changed files with 1216 additions and 147 deletions

View File

@ -11,12 +11,14 @@ from django.conf import settings
from django.contrib.comments.models import Comment
from django.contrib.contenttypes.models import ContentType
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
from regluit.core.models import Campaign, Work, UnglueitError, Edition, RightsHolder, Claim, Key, Ebook
from regluit.core import bookloader, models, search, goodreads, librarything
from regluit.core import isbn
from regluit.payment.parameters import PAYMENT_TYPE_AUTHORIZATION
from regluit.frontend.views import safe_get_work
from regluit.core import tasks
from celery.task.sets import TaskSet
@ -590,4 +592,47 @@ class EncryptedKeyTest(TestCase):
self.assertEqual(Key.objects.filter(name=name)[0].value, value)
# just checking that the encrypted value is not the same as the value
self.assertNotEqual(key.encrypted_value, value) # is this always true?
class SafeGetWorkTest(TestCase):
def test_good_work(self):
w1 = models.Work()
w1.save()
w2 = models.Work()
w2.save()
w2_id = w2.id
bookloader.merge_works(w1, w2)
work = safe_get_work(w1.id)
self.assertEqual(work, w1)
work = safe_get_work(w2_id)
self.assertEqual(work, w1)
self.assertRaises(Http404, safe_get_work, 3)
class DownloadPageTest(TestCase):
def test_download_page(self):
w = models.Work()
w.save()
e1 = models.Edition()
e1.work = w
e2 = models.Edition()
e2.work = w
e1.save()
e2.save()
eb1 = models.Ebook()
eb1.url = "http://example.com"
eb1.edition = e1
eb1.unglued = True
eb2 = models.Ebook()
eb2.url = "http://example2.com"
eb2.edition = e2
eb1.save()
eb2.save()
anon_client = Client()
response = anon_client.get("/work/%s/download/" % w.id)
self.assertContains(response, "http://example.com", count=2)
self.assertContains(response, "http://example2.com", count=2)

View File

@ -1,3 +1,9 @@
{% extends "base.html" %}
{% block content %}
<div class="nonlightbox">
<div id="lightbox_content">
<div class="clearfix about_page">
<p>
Do you have a <b>book you love so much</b> you'd like to give it to the world? These are the books that <span class="ungluer"></span> is helping to give to the world, right now.
</p>
@ -12,4 +18,10 @@
</p>
<p class="last">
What if you could <b>unglue it</b>?
</p>
</p>
{% include "about_lightbox_footer.html" %}
</div>
</div>
</div>
{% endblock %}

View File

@ -1,3 +1,9 @@
{% extends "base.html" %}
{% block content %}
<div class="nonlightbox">
<div id="lightbox_content">
<div class="clearfix about_page">
<p>
Do you have a <b>book you love so much</b> you'd like to give it to the world? At Unglue.it, you can.
</p>
@ -12,4 +18,10 @@
</p>
<p class="last">
What if you could <b>unglue it</b>?
</p>
</p>
{% include "about_lightbox_footer.html" %}
</div>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,8 @@
<div class="right_border"><a href="{{ faqurl }}">Read the FAQ</a></div>
<div class="right_border"><a href="{% url faq_location 'rightsholders' %}">Read the FAQ for authors and publishers</a></div>
<div class="right_border"><a href="{% url press %}">Our press coverage</a></div>
{% if not user.is_authenticated %}
<div class="signuptoday"><a href="{% url registration_register %}">Sign up today</a></div>
{% else %}
<div class="signuptoday"><a href="{% url campaign_list 'ending' %}">Our campaigns</a></div>
{% endif %}

View File

@ -1,3 +1,9 @@
{% extends "base.html" %}
{% block content %}
<div class="nonlightbox">
<div id="lightbox_content">
<div class="clearfix about_page">
<p>
<b>What if you could</b> give a book to everyone on earth? Get an ebook and read it on any device, in any format, forever? Give an ebook to your library, for them to share? Own DRM-free ebooks, legally? Read free ebooks, and know their creators had been fairly paid?
</p>
@ -12,4 +18,10 @@
</p>
<p class="last">
What if you could <b>unglue it</b>?
</p>
</p>
{% include "about_lightbox_footer.html" %}
</div>
</div>
</div>
{% endblock %}

View File

@ -1,3 +1,9 @@
{% extends "base.html" %}
{% block content %}
<div class="nonlightbox">
<div id="lightbox_content">
<div class="clearfix about_page">
<p>
Imagine if <b>you could give your favorite book</b> to everyone on earth. Imagine if they all had a copy that they could read anywhere, anytime, on their favorite devices, with no DRM. That they could share with their friends, freely and legally. And imagine that your favorite book's creators still got paid.
</p>
@ -12,4 +18,10 @@
</p>
<p class="last">
What if you could <b>unglue it</b>?
</p>
</p>
{% include "about_lightbox_footer.html" %}
</div>
</div>
</div>
{% endblock %}

View File

@ -1,3 +1,9 @@
{% extends "base.html" %}
{% block content %}
<div class="nonlightbox">
<div id="lightbox_content">
<div class="clearfix about_page">
<p>
Imagine if <b>you could give your favorite book</b> to everyone on earth. Imagine if they all had a copy that they could read anywhere, anytime, on their favorite devices, with no DRM. That they could share with their friends, freely and legally. And imagine that your favorite book's creators still got paid.
</p>
@ -12,4 +18,10 @@
</p>
<p class="last">
What if you could <b>unglue it</b>?
</p>
</p>
{% include "about_lightbox_footer.html" %}
</div>
</div>
</div>
{% endblock %}

View File

@ -1,4 +1,10 @@
<p>
{% extends "base.html" %}
{% block content %}
<div class="nonlightbox">
<div id="lightbox_content">
<div class="clearfix about_page">
<p>
Do you have a <b>book you love so much</b> you'd like to give it to the world? These are the books that <span class="ungluer"></span> wants to give to the world.
</p>
<p>
@ -13,3 +19,9 @@
<p class="last">
What if you could <b>unglue it</b>?
</p>
{% include "about_lightbox_footer.html" %}
</div>
</div>
</div>
{% endblock %}

View File

@ -1,3 +1,9 @@
{% extends "base.html" %}
{% block content %}
<div class="nonlightbox">
<div id="lightbox_content">
<div class="clearfix about_page">
<p>
Do you have a <b>book you love so much</b> you'd like to give it to the world?
</p>
@ -13,3 +19,9 @@
<p class="last">
What if you could <b>unglue it</b>?
</p>
{% include "about_lightbox_footer.html" %}
</div>
</div>
</div>
{% endblock %}

View File

@ -22,7 +22,7 @@
{% block base_js %}
<script type="text/javascript" src="{{ jquery_home }}"></script>
{% endblock %}
<script type="text/javascript" src="/static/js/expand_about.js"></script>
<script type="text/javascript" src="/static/js/hijax.js"></script>
{% block extra_js %}
{% endblock %}
<script type="text/javascript" src="/static/js/watermark_init.js"></script>
@ -50,16 +50,8 @@
<div id="about_expandable">
<div id="about_collapser" class="collapser_x">X</div>
<div id="lightbox">
<!-- content will be inserted here by expand_about.js -->
<!-- content will be inserted here by hijax.js -->
</div>
<div class="right_border"><a href="{{ faqurl }}">Read the FAQ</a></div>
<div class="right_border"><a href="{% url faq_location 'rightsholders' %}">Read the FAQ for authors and publishers</a></div>
<div class="right_border"><a href="{% url press %}">Our press coverage</a></div>
{% if not user.is_authenticated %}
<div class="signuptoday"><a href="{% url registration_register %}">Sign up today</a></div>
{% else %}
<div class="signuptoday"><a href="{% url campaign_list 'ending' %}">Our campaigns</a></div>
{% endif %}
</div>
<div id="js-page-wrap">
@ -97,7 +89,7 @@
{% else %}
<li class="first"><a href="{% url auth_login %}?next={% firstof request.path '/' %}"><span>Sign In</span></a></li>
{% endif %}
<li class="about_expander" id="about_main"><a href="#"><span>About</span></a></li>
<li><a href="/about/main/" class="hijax"><span>About</span></a></li>
<li><a href="{{ landingurl }}"><span>Home</span></a></li>
{% if not user.is_authenticated %}
<li class="last" id="expander"><a href="{% url registration_register %}"><span>sign up</span></a></li>

View File

@ -22,7 +22,7 @@
<p><b>On:</b> {{ deadline|date:"M d, Y" }}</p>
<p><b>Raised:</b> {{ work.last_campaign.current_total|floatformat:0|intcomma }}</p>
{% if first_ebook %}
<a href="{{ work.ebooks.0.url }}"><div class="read_itbutton"><span>Read it Now</span></div></a>
<a href="{% url download workid %}" class="hijax"><div class="read_itbutton"><span>Read it Now</span></div></a>
{% else %}
<div class="read_itbutton"><span>Coming Soon</span></div>
{% endif %}

View File

@ -0,0 +1,114 @@
{% extends "base.html" %}
{% with work.title as title %}
{% block title %}
&mdash; Downloads for {{ work.title }}
{% endblock %}
{% block extra_js %}
<script type="text/javascript" src="/static/js/wishlist.js"></script>
{% endblock %}
{% block content %}
<div class="download_container">
<div id="lightbox_content">
<h2>Downloads for {{ work.title }}</h2>
{% if unglued_ebook %}
<div class="unglued">
<h3>Read the unglued edition!</h3>
<div class="ebook_download">
{% with unglued_ebook.url as url %}
<a href="{{ url }}"><img src="{{ unglued_ebook.rights_badge }}"></a>
<a href="{{ url }}">{{ unglued_ebook.format }}</a>
{% endwith %}
</div>
</div>
{% endif %}
{% if other_ebooks %}
{% if unglued_ebook %}<h4>Freely available editions</h4>{% endif %}
{% comment %}
the header is only necessary if we have an unglued edition we're distinguishing
non-unglued editions from
{% endcomment %}
{% for edition in other_ebooks %}
<div class="ebook_download clearfix">
{% with edition.url as url %}
<a href="{{ url }}"><img src="{{ edition.rights_badge }}"></a>
<a href="{{ url }}">{{ edition.format }}</a>
{% endwith %}
</div>
{% endfor %}
{% endif %}
{% if unglued_ebook or other_ebooks %}
<h3>How to download</h3>
<p>Ebooks you find at Unglue.it may be read on any device, and you're welcome to convert them to whatever electronic format is most useful to you. While we can't cover every possible combination of readers, software, and formats you might use, here's some help for the most common cases.</p>
<h4>Any device</h4>
<p>You may already have an app which reads our ebook formats. If so, when you download the file, you will be given an option to open the file using that app. You're done!</p>
<p>If this doesn't work, use the instructions below for your device.</p>
<h4>Android devices</h4>
<p class="ebook_download logo"><img src="/static/images/aldiko_logo.png">Aldiko</p>
<ul>
<li><a href="http://www.aldiko.com/download.html">Download the free Aldiko app.</a></li>
<li>Download your book from this page using your device's web browser.</li>
<li>You can read HTML files right in the browser. For other formats, you will be given the option of opening the file in Aldiko.</li>
</ul>
{% comment %}
this doesn't seem to work. i get only browser and IndieBound reader as options on my phone. perhaps I should recommend IBReader instead?
{% endcomment %}
<h4>iOS devices</h4>
<p class="ebook_download logo"><img src="/static/images/ibooks_logo.jpeg">iBooks</p>
{% comment %}test{% endcomment %}
<ul>
<li><a href="http://itunes.apple.com/us/app/ibooks/id364709193?mt=8">Download the free iBooks app</a> from the App Store.</li>
<li>Download your book from this page using your device's web browser.</li>
<li>You can read HTML files right in the browser. For other formats, you will be given the option of opening the file in iBooks.</li>
</ul>
<h4>PC, Mac, or Linux</h4>
<p class="ebook_download logo"><img src="/static/images/calibre_logo.png">Calibre</p>
<ul>
<li><a href="http://calibre-ebook.com/download">Download the free Calibre app.</a></li>
<li>Download your book from this page using your device's web browser.</li>
<li>Open the ebook file in Calibre.</li>
</ul>
<h4>Ereaders</h4>
<p>If you'd like to read epub files on a Kindle or Kindle Fire, you'll need to follow the "Converting epubs for Kindle" instructions below, and then the instructions here. To read mobi files on a Kindle, or any ebooks on other ereaders, use these instructions.</p>
<ul>
<li>Download the ebook to a laptop or desktop computer.</li>
<li>Plug the ereader into your computer with a USB cable.</li>
<li>Using the Finder (Mac) or Windows Explorer (Windows), drag and drop the ebook file into the Documents folder on your device. (It may also be called My Documents or My Stuff, depending on your ereader.) If you have downloaded Calibre, you can also use its "Send to Device" button.</li>
<li>Eject your device from the Finder or Explorer and disconnect the USB.</li>
<li>You may need to reboot your device to see the new book.</li>
</ul>
<h4>Converting epubs for Kindle</h4>
<p>Kindles can read plain text, MOBI, PDF, and HTML files. They cannot read epub books (the format unglued ebooks are released in). However, you can convert epubs to mobi files using free software.</p>
<ul>
<li><a href="http://calibre-ebook.com/download">Download the free Calibre app</a> to a desktop or laptop computer.</li>
<li>Download your book from this page onto the desktop or laptop.</li>
<li>Open the ebook file in Calibre.</li>
<li>Convert the epub to a mobi file: select the file; click on "convert books"; and set the output format to mobi.</li>
<li>When the conversion is done, put the file on your device using the instructions for ereaders above. If you've set up your Kindle email address at Amazon.com, you can also email it to yourself using the "Connect/share" button, without needing to plug your Kindle in. Calibre will walk you through the process of setting up your Kindle email in Calibre.</li>
</ul>
<h4>Need more help?</h4>
<p>Need help with something not listed here? Email us at <a href="mailto:support@gluejar.com?Subject=Ebook%20downloading%20help">support@gluejar.com</a>.</p>
{% else %}
<p id="content-block">There are no freely available downloads of <I>{{ work.title }}</I> right now. {% if not work in request.user.wishlist.works.all %}Would you like there to be? <a class="add-wishlist"><span class="work_id" id="w{{ work.id }}">Add this book to your wishlist.</span></a>{% else %}Ask your friends to add it to their wishlists!{% endif %}</p>
<p>If you know of a Creative-Commons-licensed or US public domain edition of this book, you can add it through the <a href="{% url work work.id %}?tab=4">Rights tab of the book page</a>.</p>
{% endif %}
</div>
</div>
{% endblock %}
{% endwith %}

View File

@ -91,7 +91,7 @@ Please fix the following before launching your campaign:
{% ifequal campaign_status 'INITIALIZED' %}
<a href="{% url work_preview campaign.work.id %}" class="manage" target="_blank">Preview Your Campaign</a>
{% else %}
<a href="{% url work_preview campaign.work.id %}" class="manage" target="_blank">See Your Campaign</a>
<a href="{% url work campaign.work.id %}" class="manage" target="_blank">See Your Campaign</a>
{% endifequal %}
</div>

View File

@ -321,23 +321,23 @@ there's no tab for seeing ALL my books, only the filters! huh.
{% if request.user.is_anonymous %}
<div class="tabs-1 anon_about">
{% if works_unglued %}
{{ supporter }} is sharing these books with you. <a href="#" class="about_expander" id="about_unglued">Find out how.</a>
{{ supporter }} is sharing these books with you. <a href="/about/unglued/" class="hijax">Find out how.</a>
{% else %}
{{ supporter }} isn't sharing any books with the world yet. <a href="#" class="about_expander" id="about_unglued_empty">Find out how you can.</a>
{{ supporter }} isn't sharing any books with the world yet. <a href="/about/unglued_empty/" class="hijax">Find out how you can.</a>
{% endif %}
</div>
<div class="tabs-2 anon_about">
{% if works_active %}
{{ supporter }} is giving these books to you. <a href="#" class="about_expander" id="about_active">Find out how.</a>
{{ supporter }} is giving these books to you. <a href="/about/active/" class="hijax">Find out how.</a>
{% else %}
{{ supporter }} isn't giving any books to the world right now. <a href="#" class="about_expander" id="about_active_empty">Find out how you can.</a>
{{ supporter }} isn't giving any books to the world right now. <a href="/about/active_empty" class="hijax">Find out how you can.</a>
{% endif %}
</div>
<div class="tabs-3 anon_about">
{% if works_wished %}
{{ supporter }} wants to give these books to you. <a href="#" class="about_expander" id="about_wishlist">Find out how.</a>
{{ supporter }} wants to give these books to you. <a href="/about/wishlist/" class="hijax">Find out how.</a>
{% else %}
{{ supporter }} hasn't decided which books to give the world yet. <a href="#" class="about_expander" id="about_wishlist_empty">Learn more.</a>
{{ supporter }} hasn't decided which books to give the world yet. <a href="/about/wishlist_empty/" class="hijax">Learn more.</a>
{% endif %}
</div>
{% endif %}

View File

@ -15,6 +15,7 @@
<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 type="text/javascript" src="/static/js/hijax.js"></script>
<script>
var $j = jQuery.noConflict();
@ -28,16 +29,6 @@ $j(document).ready(function(){
$j(this).next().toggle();
});
});
$j(document).ready(function(){
$j('.show_more_ebooks').click(function(){
if ($j(this).html() == '<br>hide downloads') {
$j(this).html('<br>more downloads...')
} else {
$j(this).html('<br>hide downloads')
}
$j(this).next().toggle();
});
});
$j(document).ready(function(){
var img = $j('#book-detail-img');
var googimg = $j('#find-google img');
@ -134,33 +125,15 @@ $j(document).ready(function(){
{% else %}
<div class="btn_support"><form action="{% url pledge work_id %}" method="get"><input type="submit" value="Support" /></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>
{% if work.first_ebook %}
<div class="get-book">
<label>Read it now!</label>
<span class="find-link">
{% for ebook in work.ebooks %}
{% if forloop.first %}
<span class="first_ebook">
{% endif %}
{% if forloop.counter == 2 %}
</span>
<span class="show_more_ebooks"><br />More downloads...</span>
<span class="more_ebooks">
{% endif %}
{% if not forloop.first %}
<br />
{% endif %}
<a href="{{ ebook.url }}"><img src="/static/images/{{ ebook.format }}32.png" height="32" alt=" {{ ebook.format }} at {{ebook.provider}}" title=" {{ ebook.format }} at {{ebook.provider}}" /><img src="{{ebook.rights_badge}}" height="31" width="88" alt="{{ebook.rights}}" title="{{ebook.rights}}" /></a>
{% if forloop.last %}
</span>
{% endif %}
{% endfor %}
</span>
</div>
{% endif %}
<div class="find-book">
<label>Learn more at...</label>
<div class="find-link">
@ -415,7 +388,7 @@ $j(document).ready(function(){
{% 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">${{ premium.amount|floatformat:0|intcomma }}</span>{% if pledged.0.premium == premium %}<div class="you_pledged">Pledged!</div>{% endif %}
<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">Pledged!</div>{% endif %}
<span class="menu-item-desc">{{ premium.description }}</span>
{% ifnotequal premium.limit 0 %}<br /> Only {{ premium.premium_remaining }} remaining! {% endifnotequal %}
</a></li>

View File

@ -46,6 +46,7 @@ urlpatterns = patterns(
url(r"^work/(?P<work_id>\d+)/preview/$", "work", {'action': 'preview'}, name="work_preview"),
url(r"^work/(?P<work_id>\d+)/acks/$", "work", {'action': 'acks'}, name="work_acks"),
url(r"^work/(?P<work_id>\d+)/lockss/$", "lockss", name="lockss"),
url(r"^work/(?P<work_id>\d+)/download/$", "download", name="download"),
url(r"^work/\d+/acks/images/(?P<file_name>[\w\.]*)$", "static_redirect_view",{'dir': 'images'}),
url(r"^work/(?P<work_id>\d+)/librarything/$", "work_librarything", name="work_librarything"),
url(r"^work/(?P<work_id>\d+)/goodreads/$", "work_goodreads", name="work_goodreads"),
@ -79,7 +80,8 @@ urlpatterns = patterns(
url(r"^info/(?P<template_name>[\w\.]*)$", InfoPageView.as_view()),
url(r"^info/languages/(?P<template_name>[\w\.]*)$", InfoLangView.as_view()),
url(r'^supporter/(?P<supporter>[^/]+)/feed/$', SupporterWishlistFeed()),
url(r'^campaign_archive.js/$', "campaign_archive_js", name='campaign_archive_js'),
url(r'^campaign_archive.js/$', "campaign_archive_js", name="campaign_archive_js"),
url(r"^about/(?P<facet>\w*)/$", "about", name="about"),
)
if settings.DEBUG:

View File

@ -96,6 +96,19 @@ def next(request):
return response
else:
return HttpResponseRedirect('/')
def safe_get_work(work_id):
"""
use this rather than querying the db directly for a work by id
"""
try:
work = models.Work.objects.get(id = work_id)
except models.Work.DoesNotExist:
try:
work = models.WasWork.objects.get(was = work_id).work
except models.WasWork.DoesNotExist:
raise Http404
return work
def home(request, landing=False):
if request.user.is_authenticated() and landing == False:
@ -116,17 +129,11 @@ def stub(request):
def acks(request, work):
return render(request,'front_matter.html', {'campaign': work.last_campaign()})
def work(request, work_id, action='display'):
try:
work = models.Work.objects.get(id = work_id)
except models.Work.DoesNotExist:
try:
work = models.WasWork.objects.get(was = work_id).work
except models.WasWork.DoesNotExist:
raise Http404
work = safe_get_work(work_id)
if action == "acks":
return acks( request, work)
if request.method == 'POST' and not request.user.is_anonymous():
activetab = '4'
else:
@ -137,6 +144,8 @@ def work(request, work_id, action='display'):
activetab = '1';
except:
activetab = '1';
context = {}
campaign = work.last_campaign()
if campaign and campaign.edition:
editions = [campaign.edition]
@ -148,6 +157,12 @@ def work(request, work_id, action='display'):
pledged = None
countdown = ""
try:
assert not (work.last_campaign_status() == 'ACTIVE' and work.first_ebook())
except:
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()
@ -168,6 +183,7 @@ def work(request, work_id, action='display'):
countdown = "in %s minutes" % str(time_remaining.seconds/60 + 1)
else:
countdown = "right now"
if action == 'preview':
work.last_campaign_status = 'ACTIVE'
@ -189,6 +205,7 @@ def work(request, work_id, action='display'):
edition.ebook_form = EbookForm( instance= models.Ebook(user = request.user, edition = edition, provider = 'x' ), prefix = 'ebook_%d'%edition.id)
else:
claimform = None
if campaign:
# pull up premiums explicitly tied to the campaign
# mandatory premiums are only displayed in pledge process
@ -1890,14 +1907,45 @@ def campaign_archive_js(request):
return response
def lockss(request, work_id):
"""
manifest pages for lockss harvester
"""
work = safe_get_work(work_id)
try:
work = models.Work.objects.get(id = work_id)
except models.Work.DoesNotExist:
try:
work = models.WasWork.objects.get(was = work_id).work
except models.WasWork.DoesNotExist:
raise Http404
ebook = work.ebooks().filter(unglued=True)[0]
ebook = work.ebooks().filter(unglued=True)[0]
except:
ebook = None
authors = list(models.Author.objects.filter(editions__work=work).all())
return render(request, "lockss.html", {'work':work, 'ebook':ebook, 'authors':authors})
def download(request, work_id):
context = {}
work = safe_get_work(work_id)
context.update({'work': work})
unglued_ebook = work.ebooks().filter(unglued=True)
other_ebooks = work.ebooks().filter(unglued=False)
try:
ungluedcount = unglued_ebook.count()
assert (ungluedcount == 1 or ungluedcount == 0)
except:
logger.warning("There is more than one unglued edition for %s" % work.title)
try:
unglued_ebook = unglued_ebook[0]
except:
pass
context.update({
'unglued_ebook': unglued_ebook,
'other_ebooks': other_ebooks
})
return render(request, "download.html", context)
def about(request, facet):
template = "about_" + facet + ".html"
return render(request, template)

View File

@ -10,7 +10,9 @@ IS_PREVIEW = False
SITE_ID = 3
ADMINS = (
('Ed Summers', 'ehs@pobox.com'),
('Raymond Yee', 'rdhyee+ungluebugs@gluejar.com'),
('Eric Hellman', 'eric@gluejar.com'),
('Andromeda Yelton', 'andromeda@gluejar.com'),
)
MANAGERS = ADMINS

View File

@ -4,7 +4,9 @@ DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Ed Summers', 'ehs@pobox.com'),
('Raymond Yee', 'rdhyee+ungluebugs@gluejar.com'),
('Eric Hellman', 'eric@gluejar.com'),
('Andromeda Yelton', 'andromeda@gluejar.com'),
)
MANAGERS = ADMINS

View File

@ -6,7 +6,6 @@ TEMPLATE_DEBUG = DEBUG
SITE_ID = 5
ADMINS = (
('Ed Summers', 'ed.summers@gmail.com'),
('Raymond Yee', 'rdhyee+ungluebugs@gluejar.com'),
('Eric Hellman', 'eric@gluejar.com'),
('Andromeda Yelton', 'andromeda@gluejar.com'),

View File

@ -6,7 +6,6 @@ TEMPLATE_DEBUG = DEBUG
SITE_ID = 2
ADMINS = (
('Ed Summers', 'ed.summers@gmail.com'),
('Raymond Yee', 'rdhyee+ungluebugs@gluejar.com'),
('Eric Hellman', 'eric@gluejar.com'),
('Andromeda Yelton', 'andromeda@gluejar.com'),

View File

@ -8,7 +8,6 @@ IS_PREVIEW = False
SITE_ID = 1
ADMINS = (
('Ed Summers', 'ed.summers@gmail.com'),
('Raymond Yee', 'rdhyee+ungluebugs@gluejar.com'),
('Eric Hellman', 'eric@gluejar.com'),
('Andromeda Yelton', 'andromeda@gluejar.com'),

View File

@ -18,6 +18,9 @@
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
padding: 1px;
color: #fff;
margin: 0 8px 0 0;
@ -29,6 +32,9 @@
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
text-align: center;
display: inline-block;
}
@ -46,6 +52,8 @@
padding: 14px 0;
}
.google_signup_div div {
height: 24px;
line-height: 24px;
height: 24px;
line-height: 24px;
float: left;
@ -60,10 +68,15 @@
width: auto;
height: 36px;
line-height: 36px;
height: 36px;
line-height: 36px;
background: #8dc63f;
-moz-border-radius: 32px;
-webkit-border-radius: 32px;
border-radius: 32px;
-moz-border-radius: 32px;
-webkit-border-radius: 32px;
border-radius: 32px;
color: white;
cursor: pointer;
font-size: 13px;
@ -73,6 +86,9 @@
margin: 5px 0;
}
.errors {
-moz-border-radius: 16px 16px 0 0;
-webkit-border-radius: 16px 16px 0 0;
border-radius: 16px 16px 0 0;
-moz-border-radius: 16px 16px 0 0;
-webkit-border-radius: 16px 16px 0 0;
border-radius: 16px 16px 0 0;
@ -146,6 +162,9 @@ ul.tabs li a {
-moz-border-radius: 7px 7px 0 0;
-webkit-border-radius: 7px 7px 0 0;
border-radius: 7px 7px 0 0;
-moz-border-radius: 7px 7px 0 0;
-webkit-border-radius: 7px 7px 0 0;
border-radius: 7px 7px 0 0;
background: #d6dde0;
color: #3d4e53;
}
@ -175,6 +194,8 @@ ul.tabs li.active a {
#book-detail-img img {
padding: 5px;
border: solid 5px #EDF3F4;
padding: 5px;
border: solid 5px #EDF3F4;
}
.book-detail-info {
float: left;
@ -248,6 +269,9 @@ ul.tabs li.active a {
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
}
.book-detail-info .pledged-info {
padding: 0;
@ -264,6 +288,177 @@ ul.tabs li.active a {
height: 25px;
margin-top: -12px;
}
/* variables and mixins used in multiple less files go here */
.header-text {
height: 36px;
line-height: 36px;
display: block;
text-decoration: none;
font-weight: bold;
font-size: 13px;
letter-spacing: -0.05em;
}
.panelborders {
border-width: 1px 0px;
border-style: solid none;
border-color: #FFFFFF;
}
.roundedspan {
border: 1px solid #d4d4d4;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
-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;
-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;
}
.google_signup_div {
padding: 14px 0;
}
.google_signup_div div {
height: 24px;
line-height: 24px;
height: 24px;
line-height: 24px;
float: left;
padding-left: 5px;
}
.google_signup_div img {
float: left;
height: 24px;
width: 24px;
}
.actionbuttons {
width: auto;
height: 36px;
line-height: 36px;
height: 36px;
line-height: 36px;
background: #8dc63f;
-moz-border-radius: 32px;
-webkit-border-radius: 32px;
border-radius: 32px;
-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: none;
margin: 5px 0;
}
.errors {
-moz-border-radius: 16px 16px 0 0;
-webkit-border-radius: 16px 16px 0 0;
border-radius: 16px 16px 0 0;
-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: none;
}
.download_container {
width: 50%;
margin: auto;
}
#lightbox_content a {
color: #6994a3;
}
#lightbox_content .signuptoday a {
color: white;
}
#lightbox_content h2,
#lightbox_content h3,
#lightbox_content h4 {
margin-top: 15px;
}
#lightbox_content .ebook_download {
margin-bottom: 15px;
}
#lightbox_content .ebook_download a {
margin: auto 5px auto 0;
font-size: 15px;
}
#lightbox_content .ebook_download img {
vertical-align: middle;
}
#lightbox_content .logo {
font-size: 15px;
}
#lightbox_content .logo img {
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
height: 50px;
width: 50px;
margin-right: 5px;
}
#lightbox_content .unglued {
border: solid 2px #8dc63f;
margin-left: -2px;
padding: 5px;
}
#lightbox_content .unglued h3 {
margin-top: 5px;
}
#lightbox_content a.add-wishlist .on-wishlist,
#lightbox_content a.success,
a.success:hover {
text-decoration: none;
color: #3d4e53;
}
#lightbox_content a.success,
a.success:hover {
cursor: default;
}
#lightbox_content ul {
padding-left: 50px;
}
#lightbox_content ul li {
margin-bottom: 4px;
}
/* Common elements of share links -- just swap in the background image */
/* Page layout */
#js-page-wrap {
@ -278,6 +473,9 @@ ul.tabs li.active a {
}
#js-leftcol .jsmodule.rounded .jsmod-content,
.pledge.jsmodule.rounded .jsmod-content {
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
border-radius: 20px;
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
border-radius: 20px;
@ -415,6 +613,8 @@ div#content-block-content a {
div#content-block-content #tabs-1 img {
padding: 5px;
border: solid 5px #EDF3F4;
padding: 5px;
border: solid 5px #EDF3F4;
}
div#content-block-content #tabs-3 {
margin-left: -5px;
@ -425,6 +625,8 @@ div#content-block-content #tabs-3 {
.tabs-content iframe {
padding: 5px;
border: solid 5px #EDF3F4;
padding: 5px;
border: solid 5px #EDF3F4;
}
.tabs-content form {
margin-left: -5px;
@ -443,8 +645,13 @@ div#content-block-content #tabs-3 {
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
}
.work_supporter_name {
height: 50px;
line-height: 50px;
height: 50px;
line-height: 50px;
float: left;
@ -515,6 +722,9 @@ div#content-block-content #tabs-3 {
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
padding: 10px;
height: auto;
font-style: normal;
@ -529,6 +739,8 @@ div#content-block-content #tabs-3 {
font-style: normal;
height: 22px;
line-height: 22px;
height: 22px;
line-height: 22px;
}
#js-rightcol .jsmodule,
#pledge-rightcol .jsmodule {
@ -546,6 +758,9 @@ div#content-block-content #tabs-3 {
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
padding: 10px;
}
/* Right column - sharing */
@ -560,6 +775,9 @@ ul.social li {
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
border-radius: 0px;
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
border-radius: 0px;
}
ul.social li.facebook {
background: url("/static/images/icons/facebook.png") 10px center no-repeat;
@ -619,6 +837,9 @@ ul.social li.embed:hover span {
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
padding: 10px;
}
/* Right column - support tiers */

152
static/css/download.css Normal file
View File

@ -0,0 +1,152 @@
/* variables and mixins used in multiple less files go here */
.header-text {
height: 36px;
line-height: 36px;
display: block;
text-decoration: none;
font-weight: bold;
font-size: 13px;
letter-spacing: -0.05em;
}
.panelborders {
border-width: 1px 0px;
border-style: solid none;
border-color: #FFFFFF;
}
.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;
}
.google_signup_div {
padding: 14px 0;
}
.google_signup_div div {
height: 24px;
line-height: 24px;
float: left;
padding-left: 5px;
}
.google_signup_div img {
float: left;
height: 24px;
width: 24px;
}
.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: none;
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: none;
}
.download_container {
width: 50%;
margin: auto;
}
#lightbox_content a {
color: #6994a3;
}
#lightbox_content .signuptoday a {
color: white;
}
#lightbox_content h2,
#lightbox_content h3,
#lightbox_content h4 {
margin-top: 15px;
}
#lightbox_content .ebook_download {
margin-bottom: 15px;
}
#lightbox_content .ebook_download a {
margin: auto 5px auto 0;
font-size: 15px;
}
#lightbox_content .ebook_download img {
vertical-align: middle;
}
#lightbox_content .logo {
font-size: 15px;
}
#lightbox_content .logo img {
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
height: 50px;
width: 50px;
margin-right: 5px;
}
#lightbox_content .unglued {
border: solid 2px #8dc63f;
margin-left: -2px;
padding: 5px;
}
#lightbox_content .unglued h3 {
margin-top: 5px;
}
#lightbox_content a.add-wishlist .on-wishlist,
#lightbox_content a.success,
a.success:hover {
text-decoration: none;
color: #3d4e53;
}
#lightbox_content a.success,
a.success:hover {
cursor: default;
}
#lightbox_content ul {
padding-left: 50px;
}
#lightbox_content ul li {
margin-bottom: 4px;
}

View File

@ -19,6 +19,9 @@
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
padding: 1px;
color: #fff;
margin: 0 8px 0 0;
@ -30,6 +33,9 @@
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
text-align: center;
display: inline-block;
}
@ -47,6 +53,8 @@
padding: 14px 0;
}
.google_signup_div div {
height: 24px;
line-height: 24px;
height: 24px;
line-height: 24px;
float: left;
@ -61,10 +69,15 @@
width: auto;
height: 36px;
line-height: 36px;
height: 36px;
line-height: 36px;
background: #8dc63f;
-moz-border-radius: 32px;
-webkit-border-radius: 32px;
border-radius: 32px;
-moz-border-radius: 32px;
-webkit-border-radius: 32px;
border-radius: 32px;
color: white;
cursor: pointer;
font-size: 13px;
@ -74,6 +87,9 @@
margin: 5px 0;
}
.errors {
-moz-border-radius: 16px 16px 0 0;
-webkit-border-radius: 16px 16px 0 0;
border-radius: 16px 16px 0 0;
-moz-border-radius: 16px 16px 0 0;
-webkit-border-radius: 16px 16px 0 0;
border-radius: 16px 16px 0 0;
@ -91,12 +107,186 @@
list-style: none;
border: none;
}
/* variables and mixins used in multiple less files go here */
.header-text {
height: 36px;
line-height: 36px;
display: block;
text-decoration: none;
font-weight: bold;
font-size: 13px;
letter-spacing: -0.05em;
}
.panelborders {
border-width: 1px 0px;
border-style: solid none;
border-color: #FFFFFF;
}
.roundedspan {
border: 1px solid #d4d4d4;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
-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;
-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;
}
.google_signup_div {
padding: 14px 0;
}
.google_signup_div div {
height: 24px;
line-height: 24px;
height: 24px;
line-height: 24px;
float: left;
padding-left: 5px;
}
.google_signup_div img {
float: left;
height: 24px;
width: 24px;
}
.actionbuttons {
width: auto;
height: 36px;
line-height: 36px;
height: 36px;
line-height: 36px;
background: #8dc63f;
-moz-border-radius: 32px;
-webkit-border-radius: 32px;
border-radius: 32px;
-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: none;
margin: 5px 0;
}
.errors {
-moz-border-radius: 16px 16px 0 0;
-webkit-border-radius: 16px 16px 0 0;
border-radius: 16px 16px 0 0;
-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: none;
}
.download_container {
width: 50%;
margin: auto;
}
#lightbox_content a {
color: #6994a3;
}
#lightbox_content .signuptoday a {
color: white;
}
#lightbox_content h2,
#lightbox_content h3,
#lightbox_content h4 {
margin-top: 15px;
}
#lightbox_content .ebook_download {
margin-bottom: 15px;
}
#lightbox_content .ebook_download a {
margin: auto 5px auto 0;
font-size: 15px;
}
#lightbox_content .ebook_download img {
vertical-align: middle;
}
#lightbox_content .logo {
font-size: 15px;
}
#lightbox_content .logo img {
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
height: 50px;
width: 50px;
margin-right: 5px;
}
#lightbox_content .unglued {
border: solid 2px #8dc63f;
margin-left: -2px;
padding: 5px;
}
#lightbox_content .unglued h3 {
margin-top: 5px;
}
#lightbox_content a.add-wishlist .on-wishlist,
#lightbox_content a.success,
a.success:hover {
text-decoration: none;
color: #3d4e53;
}
#lightbox_content a.success,
a.success:hover {
cursor: default;
}
#lightbox_content ul {
padding-left: 50px;
}
#lightbox_content ul li {
margin-bottom: 4px;
}
/* remove before beta */
.preview {
border: solid 3px #e35351;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
clear: both;
padding: 5px 10px;
font-size: 13px;
@ -110,6 +300,9 @@
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
clear: both;
padding: 5px 10px;
font-size: 13px;
@ -130,6 +323,9 @@
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
clear: both;
padding: 5px 10px;
font-size: 13px;
@ -187,6 +383,9 @@ body {
-moz-border-radius: 0 0 10px 10px;
-webkit-border-radius: 0 0 10px 10px;
border-radius: 0 0 10px 10px;
-moz-border-radius: 0 0 10px 10px;
-webkit-border-radius: 0 0 10px 10px;
border-radius: 0 0 10px 10px;
background: #8dc63f;
margin-bottom: 0;
text-align: center;
@ -211,25 +410,48 @@ a {
a:hover {
text-decoration: underline;
}
h1 {
font-size: 22.5px;
}
h2 {
font-size: 18.75px;
}
h3 {
font-size: 17.549999999999997px;
}
h4 {
font-size: 15px;
}
img {
border: none;
}
input,
textarea {
textarea,
a.fakeinput {
border: 2px solid #d6dde0;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
}
input:focus,
textarea:focus {
textarea:focus,
a.fakeinput:focus {
border: 2px solid #8dc63f;
outline: none;
}
a.fakeinput:hover {
text-decoration: none;
}
.js-search input {
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
}
h2.content-heading {
padding: 15px;
@ -244,6 +466,9 @@ h2.content-heading span {
font-style: italic;
}
h3.jsmod-title {
-moz-border-radius: 8px 8px 0 0;
-webkit-border-radius: 8px 8px 0 0;
border-radius: 8px 8px 0 0;
-moz-border-radius: 8px 8px 0 0;
-webkit-border-radius: 8px 8px 0 0;
border-radius: 8px 8px 0 0;
@ -259,7 +484,8 @@ h3.jsmod-title span {
padding: 26px 40px 27px 20px;
display: block;
}
input[type="submit"] {
input[type="submit"],
a.fakeinput {
background: #8dc63f;
color: white;
font-weight: bold;
@ -282,6 +508,9 @@ ul.menu {
margin: 0;
}
.errorlist {
-moz-border-radius: 16px 16px 0 0;
-webkit-border-radius: 16px 16px 0 0;
border-radius: 16px 16px 0 0;
-moz-border-radius: 16px 16px 0 0;
-webkit-border-radius: 16px 16px 0 0;
border-radius: 16px 16px 0 0;
@ -294,6 +523,25 @@ ul.menu {
font-weight: bold;
font-size: 13px;
text-align: center;
-moz-border-radius: 16px 16px 0 0;
-webkit-border-radius: 16px 16px 0 0;
border-radius: 16px 16px 0 0;
-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;
}
.errorlist li {
list-style: none;
border: none;
}
.errorlist li {
list-style: none;
@ -349,6 +597,13 @@ ul.menu {
font-weight: bold;
font-size: 13px;
letter-spacing: -0.05em;
height: 36px;
line-height: 36px;
display: block;
text-decoration: none;
font-weight: bold;
font-size: 13px;
letter-spacing: -0.05em;
}
.js-topmenu ul li span#welcome {
color: #8dc63f;
@ -359,6 +614,13 @@ ul.menu {
font-weight: bold;
font-size: 13px;
letter-spacing: -0.05em;
height: 36px;
line-height: 36px;
display: block;
text-decoration: none;
font-weight: bold;
font-size: 13px;
letter-spacing: -0.05em;
overflow: auto;
max-width: 240px;
}
@ -367,6 +629,9 @@ ul.menu {
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
padding: 3px;
line-height: 16px;
width: 16px;
@ -388,6 +653,9 @@ ul.menu {
background: url("/static/images/bg.png") right top no-repeat;
}
.js-topmenu ul li.last a span {
-moz-border-radius: 32px 0 0 32px;
-webkit-border-radius: 32px 0 0 32px;
border-radius: 32px 0 0 32px;
-moz-border-radius: 32px 0 0 32px;
-webkit-border-radius: 32px 0 0 32px;
border-radius: 32px 0 0 32px;
@ -415,9 +683,14 @@ ul.menu {
-moz-border-radius: 50px 0 0 50px;
-webkit-border-radius: 50px 0 0 50px;
border-radius: 50px 0 0 50px;
-moz-border-radius: 50px 0 0 50px;
-webkit-border-radius: 50px 0 0 50px;
border-radius: 50px 0 0 50px;
outline: none;
height: 28px;
line-height: 28px;
height: 28px;
line-height: 28px;
width: 156px;
float: left;
color: #6994a3;
@ -464,6 +737,9 @@ a#readon.down {
background: url("/static/images/learnmore-uparrow.png") right center no-repeat;
}
a#readon span {
-moz-border-radius: 32px 0 0 32px;
-webkit-border-radius: 32px 0 0 32px;
border-radius: 32px 0 0 32px;
-moz-border-radius: 32px 0 0 32px;
-webkit-border-radius: 32px 0 0 32px;
border-radius: 32px 0 0 32px;
@ -472,6 +748,8 @@ a#readon span {
padding: 0 5px 0 20px;
height: 36px;
line-height: 36px;
height: 36px;
line-height: 36px;
display: block;
}
.spread_the_word {
@ -497,6 +775,9 @@ a#readon span {
-moz-border-radius: 0 0 10px 10px;
-webkit-border-radius: 0 0 10px 10px;
border-radius: 0 0 10px 10px;
-moz-border-radius: 0 0 10px 10px;
-webkit-border-radius: 0 0 10px 10px;
border-radius: 0 0 10px 10px;
}
#js-leftcol ul.level1 > li > a,
#js-leftcol ul.level1 > li > span {
@ -520,10 +801,15 @@ a#readon span {
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
}
#js-leftcol ul.level2 li .ungluer-name {
height: 30px;
line-height: 30px;
height: 30px;
line-height: 30px;
}
/* Main content area: top */
#js-topsection {
@ -647,6 +933,9 @@ a.nounderline {
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
border: solid 5px #d6dde0;
background: white;
z-index: 500;
@ -657,44 +946,61 @@ a.nounderline {
margin-left: 0;
padding: 9px;
}
#about_expandable p {
#about_expandable .collapser_x {
margin-top: -27px;
margin-right: -27px;
}
#lightbox_content p {
padding: 9px 0;
font-size: 15px;
line-height: 20px;
}
#about_expandable p a {
#lightbox_content p a {
font-size: 15px;
line-height: 20px;
}
#about_expandable p b {
#lightbox_content p b {
color: #8dc63f;
}
#about_expandable p.last {
#lightbox_content p.last {
border-bottom: solid 2px #d6dde0;
margin-bottom: 5px;
}
#about_expandable .right_border {
#lightbox_content .right_border {
border-right: solid 1px #d6dde0;
float: left;
padding: 9px;
}
#about_expandable .signuptoday {
#lightbox_content .signuptoday {
float: right;
margin-top: 0;
clear: none;
}
#about_expandable .collapser_x {
margin-top: -27px;
margin-right: -27px;
.nonlightbox .about_page {
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
border: solid 5px #d6dde0;
width: 75%;
margin: 10px auto auto auto;
padding: 9px;
}
.collapser_x {
float: right;
height: 24px;
line-height: 24px;
height: 24px;
line-height: 24px;
width: 24px;
-moz-border-radius: 24px;
-webkit-border-radius: 24px;
border-radius: 24px;
-moz-border-radius: 24px;
-webkit-border-radius: 24px;
border-radius: 24px;
-moz-box-shadow: -1px 1px #3d4e53;
-webkit-box-shadow: -1px 1px #3d4e53;
box-shadow: -1px 1px #3d4e53;
@ -708,6 +1014,9 @@ a.nounderline {
margin-right: -22px;
}
.signuptoday {
-moz-border-radius: 32px;
-webkit-border-radius: 32px;
border-radius: 32px;
-moz-border-radius: 32px;
-webkit-border-radius: 32px;
border-radius: 32px;
@ -715,6 +1024,8 @@ a.nounderline {
padding: 0 15px;
height: 36px;
line-height: 36px;
height: 36px;
line-height: 36px;
float: left;
clear: both;
margin: 10px auto;

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -1,45 +0,0 @@
var $j = jQuery.noConflict();
$j(document).ready(function(){
$j('.about_expander').click(function(){
// decide which about content to show
var whichbox = $j(this).attr('id');
// if we're on a supporter page, personalize our about box
// by writing the supporter's name in
if ($j(location).attr('pathname').slice(0,11) == '/supporter/') {
var ungluer = $j(location).attr('pathname').slice(11, -1);
}
if (ungluer != null) {
$j('#lightbox').load('/static/html/'+whichbox+'.html');
// span.ungluer doesn't exist until the ajax call so we
// can't bind to the DOM on document ready; need to use
// the ajaxComplete event
$j('#lightbox').ajaxComplete(function() {
$j('#lightbox span.ungluer').replaceWith(ungluer);
});
} else {
$j('#lightbox').load('/static/html/'+whichbox+'.html');
}
// fade-out (fade-in) rest of page elements on expand (collapse)
$j('#js-topsection').css({"opacity": "0.07"});
$j('.launch_top').css({"opacity": "0.07"});
$j('#main-container').css({"opacity": "0.07"});
$j('#js-rightcol').css({"opacity": "0.07"});
$j('#js-header').css({"opacity": "0.07"});
$j('#js-header a').css({"cursor": "default"});
$j('#about_expandable').fadeTo("slow", 1);
});
$j('#about_collapser').click(function(){
$j('#js-topsection').fadeTo("slow", 1);
$j('.launch_top').fadeTo("slow", 1);
$j('#main-container').fadeTo("slow", 1);
$j('#js-rightcol').fadeTo("slow", 1);
$j('#js-header').fadeTo("slow", 1);
$j('#js-header a').css({"cursor": "pointer"});
$j('#about_expandable').css({"display": "none"});
});
});

53
static/js/hijax.js Normal file
View File

@ -0,0 +1,53 @@
// hijack a link with class "hijax" to show its content in a lightbox instead
// allows for ajaxy presentation of things like download links in a way that
// degrades gracefully for non-js users
var $j = jQuery.noConflict();
$j(document).ready(function() {
$j("a.hijax").click(function(event) {
event.preventDefault();
$j("#lightbox").load( $j(this).attr("href") + " #lightbox_content");
// fade-out rest of page elements on expand
$j('#js-topsection').css({"opacity": "0.07"});
$j('.launch_top').css({"opacity": "0.07"});
$j('.preview').css({"opacity": "0.07"});
$j('#main-container').css({"opacity": "0.07"});
$j('#js-rightcol').css({"opacity": "0.07"});
$j('#js-header').css({"opacity": "0.07"});
$j('#js-header a').css({"cursor": "default"});
$j('#js-page-wrap').css({"opacity": "0.07"});
$j('#footer').css({"opacity": "0.07"});
$j('#about_expandable').fadeTo("slow", 1);
// if we're on a supporter page, personalize our about box
// by writing the supporter's name in
if ($j(location).attr('pathname').slice(0,11) == '/supporter/') {
var ungluer = $j(location).attr('pathname').slice(11, -1);
if (ungluer != null) {
// span.ungluer doesn't exist until the ajax call so we
// can't bind to the DOM on document ready; need to use
// the ajaxComplete event
$j('#lightbox').ajaxComplete(function() {
$j('#lightbox span.ungluer').replaceWith(ungluer);
});
}
}
});
// fade-in normal page elements on collapse
$j('#about_collapser').click(function(){
$j('#js-topsection').fadeTo("slow", 1);
$j('.launch_top').fadeTo("slow", 1);
$j('.preview').fadeTo("slow", 1);
$j('#main-container').fadeTo("slow", 1);
$j('#js-rightcol').fadeTo("slow", 1);
$j('#js-header').fadeTo("slow", 1);
$j('#js-header a').css({"cursor": "pointer"});
$j('#js-page-wrap').fadeTo("slow", 1);
$j('#footer').fadeTo("slow", 1);
$j('#about_expandable').css({"display": "none"});
});
});

View File

@ -4,7 +4,7 @@ $j().ready(function() {
// only do the lookup once, then cache it
var contentblock = $j('#content-block');
contentblock.on("click", "div.add-wishlist", function () {
contentblock.on("click", ".add-wishlist", function () {
var span = $j(this).find("span");
var id_val = span.attr('id').substring(1);
var id_type = span.attr('class');
@ -25,6 +25,11 @@ $j().ready(function() {
else {
span.html('a type error occurred');
}
// prevent perversities on download page
if ($j(this).is("a")) {
$j(this).removeClass("add-wishlist").addClass("success");
}
});
contentblock.on("click", "div.remove-wishlist", function() {

View File

@ -1,6 +1,7 @@
@import "variables.less";
@import "campaign_tabs.less";
@import "book_detail.less";
@import "download.less";
/* Common elements of share links -- just swap in the background image */
.shareclass(@sharewhere) {

71
static/less/download.less Normal file
View File

@ -0,0 +1,71 @@
@import "variables.less";
.download_container {
width: 50%;
margin: auto;
}
#lightbox_content a {
color: @medium-blue;
}
#lightbox_content .signuptoday a {
color: white;
}
#lightbox_content h2, #lightbox_content h3, #lightbox_content h4 {
margin-top: 15px;
}
#lightbox_content .ebook_download {
a {
margin: auto 5px auto 0;
font-size: @font-size-larger;
}
img {
vertical-align: middle;
}
margin-bottom: 15px;
}
#lightbox_content .logo {
img {
.one-border-radius(7px);
height: 50px;
width: 50px;
margin-right: 5px;
}
font-size: @font-size-larger;
}
#lightbox_content .unglued {
border: solid 2px @call-to-action;
margin-left: -2px;
padding: 5px;
h3 {
margin-top: 5px;
}
}
#lightbox_content a.add-wishlist .on-wishlist, #lightbox_content a.success, a.success:hover {
text-decoration: none;
color: @text-blue;
}
#lightbox_content a.success, a.success:hover {
cursor: default;
}
#lightbox_content ul {
padding-left: 50px;
li {
margin-bottom: 4px;
}
}

View File

@ -1,6 +1,7 @@
/* For sitewide elements of unglue.it. */
@import "variables.less";
@import "download.less";
/* remove before beta */
.preview {
@ -118,11 +119,27 @@ a {
}
}
h1 {
font-size: @font-size-larger*1.5;
}
h2 {
font-size: @font-size-larger*1.25;
}
h3 {
font-size: @font-size-larger*1.17;
}
h4 {
font-size: @font-size-larger;
}
img {
border:none;
}
input, textarea {
input, textarea, a.fakeinput {
border: 2px solid @blue-grey;
.one-border-radius(5px);
@ -132,6 +149,10 @@ input, textarea {
}
}
a.fakeinput:hover {
text-decoration: none;
}
.js-search input {
.one-border-radius(0);
}
@ -170,7 +191,7 @@ h3 {
}
}
input[type="submit"] {
input[type="submit"], a.fakeinput {
background: @call-to-action;
color: white;
font-weight: bold;
@ -585,6 +606,13 @@ a.nounderline {
margin-left: 0;
padding: 9px;
.collapser_x {
margin-top: -27px;
margin-right: -27px;
}
}
#lightbox_content {
p {
padding: 9px 0;
font-size: @font-size-larger;
@ -617,10 +645,15 @@ a.nounderline {
clear: none;
}
.collapser_x {
margin-top: -27px;
margin-right: -27px;
}
}
// need to style /about/X pages such that they will not conflict with lightboxed About from header
.nonlightbox .about_page {
.one-border-radius(5px);
border: solid 5px @blue-grey;
width: 75%;
margin: 10px auto auto auto;
padding: 9px;
}
.collapser_x {

0
sysadmin/__init__.py Normal file
View File