diff --git a/app/assets/javascripts/outfits/edit.js b/app/assets/javascripts/outfits/edit.js index 72ee1e7b..59243814 100644 --- a/app/assets/javascripts/outfits/edit.js +++ b/app/assets/javascripts/outfits/edit.js @@ -1144,10 +1144,10 @@ View.Search = function (wardrobe) { nc: $('#advanced-search-nc').val(), occupies: $('#advanced-search-occupies').val(), restricts: $('#advanced-search-restricts').val(), - species: $('#advanced-search-species').is(":checked") ? + species: $('#advanced-search-species').is(':checked') ? wardrobe.outfits.getPetType().species_id : null, - owns: $('#advanced-search-owns').val(), - wants: $('#advanced-search-wants').val() + owns: $('#advanced-search-owns').is(':checked'), + wants: $('#advanced-search-wants').is(':checked') }; wrapper.removeClass('advanced'); loadPage(1); @@ -1282,6 +1282,10 @@ View.Search = function (wardrobe) { appendTo(restricts); }); }); + + if ($('meta[name=user-signed-in]').attr('content') === 'true') { + wrapper.find('li.must-log-in input').removeAttr('disabled'); + } } View.PrankColorMessage = function(wardrobe) { diff --git a/app/assets/javascripts/wardrobe.js b/app/assets/javascripts/wardrobe.js index 50f6ae99..2b67f1a7 100644 --- a/app/assets/javascripts/wardrobe.js +++ b/app/assets/javascripts/wardrobe.js @@ -1333,6 +1333,12 @@ function Wardrobe() { if (query.species) filters.push({key: "species_support_id", value: query.species, is_positive: true}); + if (query.owns) + filters.push({key: "user_closet_hanger_ownership", value: true, + is_positive: true}); + if (query.wants) + filters.push({key: "user_closet_hanger_ownership", value: false, + is_positive: true}); return filters; } diff --git a/app/assets/stylesheets/outfits/_edit.sass b/app/assets/stylesheets/outfits/_edit.sass index 879f647b..dc8626b2 100644 --- a/app/assets/stylesheets/outfits/_edit.sass +++ b/app/assets/stylesheets/outfits/_edit.sass @@ -861,6 +861,8 @@ body.outfits-edit display: none #preview-outfits-list display: block + #advanced-search-log-in-link + display: none &.user-not-signed-in #save-outfit-not-signed-in diff --git a/app/views/outfits/edit.html.haml b/app/views/outfits/edit.html.haml index db4c2d55..9eeff4e6 100644 --- a/app/views/outfits/edit.html.haml +++ b/app/views/outfits/edit.html.haml @@ -160,7 +160,8 @@ %input{type: 'checkbox', id: 'advanced-search-wants', disabled: true} %label{for: 'advanced-search-wants'} Only include items you want -# TODO: update return_to - = link_to 'Log in to use these filters.', login_path_with_return_to + = link_to 'Log in to use these filters.', login_path_with_return_to, + id: 'advanced-search-log-in-link' #no-assets-full-message= t '.sidebar.closet.no_data.description'