Rough in strains.

This commit is contained in:
Matthew Dillon 2015-01-26 09:50:34 -09:00
parent 008d093520
commit 1a59456ae9
7 changed files with 91 additions and 1 deletions

View file

@ -1,9 +1,9 @@
import DS from 'ember-data'; import DS from 'ember-data';
export default DS.Model.extend({ export default DS.Model.extend({
genusId: DS.attr(),
speciesName: DS.attr(), speciesName: DS.attr(),
genus: DS.belongsTo('genus', {async: true}), genus: DS.belongsTo('genus', {async: true}),
strains: DS.hasMany('strain', {async: true}),
createdAt: DS.attr('date'), createdAt: DS.attr('date'),
updatedAt: DS.attr('date'), updatedAt: DS.attr('date'),
deletedAt: DS.attr('date') deletedAt: DS.attr('date')

14
app/models/strain.js Normal file
View file

@ -0,0 +1,14 @@
import DS from 'ember-data';
export default DS.Model.extend({
strainName: DS.attr(),
strainType: DS.attr(),
etymology: DS.attr(),
accessionBanks: DS.attr(),
genbankEmblDdb: DS.attr(),
isolatedFrom: DS.attr(),
species: DS.belongsTo('species', {async: true}),
createdAt: DS.attr('date'),
updatedAt: DS.attr('date'),
deletedAt: DS.attr('date')
});

View file

@ -10,6 +10,7 @@ Router.map(function() {
this.route('about'); this.route('about');
this.resource('genera'); this.resource('genera');
this.resource('species'); this.resource('species');
this.resource('strains');
}); });
export default Router; export default Router;

7
app/routes/strains.js Normal file
View file

@ -0,0 +1,7 @@
import Ember from 'ember';
export default Ember.Route.extend({
model: function() {
return this.store.find('strain');
}
});

View file

@ -7,6 +7,9 @@
{{#link-to 'species' tagName='li' href=false}} {{#link-to 'species' tagName='li' href=false}}
{{#link-to 'species'}}Species{{/link-to}} {{#link-to 'species'}}Species{{/link-to}}
{{/link-to}} {{/link-to}}
{{#link-to 'strains' tagName='li' href=false}}
{{#link-to 'strains'}}Strains{{/link-to}}
{{/link-to}}
{{#link-to 'about' tagName='li' href=false}} {{#link-to 'about' tagName='li' href=false}}
{{#link-to 'about'}}About{{/link-to}} {{#link-to 'about'}}About{{/link-to}}
{{/link-to}} {{/link-to}}

View file

@ -3,6 +3,10 @@
<div class="span-1"> <div class="span-1">
<fieldset class="read-only-information"> <fieldset class="read-only-information">
<legend>{{speciesName}}</legend> <legend>{{speciesName}}</legend>
<dl>
<dt>Id</dt>
<dd>{{id}}</dd>
</dl>
<dl> <dl>
<dt>Genus</dt> <dt>Genus</dt>
<dd>{{genus.genusName}}</dd> <dd>{{genus.genusName}}</dd>
@ -11,6 +15,14 @@
<dt>Species</dt> <dt>Species</dt>
<dd>{{speciesName}}</dd> <dd>{{speciesName}}</dd>
</dl> </dl>
<dl>
<dt>Strains</dt>
<dd>
{{#each strains}}
{{strainName}}
{{/each}}
</dd>
</dl>
<dl> <dl>
<dt>Created</dt> <dt>Created</dt>
<dd>{{createdAt}}</dd> <dd>{{createdAt}}</dd>

53
app/templates/strains.hbs Normal file
View file

@ -0,0 +1,53 @@
<div class="grid-1">
{{#each}}
<div class="span-1">
<fieldset class="read-only-information">
<legend>{{strainName}}</legend>
<dl>
<dt>Id</dt>
<dd>{{id}}</dd>
</dl>
<dl>
<dt>Species</dt>
<dd>{{species.speciesName}}</dd>
</dl>
<dl>
<dt>Strain</dt>
<dd>{{strainName}}</dd>
</dl>
<dl>
<dt>Type</dt>
<dd>{{strainType}}</dd>
</dl>
<dl>
<dt>Etymology</dt>
<dd>{{etymology}}</dd>
</dl>
<dl>
<dt>Accession Banks</dt>
<dd>{{accessionBanks}}</dd>
</dl>
<dl>
<dt>Genbank EMBL DDB</dt>
<dd>{{genbankEmblDdb}}</dd>
</dl>
<dl>
<dt>Isolated From</dt>
<dd>{{isolatedFrom}}</dd>
</dl>
<dl>
<dt>Created</dt>
<dd>{{createdAt}}</dd>
</dl>
<dl>
<dt>Updated</dt>
<dd>{{updatedAt}}</dd>
</dl>
<dl>
<dt>Deleted</dt>
<dd>{{deletedAt}}</dd>
</dl>
</fieldset>
</div>
{{/each}}
</div>