Test-drive metadata
This commit is contained in:
parent
4bbf931853
commit
ae7f3bdafa
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({
|
export default Ember.Controller.extend({
|
||||||
sortParams: ['speciesName', 'strainCount'],
|
sortParams: ['speciesName', 'strainCount'],
|
||||||
sortedSpecies: Ember.computed.sort('species', 'sortParams'),
|
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>
|
<h2>{{genus-name}} Species</h2>
|
||||||
<h3>Total species: {{species.length}}</h3>
|
<h3>Total species: {{species.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">
|
<table class="flakes-table">
|
||||||
<thead>
|
<thead>
|
||||||
|
|
Reference in a new issue