Merge branch 'closet'
This commit is contained in:
commit
fed5ccb7fb
6 changed files with 60 additions and 26 deletions
|
@ -20,6 +20,7 @@ class ItemsController < ApplicationController
|
|||
rescue Item::SearchError
|
||||
respond_to do |format|
|
||||
format.html { flash.now[:alert] = $!.message }
|
||||
format.json { render :json => {:error => $!.message} }
|
||||
format.js { render :json => {:error => $!.message}, :callback => params[:callback] }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -729,6 +729,12 @@ class Item < ActiveRecord::Base
|
|||
# version of Arel, and other conditions will overwrite this one. Since IDs
|
||||
# are guaranteed to be integers, let's just build our own string condition
|
||||
# and be done with it.
|
||||
|
||||
if item_ids.empty?
|
||||
raise SearchError, "You don't #{ClosetHanger.verb :you, owned_value} " +
|
||||
"any items yet. Head to Your Items to add some!"
|
||||
end
|
||||
|
||||
"id IN (#{item_ids.join(',')})"
|
||||
end
|
||||
|
||||
|
|
|
@ -546,6 +546,10 @@ body.outfits-edit
|
|||
.outfit-url
|
||||
font-size: 75%
|
||||
|
||||
#preview-search-form-error
|
||||
+error
|
||||
padding: .25em .5em
|
||||
|
||||
&.user-signed-in
|
||||
#preview-sidebar-nav-outfits
|
||||
display: block
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
.object
|
||||
= render :partial => 'item_link', :locals => {:item => item}
|
||||
= render :partial => 'items/item_link', :locals => {:item => item}
|
||||
|
||||
|
|
|
@ -210,18 +210,34 @@ function Wardrobe() {
|
|||
|
||||
Item.loadByQuery = function (query, offset, success, error) {
|
||||
var page = Math.round(offset / Item.PER_PAGE) + 1;
|
||||
$.getJSON('/items.json', {q: query, per_page: Item.PER_PAGE, page: page}, function (data) {
|
||||
var items = [], item, item_data;
|
||||
if(data.items) {
|
||||
for(var i = 0; i < data.items.length; i++) {
|
||||
item_data = data.items[i];
|
||||
item = Item.find(item_data.id);
|
||||
item.update(item_data);
|
||||
items.push(item);
|
||||
$.ajax({
|
||||
url: '/items.json',
|
||||
data: {q: query, per_page: Item.PER_PAGE, page: page},
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
var items = [], item, item_data;
|
||||
if(data.items) {
|
||||
for(var i = 0; i < data.items.length; i++) {
|
||||
item_data = data.items[i];
|
||||
item = Item.find(item_data.id);
|
||||
item.update(item_data);
|
||||
items.push(item);
|
||||
}
|
||||
success(items, data.total_pages, page);
|
||||
} else if(data.error) {
|
||||
error(data.error);
|
||||
}
|
||||
success(items, data.total_pages, page);
|
||||
} else if(data.error) {
|
||||
error(data.error);
|
||||
},
|
||||
error: function (xhr) {
|
||||
console.log($.parseJSON(xhr.responseText));
|
||||
try {
|
||||
var json = $.parseJSON(xhr.responseText);
|
||||
} catch(e) {
|
||||
$.jGrowl("There was an error running that search, probably on our end. Try again?");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(json.error) error(json.error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -650,7 +650,7 @@ body.closet_hangers-index #closet-hangers-contact {
|
|||
/* line 33, ../../../app/stylesheets/closet_hangers/_index.sass */
|
||||
body.closet_hangers-index #closet-hangers-contact a, body.closet_hangers-index #closet-hangers-contact > span {
|
||||
text-decoration: none;
|
||||
background-image: url('/images/neomail.png?1311877030');
|
||||
background-image: url('/images/neomail.png?1312167956');
|
||||
background-position: left center;
|
||||
background-repeat: no-repeat;
|
||||
color: inherit;
|
||||
|
@ -664,7 +664,7 @@ body.closet_hangers-index #closet-hangers-contact a:hover, body.closet_hangers-i
|
|||
}
|
||||
/* line 44, ../../../app/stylesheets/closet_hangers/_index.sass */
|
||||
body.closet_hangers-index #closet-hangers-contact > span {
|
||||
background-image: url('/images/neomail_edit.png?1312153508');
|
||||
background-image: url('/images/neomail_edit.png?1312167956');
|
||||
}
|
||||
/* line 47, ../../../app/stylesheets/closet_hangers/_index.sass */
|
||||
body.closet_hangers-index #closet-hangers-contact input[type=text], body.closet_hangers-index #closet-hangers-contact body.pets-bulk #bulk-pets-form textarea, body.pets-bulk #bulk-pets-form body.closet_hangers-index #closet-hangers-contact textarea {
|
||||
|
@ -2413,7 +2413,7 @@ body.outfits-edit .object:hover ul, body.outfits-edit .object:hover .object-info
|
|||
}
|
||||
/* line 419, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit .nc-icon {
|
||||
background: url('/images/nc.png?1311877029') no-repeat;
|
||||
background: url('/images/nc.png?1312167956') no-repeat;
|
||||
height: 16px;
|
||||
position: absolute;
|
||||
right: 16px;
|
||||
|
@ -3127,35 +3127,42 @@ body.outfits-edit form#save-outfit-form .outfit-star {
|
|||
body.outfits-edit .outfit-url {
|
||||
font-size: 75%;
|
||||
}
|
||||
/* line 550, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 549, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #preview-search-form-error {
|
||||
background: #fbe3e4;
|
||||
border: 1px solid #fbc2c4;
|
||||
color: #8a1f11;
|
||||
padding: 0.25em 0.5em;
|
||||
}
|
||||
/* line 554, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.user-signed-in #preview-sidebar-nav-outfits {
|
||||
display: block;
|
||||
}
|
||||
/* line 552, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 556, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.user-signed-in #save-outfit {
|
||||
display: inline-block;
|
||||
}
|
||||
/* line 556, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 560, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.user-signed-in #save-outfit-wrapper.active-outfit #save-outfit {
|
||||
display: none;
|
||||
}
|
||||
/* line 558, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 562, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.user-signed-in #save-outfit-wrapper.active-outfit #save-current-outfit, body.outfits-edit.user-signed-in #save-outfit-wrapper.active-outfit #save-outfit-copy {
|
||||
display: inline-block;
|
||||
}
|
||||
/* line 560, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 564, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.user-signed-in #save-outfit-wrapper.active-outfit #current-outfit-permalink {
|
||||
display: inline-block;
|
||||
}
|
||||
/* line 563, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 567, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.user-signed-in #save-outfit-wrapper.saving-outfit #save-outfit-form {
|
||||
display: block;
|
||||
}
|
||||
/* line 565, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 569, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.user-signed-in #save-outfit-wrapper.saving-outfit #save-outfit, body.outfits-edit.user-signed-in #save-outfit-wrapper.saving-outfit #save-current-outfit, body.outfits-edit.user-signed-in #save-outfit-wrapper.saving-outfit #save-outfit-copy, body.outfits-edit.user-signed-in #save-outfit-wrapper.saving-outfit #current-outfit-permalink, body.outfits-edit.user-signed-in #save-outfit-wrapper.saving-outfit #shared-outfit-permalink, body.outfits-edit.user-signed-in #save-outfit-wrapper.saving-outfit #share-outfit, body.outfits-edit.user-signed-in #save-outfit-wrapper.saving-outfit #shared-outfit-url {
|
||||
display: none;
|
||||
}
|
||||
/* line 567, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 571, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.user-signed-in .preview-search-form-your-items {
|
||||
display: -moz-inline-box;
|
||||
-moz-box-orient: vertical;
|
||||
|
@ -3164,15 +3171,15 @@ body.outfits-edit.user-signed-in .preview-search-form-your-items {
|
|||
*display: inline;
|
||||
*vertical-align: auto;
|
||||
}
|
||||
/* line 571, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 575, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit.user-not-signed-in #save-outfit-not-signed-in {
|
||||
display: inline-block;
|
||||
}
|
||||
/* line 575, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 579, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #save-outfit-wrapper.shared-outfit #shared-outfit-permalink, body.outfits-edit #save-outfit-wrapper.shared-outfit #shared-outfit-url {
|
||||
display: inline-block;
|
||||
}
|
||||
/* line 577, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
/* line 581, ../../../app/stylesheets/outfits/_edit.sass */
|
||||
body.outfits-edit #save-outfit-wrapper.shared-outfit #current-outfit-permalink {
|
||||
display: none !important;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue