forked from OpenNeo/impress
filter by user owns/wants
This commit is contained in:
parent
afface7fa7
commit
d557daadf4
4 changed files with 17 additions and 4 deletions
|
@ -1144,10 +1144,10 @@ View.Search = function (wardrobe) {
|
||||||
nc: $('#advanced-search-nc').val(),
|
nc: $('#advanced-search-nc').val(),
|
||||||
occupies: $('#advanced-search-occupies').val(),
|
occupies: $('#advanced-search-occupies').val(),
|
||||||
restricts: $('#advanced-search-restricts').val(),
|
restricts: $('#advanced-search-restricts').val(),
|
||||||
species: $('#advanced-search-species').is(":checked") ?
|
species: $('#advanced-search-species').is(':checked') ?
|
||||||
wardrobe.outfits.getPetType().species_id : null,
|
wardrobe.outfits.getPetType().species_id : null,
|
||||||
owns: $('#advanced-search-owns').val(),
|
owns: $('#advanced-search-owns').is(':checked'),
|
||||||
wants: $('#advanced-search-wants').val()
|
wants: $('#advanced-search-wants').is(':checked')
|
||||||
};
|
};
|
||||||
wrapper.removeClass('advanced');
|
wrapper.removeClass('advanced');
|
||||||
loadPage(1);
|
loadPage(1);
|
||||||
|
@ -1282,6 +1282,10 @@ View.Search = function (wardrobe) {
|
||||||
appendTo(restricts);
|
appendTo(restricts);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if ($('meta[name=user-signed-in]').attr('content') === 'true') {
|
||||||
|
wrapper.find('li.must-log-in input').removeAttr('disabled');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
View.PrankColorMessage = function(wardrobe) {
|
View.PrankColorMessage = function(wardrobe) {
|
||||||
|
|
|
@ -1333,6 +1333,12 @@ function Wardrobe() {
|
||||||
if (query.species)
|
if (query.species)
|
||||||
filters.push({key: "species_support_id", value: query.species,
|
filters.push({key: "species_support_id", value: query.species,
|
||||||
is_positive: true});
|
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;
|
return filters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -861,6 +861,8 @@ body.outfits-edit
|
||||||
display: none
|
display: none
|
||||||
#preview-outfits-list
|
#preview-outfits-list
|
||||||
display: block
|
display: block
|
||||||
|
#advanced-search-log-in-link
|
||||||
|
display: none
|
||||||
|
|
||||||
&.user-not-signed-in
|
&.user-not-signed-in
|
||||||
#save-outfit-not-signed-in
|
#save-outfit-not-signed-in
|
||||||
|
|
|
@ -160,7 +160,8 @@
|
||||||
%input{type: 'checkbox', id: 'advanced-search-wants', disabled: true}
|
%input{type: 'checkbox', id: 'advanced-search-wants', disabled: true}
|
||||||
%label{for: 'advanced-search-wants'} Only include items you want
|
%label{for: 'advanced-search-wants'} Only include items you want
|
||||||
-# TODO: update return_to
|
-# 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'
|
#no-assets-full-message= t '.sidebar.closet.no_data.description'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue