Species edit refactor
This commit is contained in:
parent
cdc825cc6a
commit
45223fd57f
16 changed files with 181 additions and 160 deletions
|
@ -5,10 +5,11 @@ export default Ember.Route.extend(AuthenticatedRouteMixin, {
|
|||
model: function() {
|
||||
return Ember.RSVP.hash({
|
||||
species: this.store.findAll('species'),
|
||||
strains: this.store.findAll('strain'),
|
||||
});
|
||||
},
|
||||
|
||||
setupController: function(controller, model) {
|
||||
controller.setProperties(model);
|
||||
setupController: function(controller, models) {
|
||||
controller.setProperties(models);
|
||||
},
|
||||
});
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<h2>{{genus-name}} Species</h2>
|
||||
<h3>Total species: {{species.length}}</h3>
|
||||
<h3>Total species: {{model.length}}</h3>
|
||||
|
||||
{{add-button label="Add Species" link="species.new"}}
|
||||
|
||||
|
@ -11,17 +11,17 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each sortedSpecies as |row|}}
|
||||
{{#each sortedSpecies as |species|}}
|
||||
<tr>
|
||||
<td>
|
||||
<em>
|
||||
{{#link-to 'species.show' row}}
|
||||
{{row.speciesName}}
|
||||
{{#link-to 'species.show' species}}
|
||||
{{species.speciesName}}
|
||||
{{/link-to}}
|
||||
</em>
|
||||
</td>
|
||||
<td>
|
||||
{{#each row.strains as |strain index|}}
|
||||
{{#each species.strains as |strain index|}}
|
||||
{{if index ","}}
|
||||
{{#link-to 'strains.show' strain.id}}
|
||||
{{{strain.strainNameMU}}}
|
||||
|
|
Reference in a new issue