protected route
This commit is contained in:
parent
72c957f8dc
commit
eb1a8bb6e3
41 changed files with 56 additions and 43 deletions
6
app/pods/protected/characteristics/controller.js
Normal file
6
app/pods/protected/characteristics/controller.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
sortParams: ['characteristicType.characteristicTypeName', 'sortOrder'],
|
||||
sortedCharacteristics: Ember.computed.sort('characteristics', 'sortParams'),
|
||||
});
|
15
app/pods/protected/characteristics/route.js
Normal file
15
app/pods/protected/characteristics/route.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
import Ember from 'ember';
|
||||
import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin';
|
||||
|
||||
export default Ember.Route.extend(AuthenticatedRouteMixin, {
|
||||
model: function() {
|
||||
return Ember.RSVP.hash({
|
||||
characteristicTypes: this.store.findAll('characteristic-type'),
|
||||
characteristics: this.store.findAll('characteristic'),
|
||||
});
|
||||
},
|
||||
|
||||
setupController: function(controller, models) {
|
||||
controller.setProperties(models);
|
||||
},
|
||||
});
|
21
app/pods/protected/characteristics/template.hbs
Normal file
21
app/pods/protected/characteristics/template.hbs
Normal file
|
@ -0,0 +1,21 @@
|
|||
<h2>{{genus-name}} Characteristics</h2>
|
||||
<h3>Total characteristics: {{characteristics.length}}</h3>
|
||||
|
||||
<table class="flakes-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Sort Order</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each sortedCharacteristics as |row|}}
|
||||
<tr>
|
||||
<td>{{row.characteristicName}}</td>
|
||||
<td>{{row.characteristicType.characteristicTypeName}}</td>
|
||||
<td>{{row.sortOrder}}</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
Reference in a new issue