diff --git a/app/models/species.js b/app/models/species.js index cb11ed3..ec1a9fd 100644 --- a/app/models/species.js +++ b/app/models/species.js @@ -1,9 +1,9 @@ import DS from 'ember-data'; export default DS.Model.extend({ - genusId: DS.attr(), speciesName: DS.attr(), genus: DS.belongsTo('genus', {async: true}), + strains: DS.hasMany('strain', {async: true}), createdAt: DS.attr('date'), updatedAt: DS.attr('date'), deletedAt: DS.attr('date') diff --git a/app/models/strain.js b/app/models/strain.js new file mode 100644 index 0000000..8f623d7 --- /dev/null +++ b/app/models/strain.js @@ -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') +}); diff --git a/app/router.js b/app/router.js index a2be1c4..8b76a92 100644 --- a/app/router.js +++ b/app/router.js @@ -10,6 +10,7 @@ Router.map(function() { this.route('about'); this.resource('genera'); this.resource('species'); + this.resource('strains'); }); export default Router; diff --git a/app/routes/strains.js b/app/routes/strains.js new file mode 100644 index 0000000..ce81372 --- /dev/null +++ b/app/routes/strains.js @@ -0,0 +1,7 @@ +import Ember from 'ember'; + +export default Ember.Route.extend({ + model: function() { + return this.store.find('strain'); + } +}); diff --git a/app/templates/application.hbs b/app/templates/application.hbs index 5a6ba9c..93ba94c 100644 --- a/app/templates/application.hbs +++ b/app/templates/application.hbs @@ -7,6 +7,9 @@ {{#link-to 'species' tagName='li' href=false}} {{#link-to 'species'}}Species{{/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'}}About{{/link-to}} {{/link-to}} diff --git a/app/templates/species.hbs b/app/templates/species.hbs index ccfa3cb..964149d 100644 --- a/app/templates/species.hbs +++ b/app/templates/species.hbs @@ -3,6 +3,10 @@