Merge branch 'master' of github.com:Gluejar/regluit into payment

pull/1/head
Raymond Yee 2012-03-09 13:40:45 -08:00
commit dae04c7595
21 changed files with 114 additions and 82 deletions

View File

@ -30,7 +30,7 @@
<!-- related work -->
{% if edition.work %}
<p class="classname">Related work: {{edition.work.id}} | {{edition.work.title}} | first author: {{edition.work.authors.all.0.name}} <br/>
<p class="classname">Related work: {{edition.work.id}} | {{edition.work.title}} | first author: {{edition.work.authors.all.0.name}} <br />
All authors: {{edition.work.authors.all}} </p>
{% endif %}
@ -38,7 +38,7 @@
{% if edition.work.campaigns.all %}
<ul id="id">
{% for campaign in edition.work.campaigns.all %}
<li>Campaign: id:{{campaign.id}} | name:{{campaign.name}} | desc:{{campaign.description}} <br/>
<li>Campaign: id:{{campaign.id}} | name:{{campaign.name}} | desc:{{campaign.description}} <br />
target:{{campaign.target}} created:{{campaign.created}} deadline:{{campaign.deadline}}</li>
{% endfor %}
</ul>

View File

@ -12,6 +12,7 @@
<html>
<head>
<meta charset="utf-8" />
<title>unglue.it {% block title %}{% endblock %}</title>
<link type="text/css" rel="stylesheet" href="/static/css/sitewide.css" />
<link REL="SHORTCUT ICON" HREF="/static/images/favicon.ico">
@ -122,8 +123,6 @@ Welcome to the alpha version of Unglue.It. This site is a preview of our full f
</div>
</div>
</div>
</div>
</div>
{% block counter %}
<script type="text/javascript">

View File

