This commit is contained in:
Matthew Dillon 2015-06-12 14:46:38 -08:00
parent a354ecd639
commit 046fea2dbb
5 changed files with 21 additions and 17 deletions

View file

@ -16,26 +16,26 @@ export default Ember.Route.extend(AuthenticatedRouteMixin, {
models.strains = models.strains.sortBy('fullName');
let strains = models.strains.map((strain)=>{
return Ember.Object.create({
val: strain.get('id'),
lab: strain.get('fullName'),
id: strain.get('id'),
text: strain.get('fullName'),
});
});
strains.unshiftObjects(Ember.Object.create({
val: 'all',
lab: 'All Strains',
id: 'all',
text: 'All Strains',
}));
controller.set('strains', strains);
models.characteristics = models.characteristics.sortBy('characteristicName');
let characteristics = models.characteristics.map((characteristic)=>{
return Ember.Object.create({
val: characteristic.get('id'),
lab: characteristic.get('characteristicName'),
id: characteristic.get('id'),
text: characteristic.get('characteristicName'),
});
});
characteristics.unshiftObjects(Ember.Object.create({
val: 'all',
lab: 'All Characteristics',
id: 'all',
text: 'All Characteristics',
}));
controller.set('characteristics', characteristics);
},

View file

@ -5,11 +5,12 @@
</div>
<div class="span-8">
{{
view "select"
select-2
multiple=true
content=strains
optionValuePath="content.val"
optionLabelPath="content.lab"
value=selectedStrain
value=selectedStrains
optionValuePath="id"
placeholder="Choose a strain"
}}
</div>
</div>
@ -19,11 +20,12 @@
</div>
<div class="span-8">
{{
view "select"
select-2
multiple=true
content=characteristics
optionValuePath="content.val"
optionLabelPath="content.lab"
value=selectedCharacteristic
optionValuePath="id"
placeholder="Choose a characteristic"
}}
</div>
</div>

View file

@ -14,6 +14,7 @@
"qunit": "~1.17.1",
"flakes": "~1.0.0",
"ember-simple-auth": "~0.8.0-beta.3",
"moment": "~2.9.0"
"moment": "~2.9.0",
"select2": "3.5.2"
}
}

View file

@ -41,7 +41,7 @@ module.exports = function(environment) {
'font-src': "'self'",
'connect-src': "'self' http://127.0.0.1:4200",
'img-src': "'self'",
'style-src': "'self'",
'style-src': "'self' 'unsafe-inline'",
'media-src': "'self'"
}
}

View file

@ -37,6 +37,7 @@
"ember-data": "1.0.0-beta.18",
"ember-disable-proxy-controllers": "^1.0.0",
"ember-export-application-global": "^1.0.2",
"ember-select-2": "1.3.0",
"express": "^4.12.4",
"glob": "^4.5.3",
"jsonwebtoken": "^5.0.0",