Remove search panel and related

This commit is contained in:
Matthew Dillon 2015-07-13 09:46:37 -08:00
parent 9b0528e38f
commit 6ad9ad17b8
4 changed files with 0 additions and 104 deletions

View file

@ -1,51 +0,0 @@
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ["grid-1", "gutter-50"],
setup: function() {
Ember.RSVP.hash({
species: this.store.findAll('species'),
strains: this.store.findAll('strain'),
characteristics: this.store.findAll('characteristic'),
}).then((models) => {
models['characteristicTypes'] = models.characteristics.mapBy('characteristicTypeName').uniq();
// Set up search parameters
// Clean up sort order
let selects = [
{ model: 'species', id: 'id', text: 'speciesNameMU',
children: 'strains', cid: 'id', ctext: 'strainNameMU' },
{ model: 'characteristicTypes', id: 'id', text: 'characteristicTypeName',
children: 'characteristics', cid: 'id', ctext: 'characteristicName' },
];
selects.forEach((item /*, index, enumerable*/) => {
models[item.model] = models[item.model].filter((i) => {
if (!Ember.isEmpty(i.get(item.children))) { return true; }
});
models[item.model] = models[item.model].sortBy('sortOrder');
let temp = models[item.model].map((data) => {
let temp_children = [];
let sorted_children = data.get(item.children).sortBy('sortOrder');
sorted_children.forEach((child) => {
temp_children.push({id: child.get(item.cid), text: child.get(item.ctext)});
});
return {
text: data.get(item.text),
children: temp_children,
};
});
this.set(item.model, temp);
});
});
}.on('init'),
actions: {
search: function() {
let strains = this.get('selectedStrains'),
characteristics = this.get('selectedCharacteristics');
this.sendAction('search', strains, characteristics);
},
},
});

View file

@ -1,33 +0,0 @@
<div class="span-1">
<fieldset>
<form>
<ul>
<li>
<label>Strains</label>
{{
select-2
multiple=true
content=species
value=selectedStrains
optionValuePath="id"
placeholder=strainLabel
}}
</li>
<li>
<label>Characteristics</label>
{{
select-2
multiple=true
content=characteristicTypes
value=selectedCharacteristics
optionValuePath="id"
placeholder=charLabel
}}
</li>
<li>
{{search-button isLoading=isLoading action='search'}}
</li>
</ul>
</form>
</fieldset>
</div>

View file

@ -1,13 +0,0 @@
import Ember from 'ember';
export default Ember.Component.extend({
isLoading: false,
buttonText: 'Search',
actions: {
showLoading: function() {
if (!this.get('isLoading')) {
this.sendAction('action');
}
}
}
});

View file

@ -1,7 +0,0 @@
<a class="action button-gray smaller right" {{action 'showLoading'}}>
{{#if isLoading}}
LOADING
{{else}}
{{buttonText}}
{{/if}}
</a>