Test-drive metadata
This commit is contained in:
parent
45223fd57f
commit
3db54ea933
3 changed files with 6 additions and 10 deletions
|
@ -1,9 +0,0 @@
|
|||
import Ember from 'ember';
|
||||
import userCanAdd from '../../../utils/user-can-add';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
canAdd: function() {
|
||||
let user_role = this.get('session.currentUser.role');
|
||||
return userCanAdd(user_role);
|
||||
}.property('session.currentUser.role').readOnly(),
|
||||
});
|
|
@ -3,4 +3,9 @@ import Ember from 'ember';
|
|||
export default Ember.Controller.extend({
|
||||
sortParams: ['speciesName', 'strainCount'],
|
||||
sortedSpecies: Ember.computed.sort('species', 'sortParams'),
|
||||
|
||||
metaData: function() {
|
||||
return this.store.metadataFor('species');
|
||||
}.property('model.isLoaded').readOnly(),
|
||||
|
||||
});
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<h2>{{genus-name}} Species</h2>
|
||||
<h3>Total species: {{model.length}}</h3>
|
||||
|
||||
{{add-button label="Add Species" link="species.new"}}
|
||||
{{add-button label="Add Species" link="species.new" canAdd=metaData.canAdd}}
|
||||
|
||||
<table class="flakes-table">
|
||||
<thead>
|
||||
|
|
Reference in a new issue