Rough in characteristics

This commit is contained in:
Matthew Dillon 2015-03-26 16:26:07 -08:00
parent c5cb0ec145
commit d587f14af4
13 changed files with 187 additions and 0 deletions

View file

@ -0,0 +1,5 @@
import SortableController from '../sortable';
export default SortableController.extend({
sortBy: 'characteristicName',
});

View file

@ -0,0 +1,11 @@
import DS from 'ember-data';
export default DS.Model.extend({
characteristicName: DS.attr('string'),
characteristicType: DS.attr('string'),
strains: DS.hasMany('strain'),
measurements: DS.hasMany('measurements'),
createdAt: DS.attr('date'),
updatedAt: DS.attr('date'),
deletedAt: DS.attr('date')
});

View file

@ -13,6 +13,7 @@ Router.map(function() {
this.resource('measurements', function() {});
});
});
this.resource('characteristics', function() {});
});
export default Router;

View file

@ -0,0 +1,4 @@
import Ember from 'ember';
import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin';
export default Ember.Route.extend(AuthenticatedRouteMixin);

View file

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

View file

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

View file

@ -0,0 +1 @@
{{outlet}}

View file

@ -0,0 +1,19 @@
<h2>Hymenobacter Characteristics</h2>
<h3>Total characteristics: {{controller.length}}</h3>
<table class="flakes-table">
<thead>
<tr>
<th {{action "setSortBy" "characteristicName"}}>Name</th>
<th {{action "setSortBy" "characteristicType"}}>Type</th>
</tr>
</thead>
<tbody>
{{#each characteristic in controller}}
<tr>
<td>{{characteristic.characteristicName}}</td>
<td>{{characteristic.characteristicType}}</td>
</tr>
{{/each}}
</tbody>
</table>