Merge branch 'master' into payment

pull/1/head
Raymond Yee 2011-12-07 10:10:05 -08:00
commit 6d48f9c3f7
8 changed files with 93 additions and 33 deletions

View File

@ -132,20 +132,27 @@ var $j = jQuery.noConflict();
<div class="jsmodule">
<h3 class="module-title">Start Ungluing Now!</h3>
<div class="jsmod-content">
<form action='/accounts/register/' method='post'>{% csrf_token %}
<div class="user-name">
<label>Username</label>
<input type="text" size="25" value="" name="username" />
</div>
<div class="password">
<label>Password</label>
<input type="text" size="25" value="" name="password" />
<input id="id_username" type="text" class="required" name="username" maxlength="30" size="25" />
</div>
<div class="email">
<label>Email</label>
<input type="text" size="25" value="" name="email" />
<input id="id_email" type="text" class="required" name="email" maxlength="75" size="25" />
</div>
<div class="password">
<label>Password</label>
<input id="id_password1" type="password" class="required" name="password1" size="25" />
</div>
<div class="password">
<label>Password (again):</label>
<input id="id_password2" type="password" class="required" name="password2" size="25" />
</div>
<div class="button">
<input type="button" value="Submit" />
<input type="submit" value="sign up" />
</div>
<div>
<p><a href="/socialauth/login/google?next=http://{{ request.get_host }}{{ next }}"><img src="{{ STATIC_URL }}/images/auth/google_64.png">Sign In With Google</a></p>
</div>
</div>

View File

@ -1,22 +1,23 @@
{% extends "base.html" %}
{% block title %}
{{ work.title }}
{% endblock %}
{% block extra_head %}
<link type="text/css" rel="stylesheet" href="/static/css/campaign.css" />
{% block title %}&#151; {{ work.title }}{% endblock %}
{% block extra_css %}
<link type="text/css" rel="stylesheet" href="/static/css/campaign.css" />
{% endblock %}
{% block base_js %}
<script type="text/javascript" src="/static/js/jquery-1.6.3.min.js"></script>
<script type="text/javascript" src="/static/js/jquery-ui-1.8.16.custom.min.js"></script>
<script type="text/javascript" src="/static/js/wishlist.js"></script>
<script type="text/javascript" src="/static/js/tabs4.js"></script>
<script>
$(document).ready(function(){
$('#embed').click(function(){
$('div#widgetcode').toggle();
jQuery(document).ready(function(){
jQuery('#embed').click(function(){
jQuery('div#widgetcode').toggle();
});
});
</script>
{% endblock %}
{% block content %}
@ -85,7 +86,21 @@ $(document).ready(function(){
{% else %}
{{ wishers }} Ungluers have
{% endif %}wished for this Work</div><div class="status"><img src="/static/images/images/icon-book-37by25-{{ work.percent_unglued }}.png" /></div></div>
<div class="btn_support">Add/drop from wishlist</div>
<div class="btn_support">
{% if request.user.is_anonymous %}
<div class="create-account">
<span title="{% url work work.id %}">Login to Add</span>
</div>
{% else %}{% if work in request.user.wishlist.works.all %}
<div class="remove-wishlist">
<span id="{{ work.id }}">Remove This</span>
</div>
{% else %}
<div class="add-wishlist">
<span id="{{ work.googlebooks_id }}">Add to Wishlist</span>
</div>
{% endif %}{% endif %}
</div>
{% endif %}
</div>
</div>

View File

@ -255,3 +255,23 @@ a {
color: #3d4e53;
font-size: 12px;
}
.add-wishlist,
.remove-wishlist,
.on-wishlist,
.create-account {
margin-right: 10px;
padding-right: 10px;
width: 136px;
float: left;
cursor: pointer;
}
.add-wishlist span,
.remove-wishlist span,
.on-wishlist span,
.create-account span {
font-weight: normal;
color: #3d4e53;
text-transform: none;
background: url("/static/images/booklist/add-wishlist.png") left center no-repeat;
padding-left: 20px;
}

View File

@ -5,6 +5,7 @@
display choices accordingly
or we could just suppress display of those elements and not worry about it for now
so we are, with this stylesheet
(it must go AFTER book_panel.css so these rules will override those)
hackish solution ftw!
*/
div.book-list div.booklist-status, .booklist-status, .icons {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -1,13 +1,13 @@
$(document).ready(function() {
jQuery(document).ready(function() {
$(".add-wishlist").each(function (index, element) {
$(element).click(function() {
var span = $(element).find("span");
jQuery(".add-wishlist").each(function (index, element) {
jQuery(element).click(function() {
var span = jQuery(element).find("span");
var gb_id = span.attr('id')
if (!gb_id) return;
$.post('/wishlist/', {'googlebooks_id': gb_id}, function(data) {
jQuery.post('/wishlist/', {'googlebooks_id': gb_id}, function(data) {
span.fadeOut();
var newSpan = $('<span class="on-wishlist">On Your Wishlist!</span>').hide();
var newSpan = jQuery('<span class="on-wishlist">On Your Wishlist!</span>').hide();
span.replaceWith(newSpan);
newSpan.fadeIn('slow');
newSpan.removeAttr("id");
@ -15,20 +15,20 @@ $(document).ready(function() {
});
});
$(".remove-wishlist").each(function (index, element) {
$(element).click(function() {
var span = $(element).find("span");
jQuery(".remove-wishlist").each(function (index, element) {
jQuery(element).click(function() {
var span = jQuery(element).find("span");
var work_id = span.attr('id')
$.post('/wishlist/', {'remove_work_id': work_id}, function(data) {
var book = $(element).parent();
jQuery.post('/wishlist/', {'remove_work_id': work_id}, function(data) {
var book = jQuery(element).parent();
book.fadeOut();
});
});
});
$(".create-account").each(function (index, element) {
$(element).click(function() {
var span = $(element).find("span");
jQuery(".create-account").each(function (index, element) {
jQuery(element).click(function() {
var span = jQuery(element).find("span");
var work_url = span.attr('title')
window.location = "/accounts/login/?next=" + work_url;
});

View File

@ -104,7 +104,7 @@
}
.btn_support a {
background:url("@{image-base}btn_bg.png") 0 0 no-repeat;
background:url("@{image-base}btn_bg.png") 0 0 no-repeat;
width:104px;
height:41px;
line-height:41px;
@ -274,4 +274,20 @@ ul.support li {
}
/* differs from sitewide.css. should it? */
a{ color:#3d4e53; font-size:12px;}
a{ color:#3d4e53; font-size:12px;}
.add-wishlist, &.remove-wishlist, &.on-wishlist, &.create-account {
margin-right: 10px;
padding-right: 10px;
width: 136px;
float: left;
cursor: pointer;
span {
font-weight:normal;
color:@text-blue;
text-transform: none;
background:url("@{image-base}booklist/add-wishlist.png") left center no-repeat;
padding-left:20px;
}
}

View File

@ -5,6 +5,7 @@
display choices accordingly
or we could just suppress display of those elements and not worry about it for now
so we are, with this stylesheet
(it must go AFTER book_panel.css so these rules will override those)
hackish solution ftw!
*/