Fix "New Strain" button under species edit

Fixes #23.
This commit is contained in:
Matthew Ryan Dillon 2015-10-19 16:38:45 -07:00
parent 135d7a2c2c
commit be81bb9066
3 changed files with 14 additions and 5 deletions

View file

@ -16,4 +16,9 @@ export default Ember.Route.extend({
} }
}, },
setupController: function(controller, model) {
controller.set('model', model);
controller.set('metaData', this.store.metadataFor('species'));
},
}); });

View file

@ -1,6 +1,7 @@
{{ {{
protected/species/species-form protected/species/species-form
species=model species=model
metaData=metaData
save="save" save="save"
cancel="cancel" cancel="cancel"
}} }}

View file

@ -11,8 +11,9 @@
{{input type="checkbox" checked=species.typeSpecies}} {{if species.typeSpecies 'Yes' 'No'}} {{input type="checkbox" checked=species.typeSpecies}} {{if species.typeSpecies 'Yes' 'No'}}
</div> </div>
</div> </div>
<div data-row-span="2"> {{#unless species.isNew}}
<div data-field-span="2"> <div data-row-span="1">
<div data-field-span="1">
<label>Strains</label> <label>Strains</label>
{{#each species.strains as |strain index|}} {{#each species.strains as |strain index|}}
{{if index ","}} {{if index ","}}
@ -20,11 +21,13 @@
{{{strain.strainNameMU}}} {{{strain.strainNameMU}}}
{{/link-to}} {{/link-to}}
{{/each}} {{/each}}
{{add-button label="Add Strain" link="protected.strains.new"}} {{add-button label="Add Strain" link="protected.strains.new" canAdd=metaData.canAdd}}
</div> </div>
</div> </div>
<div data-row-span="2"> {{/unless}}
<div data-field-span="2">
<div data-row-span="1">
<div data-field-span="1">
<label>Etymology</label> <label>Etymology</label>
{{text-editor value=species.etymology}} {{text-editor value=species.etymology}}
</div> </div>