@ -1,4 +1,8 @@
<div class="thewholebook listview tabs {% if work.first_ebook %}tabs-1{% else %}{% if status == 'SUCCESSFUL' or status == 'ACTIVE' %}tabs-2{% else %}tabs-3{% endif %}{% endif %}">
{% with work.first_ebook as first_ebook %}
{% with work.last_campaign.supporters as supporters %}
{% with work.cover_image_thumbnail as thumbnail %}
{% with work.author as author %}
<div class="thewholebook listview tabs {% if first_ebook %}tabs-1{% else %}{% if status == 'SUCCESSFUL' or status == 'ACTIVE' %}tabs-2{% else %}tabs-3{% endif %}{% endif %}">
<div class="listview book-list">
<div class="listview panelback side2">
<div class="greenpanel2">
@ -6,17 +10,17 @@
<div class="unglued_white">
{% comment %}top section: campaign info + optional action button. Varies by campaign status.{% endcomment %}
{% if work.first_ebook %}
{% if first_ebook %}
<b>AVAILABLE!</b>
</div>
<div class="read_itbutton">{% if work.first_ebook %}<a href="{{ work.ebooks.0.url }}">{% endif %}Read it Now</a></div>
<div class="read_itbutton">{% if first_ebook %}<a href="{{ work.ebooks.0.url }}">{% endif %}Read it Now</a></div>
{% else %}{% if status == 'SUCCESSFUL' %}
<b>UNGLUED!</b>
<p><b>On:</b> {{ deadline|date:"M d, Y" }}</p>
<p><b>Raised:</b> {{ work.last_campaign.current_total }}</p>
</div>
<div class="read_itbutton">{% if work.first_ebook %}<a href="{{ work.ebooks.0.url }}">{% endif %}Read it Now</a></div>
<div class="read_itbutton">{% if first_ebook %}<a href="{{ work.ebooks.0.url }}">{% endif %}Read it Now</a></div>
{% else %}{% if status == 'ACTIVE' %}
<b>UNGLUE IT!</b>
@ -50,14 +54,14 @@
</div>
{% comment %}status of book vis-a-vis user's wishlist{% endcomment %}
{% if request.user.id in work.last_campaign.supporters %}
{% if request.user.id in supporters %}
<div class="moreinfo on-wishlist">
<span>Pledged!</span>
</div>
{% else %}
{% ifequal supporter request.user %}
<div class="moreinfo remove-wishlist">
<span id="{{ work.id }}">Remove This</span>
<span id="p{{ work.id }}">Remove This</span>
</div>
{% else %}{% if request.user.is_anonymous %}
<div class="moreinfo create-account">
@ -69,40 +73,40 @@
</div>
{% else %}
<div class="moreinfo add-wishlist">
<span id="{{ googlebooks_id }}">Add&nbsp;to&nbsp;Wishlist</span>
<span id="p{{ googlebooks_id }}">Add&nbsp;to&nbsp;Wishlist</span>
</div>
{% endif %}{% endif %}{% endifequal %}{% endif %}
{% comment %}bibliographic data{% endcomment %}
<div class="white_text">
<p><a href="{% if work.id %}{% url work work.id %}{% else %}{% url googlebooks work.googlebooks_id %}{% endif %}">{{ work.title }}</a></p>
<p>{{ work.author }}</p>
<p><a href="{% if work.id %}{% url work work.id %}{% else %}{% url googlebooks googlebooks_id %}{% endif %}">{{ work.title }}</a></p>
<p>{{ author }}</p>
</div>
{% comment %}link to work page{% endcomment %}
<div class="moreinfo">
<a href="{% if work.id %}{% url work work.id %}{% else %}{% url googlebooks work.googlebooks_id %}{% endif %}" target="_top">More Info</a>
<a href="{% if work.id %}{% url work work.id %}{% else %}{% url googlebooks googlebooks_id %}{% endif %}" target="_top">More Info</a>
</div>
</div>
</div>
<div class="listview panelfront side1 book-thumb">
<a href="{% if work.id %}{% url work work.id %}{% else %}{% url googlebooks work.googlebooks_id %}{% endif %}" target="_top"><img src="{% if work.cover_image_thumbnail %}{{ work.cover_image_thumbnail }}{% else %}/static/images/generic_cover_larger.png{% endif %}" alt="Book cover" title="book cover" /></a>
<a href="{% if work.id %}{% url work work.id %}{% else %}{% url googlebooks googlebooks_id %}{% endif %}" target="_top"><img src="{% if thumbnail %}{{ thumbnail }}{% else %}/static/images/generic_cover_larger.png{% endif %}" alt="Book cover" title="book cover" /></a>
</div>
<div class="listview panelfront side1 book-name">
<div class="title">
<a href="{% if work.id %}{% url work work.id %}{% else %}{% url googlebooks googlebooks_id %}{% endif %}">{{ work.title }}</a>
</div>
<div class="listview author {{ work.author }}">{{ work.author }}</div>
<div class="listview author {{ author }}">{{ author }}</div>
</div>
{% if request.user.id in work.last_campaign.supporters %}
{% if request.user.id in supporters %}
<div class="listview panelfront side1 on-wishlist">
<span>Pledged!</span>
</div>
{% else %}
{% ifequal supporter request.user %}
<div class="listview panelfront side1 remove-wishlist">
<span id="{{ work.id }}">Remove This</span>
<span id="l{{ work.id }}">Remove This</span>
</div>
{% else %}{% if request.user.is_anonymous %}
<div class="listview panelfront side1 create-account">
@ -114,7 +118,7 @@
</div>
{% else %}
<div class="listview panelfront side1 add-wishlist">
<span id="{{ googlebooks_id }}">Add to Wishlist</span>
<span id="l{{ googlebooks_id }}">Add to Wishlist</span>
</div>
{% endif %}{% endif %}{% endifequal %}{% endif %}
<div class="listview panelfront side1 booklist-status">
@ -123,7 +127,7 @@
<div class="listview panelfront side1 icons">
{% if status == 'No campaign yet' or status == 'INITIALIZED' %}
<a href="{% url work work.id %}?tab=3" class="nobold"><span class="rounded"><span class="grey"><span class="panelnope">Wished by&nbsp;</span>{{ work.num_wishes }}</span></span></a>
{% else %}{% if work.first_ebook %}
{% else %}{% if first_ebook %}
<span class="listview boolist-ebook">
{% for ebook in work.ebooks|slice:":3" %}
<a href="{{ebook.url}}">{{ ebook.format }}</a>
@ -146,4 +150,8 @@
</div>
</div>
</div>
</div>
</div>
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}

View File

