clarifying that the numbers in the goodreads import drop-down are books, not shelves

pull/1/head
Andromeda Yelton 2012-03-12 15:08:47 -04:00
parent 6205417b8c
commit d0811f4d27
3 changed files with 14 additions and 5 deletions

View File

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

View File

@ -28,10 +28,19 @@ jQuery(document).ready(function($) {
// say waiting // say waiting
$('#goodreads_input').attr('value', 'Loading....'); $('#goodreads_input').attr('value', 'Loading....');
var sel = $('<select id="id_goodreads_shelf_name_number" name="goodreads_shelf_name_number"></select>').appendTo('#goodreads_shelves'); var sel = $('<select id="id_goodreads_shelf_name_number" name="goodreads_shelf_name_number"></select>').appendTo('#goodreads_shelves');
$('<option value="' + 'all:' + json.total_book_count + '">' + 'all (' + json.total_book_count +')' + '</option>').appendTo(sel); if (json.total_book_count === 1) {
$('<option value="' + 'all:' + json.total_book_count + '">' + 'all (' + json.total_book_count +' book)' + '</option>').appendTo(sel);
} else {
$('<option value="' + 'all:' + json.total_book_count + '">' + 'all (' + json.total_book_count +' books)' + '</option>').appendTo(sel);
}
for (var i = 0; i < json.user_shelves.length; i++) { for (var i = 0; i < json.user_shelves.length; i++) {
$('<option value="' + json.user_shelves[i].name + ':' + json.user_shelves[i].book_count + '">' + json.user_shelves[i].name + if (json.user_shelves[i].book_count === 1) {
' (' + json.user_shelves[i].book_count + ')' + '</option>').appendTo(sel); $('<option value="' + json.user_shelves[i].name + ':' + json.user_shelves[i].book_count + '">' + json.user_shelves[i].name +
' (' + json.user_shelves[i].book_count + ' book)' + '</option>').appendTo(sel);
} else {
$('<option value="' + json.user_shelves[i].name + ':' + json.user_shelves[i].book_count + '">' + json.user_shelves[i].name +
' (' + json.user_shelves[i].book_count + ' books)' + '</option>').appendTo(sel);
}
} }
$('#load_gr_shelves_list').attr('id','load_shelf_form'); $('#load_gr_shelves_list').attr('id','load_shelf_form');
$('#goodreads_input').attr('value', 'Add this shelf'); $('#goodreads_input').attr('value', 'Add this shelf');

View File

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