@ -63,7 +63,7 @@ comments rss?
<a href="{% url work id %}?tab=2"><img src="{{ comment.content_object.cover_image_thumbnail }}"></a>
</div>
{% with comment.user as user %}
<span><a href={% url supporter supporter_username=user %}>{{ comment.name }}</a> on <a href="{% url work id %}?tab=2">{{ comment.content_object.title }}</a></span><br/>
<span><a href={% url supporter supporter_username=user %}>{{ comment.name }}</a> on <a href="{% url work id %}?tab=2">{{ comment.content_object.title }}</a></span><br />
<span class="text">{{ comment.comment|linebreaksbr }}</span>
</div>

View File

@ -7,10 +7,10 @@
<dt> How many ungluers have registered?</dt>
<dd>
<ul>
<li>{{ users.today.count }} have registered today. They are
<li>{{ users.today.count }} have registered today. {% if users.today.count %}They are
<ul>{% for user in users.today %}
<li><a href="{% url supporter user.username %}">{{user.username}}</a></li>
{% endfor %}</ul>
{% endfor %}</ul>{% endif %}
<br />{{ wishlists.today.count }} of them have 1 or more items on a wishlist.
</li>
<li>{{ users.days7.count }} have registered in the past 7 days.
@ -30,10 +30,10 @@
<dt> How many works have been added to Unglue.it?</dt>
<dd>
<ul>
<li>{{ works.today.count }} have been added today. They are
<ul>{% for work in users_today %}
<li>{{ works.today.count }} have been added today. {% if works.today.count %}They are
<ul>{% for work in works.today %}
<li><a href="{% url work work.id %}">{{work.title}}</a></li>
{% endfor %}</ul>
{% endfor %}</ul>{% endif %}
</li>
<li>{{ works.days7.count }} have been added in the past 7 days.
</li>
@ -64,10 +64,10 @@
<dt> How many ebooks have been added to Unglue.it?</dt>
<dd>
<ul>
<li>{{ ebooks.today.count }} have been added today. They are
<ul>{% for work in users_today %}
<li>{{ ebooks.today.count }} have been added today. {% if ebooks.today.count %}They are
<ul>{% for ebook in ebooks.today %}
<li><a href="{% url work ebook.edition.work.id %}">{{ebook.edition.work.title}}</a></li>
{% endfor %}</ul>
{% endfor %}</ul>{% endif %}
</li>
<li>{{ ebooks.days7.count }} have been added in the past 7 days.
</li>

View File

@ -23,15 +23,15 @@
<label>Find it here</label>
<div class="find-link">
<a class="find-google" href="{{ work.googlebooks_url }}"><img src="/static/images/supporter_icons/googlebooks_square.png" align="" title="Find on Google Books" /></a>
<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"></a>
<a class="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>
<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"></a>
<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" /></a>
<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>
@ -42,7 +42,7 @@
{{ work.last_campaign.supporters.count }} Ungluers have pledged ${{ work.last_campaign.current_total }}
</div>
<div class="status">
<img src="/static/images/images/icon-book-37by25-{{ work.percent_unglued }}.png" />
<img src="/static/images/images/icon-book-37by25-{{ work.percent_unglued }}.png" title="book list status" alt="book list status" />
</div>
</div>
</div>

View File

@ -23,11 +23,11 @@ we need the share options and also something like the home page slide show to gi
<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>
<a href="https://twitter.com/intent/tweet?url={{request.build_absolute_uri|urlencode:"" }}&text=I'm%20ungluing%20{{ work.title|urlencode }}%20at%20%40unglueit"><li class="twitter"><span>Twitter</span></li></a>
<a href="https://twitter.com/intent/tweet?url={{request.build_absolute_uri|urlencode:"" }}&amp;text=I%27m%20ungluing%20{{ work.title|urlencode }}%20at%20%40unglueit"><li class="twitter"><span>Twitter</span></li></a>
{% 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>
<div id="widgetcode">Copy/paste this into your site:<br /><textarea rows="7" cols="22">&lt;iframe src="https://{{request.META.HTTP_HOST}}/api/widget/{{work.first_isbn_13}}/" width="152" height="325" frameborder="0"&gt;&lt;/iframe&gt;</textarea></div>
<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">&lt;iframe src="https://{{request.META.HTTP_HOST}}/api/widget/{{work.first_isbn_13}}/" width="152" height="325" frameborder="0"&gt;&lt;/iframe&gt;</textarea></div>
</div>
</div>

View File

@ -49,7 +49,7 @@
<dt>What?</dt>
<dd>Unglue.It offers a win-win solution to readers, who want to read and share their favorite books conveniently, and rights holders, who want to be rewarded for their work.<br /><br />
We will run <a href"http://en.wikipedia.org/wiki/Crowdfunding">crowdfunding</a> campaigns to raise money for specific, already-published books. When we reach goals set by the rights holders, we'll pay them to unglue their work. They'll issue an electronic edition with a <a href="http://creativecommons.org"</a>Creative Commons</a> <a href="http://creativecommons.org/licenses/by-nc-nd/3.0/">BY-NC-ND</a> license. This license will make the edition free and legal for everyone to read, copy, and share, noncommercially, worldwide.<br /><br />
At present, in our alpha phase, we're not running live campaigns (though you may see some fake campaign data for testing purposes). However, most of the other features of the site -- such as searching for books, adding them to your wishlist, and personalizing your user profile -- work. We invite you to try them out and give us feedback.<br/><br/>
At present, in our alpha phase, we're not running live campaigns (though you may see some fake campaign data for testing purposes). However, most of the other features of the site -- such as searching for books, adding them to your wishlist, and personalizing your user profile -- work. We invite you to try them out and give us feedback.<br /><br />
Once we've fully tested our payment processes and user experience, we'll have a beta launch. At this point we'll announce our founding rights holders, run live campaigns, and invite everyone to join the site.</dd>
<dt>Why?</dt>
<dd>As ereaders proliferate, more and more people are enjoying the ereading experience. However, their favorite books may not be available as ebooks. Their ebooks may come with DRM which makes them unreadable on certain devices, and difficult or impossible to lend to friends. Or they may not be able to tell if they have the legal right to use the book as they'd like. The situation is even more challenging for libraries, which may not be able to acquire ebooks at all, or can only acquire them under legal terms and DRM restrictions which run counter to library lending.<br /><br />

View File

@ -6,7 +6,7 @@
<div id="registration">
<h1>Create a new profile for {{ user }} </h1>
<form method="POST" action="">
<form method="POST" action="#">
{% csrf_token %}
{{ form }}
<input type="submit" name="submit" value="Save" id="submit">

View File

@ -6,7 +6,7 @@
<div id="registration">
<h1>Edit profile for {{ user }} </h1>
<form method="POST" action="">
<form method="POST" action="#">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" name="submit" value="Update" id="submit">

View File

@ -3,7 +3,7 @@
{% block doccontent %}
Enter your new password below to reset your password.<br /><br />
<form method="post" action="">{% csrf_token %}
<form method="post" action="#">{% csrf_token %}
{{ form.as_table }}
<input type="submit" value="Set password" />
</form>

View File

@ -6,7 +6,7 @@
<p> If you change your username, the web address for your profile page will change as well.</p>
<p> <b>Your current username:</b> {{ user.username }}</p>
<form method="POST" action="">
<form method="POST" action="#">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" name="submit" value="Change username" id="submit">

View File

@ -92,7 +92,7 @@ there's no tab for seeing ALL my books, only the filters! huh.
{% ifequal supporter request.user %}
<div id="user-block1">
<div class="block-inner">
<span class="my-setting">My Profile</a>
<span class="my-setting">My Profile</span>
</div>
</div>
<div class="user-block2">
@ -160,7 +160,7 @@ there's no tab for seeing ALL my books, only the filters! huh.
</div>
{% ifequal supporter request.user %}
<div id="user-block-hide">
<form method="POST" action="">
<form method="POST" action="#">
{% csrf_token %}
<div class="block block1">
<div class="block-inner">
@ -181,21 +181,21 @@ there's no tab for seeing ALL my books, only the filters! huh.
</div>
<div class="check-list">
{% if supporter.profile.twitter_id %}
<a href="{% url socialauth_associate_begin backend='twitter' %}">Update your Twitter connection</a> <br/> or disconnect Twitter: {{ profile_form.clear_twitter }}
<a href="{% url socialauth_associate_begin backend='twitter' %}">Update your Twitter connection</a> <br /> or disconnect Twitter: {{ profile_form.clear_twitter }}
{% else %}
<a href="{% url socialauth_associate_begin backend='twitter' %}">Connect your Twitter account</a> to Unglue.it
{% endif %}
</div>
<div class="check-list">
{% if supporter.profile.facebook_id %}
<a href="{% url socialauth_associate_begin backend='facebook' %}">Update your Facebook connection</a> <br/> or disconnect Facebook: {{ profile_form.clear_facebook }}
<a href="{% url socialauth_associate_begin backend='facebook' %}">Update your Facebook connection</a> <br /> or disconnect Facebook: {{ profile_form.clear_facebook }}
{% else %}
<a href="{% url socialauth_associate_begin backend='facebook' %}">Connect your Facebook account</a> to Unglue.it
{% endif %}
</div>
<div class="check-list" id="connectgr">
{% if user.profile.goodreads_user_id %}
<a href="{{goodreads_auth_url}}">Update your GoodReads connection</a> <br/> or disconnect GoodReads: {{ profile_form.clear_goodreads }}
<a href="{{goodreads_auth_url}}">Update your GoodReads connection</a> <br /> or disconnect GoodReads: {{ profile_form.clear_goodreads }}
{% else %}
<a href="{{goodreads_auth_url}}">Connect your GoodReads account</a> to Unglue.it
{% endif %}
@ -213,10 +213,7 @@ there's no tab for seeing ALL my books, only the filters! huh.
{% csrf_token %}
<div class="fieldWrapper">
<div id="loadgr"><span>
<div id="goodreads_shelves"></div>
<input id="goodreads_input" type="submit" value="Select your GoodReads shelves" />
</span>
<div id="loadgr"><span><span id="goodreads_shelves"></span><input id="goodreads_input" type="submit" value="Select your GoodReads shelves" /></span>
</div>
</div>
</form>

View File

@ -111,14 +111,14 @@ $j(document).ready(function(){
<div class="find-book">
<label>Find it:</label>
<div class="find-link">
<a id="find-google" href="{{ work.googlebooks_url }}"><img src="/static/images/supporter_icons/googlebooks_square.png" align="" title="Find on Google Books" /></a>
<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"></a>
<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>
<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"></a>
<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" /></a>
<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>
@ -145,7 +145,7 @@ $j(document).ready(function(){
{% endif %} wished for this Work
{% endif %}{% endif %}
</div>
<div class="status"><img src="/static/images/images/icon-book-37by25-{% if work.first_ebook %}6{%else%}{{ work.percent_unglued }}{%endif%}.png" /></div>
<div class="status"><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>
<div class="btn_wishlist" id="wishlist_actions">
{% if request.user.is_anonymous %}
@ -158,11 +158,11 @@ $j(document).ready(function(){
</div>
{% else %}{% if work in request.user.wishlist.works.all %}
<div class="remove-wishlist-workpage">
<span id="{{ work.id }}">Remove This</span>
<span id="w{{ work.id }}">Remove This</span>
</div>
{% else %}
<div class="add-wishlist">
<span id="{{ work.googlebooks_id }}">Add to Wishlist</span>
<span id="w{{ work.googlebooks_id }}">Add to Wishlist</span>
</div>
{% endif %}{% endif %}{% endif %}
{% if work.first_ebook %}
@ -213,6 +213,8 @@ $j(document).ready(function(){
{% 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>
@ -257,7 +259,7 @@ $j(document).ready(function(){
{{ claimform.user }}
{{ claimform.work }}
{{ claimform.rights_holder }}
<input type="submit" name="submit" value="Claim" id="submit">
<input type="submit" name="submit" value="Claim">
</form><br />
{% endif %}
@ -270,7 +272,7 @@ $j(document).ready(function(){
{{ claimform.user }}
{{ claimform.work }}
{{ claimform.rights_holder }}
<input type="submit" name="submit" value="Claim" id="submit">
<input type="submit" name="submit" value="Claim" >
</form><br />
{% else %}
Are you the rights holder for this work? Please email <a href="mailto:rights@gluejar.com">rights@gluejar.com</a>.
@ -289,7 +291,7 @@ $j(document).ready(function(){
<h4>Editions</h4>
{% if alert %}<div class="alert"><b>Ebook Contribution:</b><br />{{ alert }}</div>{% endif %}
{% for edition in editions %}
<div class="editions"><div class="image"><img src="http://bks{% cycle '1' '2' '3' '4' '5' '6' '7' '8' '9' %}.books.google.com/books?id={{ edition.googlebooks_id }}&printsec=frontcover&img=1&zoom=5" /></div>
<div class="editions"><div class="image"><img src="http://bks{% cycle '1' '2' '3' '4' '5' '6' '7' '8' '9' %}.books.google.com/books?id={{ edition.googlebooks_id }}&amp;printsec=frontcover&amp;img=1&amp;zoom=5" title="edition cover" alt="edition cover" /></div>
<div class="metadata" id="edition_{{edition.id}}">Publisher: {{edition.publisher}}<br />
Published: {{edition.publication_date}}<br />
{% with edition.isbn_13 as isbn %}
@ -317,7 +319,7 @@ $j(document).ready(function(){
URL: {{ edition.ebook_form.url }}<br />
File Format: {{ edition.ebook_form.format }}&nbsp;&nbsp;&nbsp;
License: {{ edition.ebook_form.rights }}<br />
<input type="submit" name="add_ebook" value="add ebook" id="submit" />
<input type="submit" name="add_ebook" value="add ebook" />
</form>
</div>
{% endifnotequal %}{% endif %}
@ -336,11 +338,11 @@ $j(document).ready(function(){
<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>
<a href="https://twitter.com/intent/tweet?url={{request.build_absolute_uri|urlencode:"" }}&text=I'm%20ungluing%20{{ work.title|urlencode }}%20at%20%40unglueit"><li class="twitter"><span>Twitter</span></li></a>
<a href="https://twitter.com/intent/tweet?url={{request.build_absolute_uri|urlencode:"" }}&amp;text=I%27m%20ungluing%20{{ work.title|urlencode }}%20at%20%40unglueit"><li class="twitter"><span>Twitter</span></li></a>
{% 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>
<div id="widgetcode">Copy/paste this into your site:<br /><textarea rows="7" cols="22">&lt;iframe src="https://{{request.META.HTTP_HOST}}/api/widget/{{work.first_isbn_13}}/" width="152" height="325" frameborder="0"&gt;&lt;/iframe&gt;</textarea></div>
</ul>
<div id="widgetcode">Copy/paste this into your site:<br /><textarea rows="7" cols="22">&lt;iframe src="https://{{request.META.HTTP_HOST}}/api/widget/{{work.first_isbn_13}}/" width="152" height="325" frameborder="0"&gt;&lt;/iframe&gt;</textarea></div>
</div>
</div>
{% if status == 'ACTIVE' %}

View File

@ -34,11 +34,11 @@
<label>Find it here</label>
<!-- todo: these should be a real thing -->
<div class="find-link">
<a class="find-google" href="#"><img src="/static/images/icons/google.png" align="" title="" /></a>
<a class="find-group" href="#"><img src="/static/images/icons/group.png" align="" title="" /></a>
<a class="find-google" href="#"><img src="/static/images/icons/google.png" title="" /></a>
<a class="find-group" href="#"><img src="/static/images/icons/group.png" title="" /></a>
</div>
</div>
<div class="pledged-info"><div class="pledged-group">0 Ungluers have pledged $0</div><div class="status"><img src="/static/images/images/icon-book-37by25-0.png" /></div></div>
<div class="pledged-info"><div class="pledged-group">0 Ungluers have pledged $0</div><div class="status"><img src="/static/images/images/icon-book-37by25-0.png" title="book list status" alt="book list status" /></div></div>
</div>
</div>
<div id="tabs" class="content-block-heading">

View File

@ -128,10 +128,10 @@ def work(request, work_id, action='display'):
except IndexError:
pubdate = 'unknown'
if not request.user.is_anonymous():
claimform = UserClaimForm( request.user, data={'work':work.pk, 'user': request.user.id})
claimform = UserClaimForm( request.user, data={'work':work.pk, 'user': request.user.id}, prefix = 'claim')
for edition in editions:
#edition.ebook_form = EbookForm( data = {'user':request.user.id, 'edition':edition.pk })
edition.ebook_form = EbookForm( instance= models.Ebook(user = request.user, edition = edition, provider = 'x' ) )
edition.ebook_form = EbookForm( instance= models.Ebook(user = request.user, edition = edition, provider = 'x' ), prefix = 'ebook_%d'%edition.id)
else:
claimform = None
if campaign:
@ -916,13 +916,26 @@ def wishlist(request):
# TODO: redirect to work page, when it exists
return HttpResponseRedirect('/')
elif remove_work_id:
work = models.Work.objects.get(id=int(remove_work_id))
try:
work = models.Work.objects.get(id=int(remove_work_id))
except models.Work.DoesNotExist:
try:
work = models.WasWork.objects.get(was = work_id).work
except models.WasWork.DoesNotExist:
raise Http404
request.user.wishlist.remove_work(work)
# TODO: where to redirect?
return HttpResponseRedirect('/')
elif add_work_id:
# if adding from work page, we have may work.id, not googlebooks_id
work = models.Work.objects.get(pk=add_work_id)
try:
work = models.Work.objects.get(pk=add_work_id)
except models.Work.DoesNotExist:
try:
work = models.WasWork.objects.get(was = work_id).work
except models.WasWork.DoesNotExist:
raise Http404
request.user.wishlist.add_work(work,'user')
return HttpResponseRedirect('/')

View File

@ -114,4 +114,11 @@ CELERYD_HIJACK_ROOT_LOGGER = False
# a debug_toolbar setting
INTERNAL_IPS = ('127.0.0.1',)
CELERYD_LOG_LEVEL = "INFO"
CELERYD_LOG_LEVEL = "INFO"
# an optional setting to change regluit.utils.localdatetime._now -- setting it to None will cause
# a default _now() to be computed in regluit.utils.localdatetime
LOCALDATETIME_NOW = None

View File

@ -273,7 +273,7 @@ input.profile-save {
display: inline-block;
vertical-align: middle;
}
#loadgr div, #loadgr input {
#goodreads_shelves, #loadgr input {
margin: auto 10px auto 36px;
}
#loadlt {

View File

@ -6,7 +6,7 @@ $j().ready(function() {
contentblock.on("click", "div.add-wishlist", function () {
var span = $j(this).find("span");
var gb_id = span.attr('id')
var gb_id = span.attr('id').substring(1)
if (!gb_id) return;
// give immediate feedback that action is in progress
@ -21,7 +21,7 @@ $j().ready(function() {
contentblock.on("click", "div.remove-wishlist", function() {
var span = $j(this).find("span");
var book = $j(this).closest('.thewholebook');
var work_id = span.attr('id')
var work_id = span.attr('id').substring(1)
span.html('Removing...');
jQuery.post('/wishlist/', {'remove_work_id': work_id}, function(data) {
book.fadeOut();
@ -41,7 +41,7 @@ $j().ready(function() {
// we're going to have to tell /wishlist/ that we're feeding it a different identifier
contentblock.on("click", "div.remove-wishlist-workpage", function () {
var span = $j(this).find("span");
var work_id = span.attr('id')
var work_id = span.attr('id').substring(1)
// provide feedback
span.html('Removing...');

View File

@ -200,7 +200,7 @@ input.profile-save {
vertical-align: middle;
}
div, input {
#goodreads_shelves, input {
margin: auto 10px auto 36px;
}
}

View File

@ -22,15 +22,21 @@ datetime.datetime(2012, 3, 8, 14, 1, 54, 650679)
import datetime
import django
from django.conf import settings
# for Django 1.3.x, return a timestamp naive now()
# for Django 1.4 should switch to django.utils.timezone.now()
# see https://code.djangoproject.com/browser/django/trunk/django/utils/timezone.py?rev=17642#L232
try:
_now = django.utils.timezone.now
except AttributeError, e:
_now = datetime.datetime.now
# if there is a LOCALDATETIME_NOW in the Django settings, use that to be _now
if hasattr(settings, 'LOCALDATETIME_NOW') and settings.LOCALDATETIME_NOW is not None:
_now = settings.LOCALDATETIME_NOW
else:
try:
_now = django.utils.timezone.now
except AttributeError, e:
_now = datetime.datetime.now
now = lambda: _now()