ENH: Refactor hasMany relations (#59)

Fixes #52
This commit is contained in:
Matthew Ryan Dillon 2017-12-04 05:32:39 -07:00 committed by GitHub
parent af9ac976dc
commit 4dbfcfa98b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 31 additions and 53 deletions

View file

@ -6,6 +6,7 @@
collectionSpecies=CollectionSpeciesValidations
datasheet=DatasheetValidations)
options=options
hasMany=hasMany
onSave=(action 'onSave')
onCancel=(action 'onCancel')
}}

View file

@ -6,6 +6,7 @@
collectionSpecies=CollectionSpeciesValidations
datasheet=DatasheetValidations)
options=options
hasMany=hasMany
onSave=(action 'onSave')
onCancel=(action 'onCancel')
}}

View file

@ -95,7 +95,7 @@
<table class="table">
<caption>
Species / Count Info
{{action-button isSuccess=true isXSmall=true label='+' onClick=(action 'addCollectionSpecies')}}
{{action-button isSuccess=true isXSmall=true label='+' onClick=(action 'addHasMany' 'collection-species' 'collectionSpecies')}}
</caption>
<thead>
<tr>
@ -138,7 +138,7 @@
{{/validated-field}}
</td>
<td class="col-md-2">
{{action-button isDanger=true isXSmall=true label='X' onClick=(action 'deleteCollectionSpecies' cs)}}
{{action-button isDanger=true isXSmall=true label='X' onClick=(action 'deleteHasMany' cs 'collectionSpecies')}}
</td>
</tr>
{{/each}}
@ -152,7 +152,7 @@
<table class="table">
<caption>
Attachments
{{action-button isSuccess=true isXSmall=true label='+' onClick=(action 'addDatasheet')}}
{{action-button isSuccess=true isXSmall=true label='+' onClick=(action 'addHasMany' 'datasheet-attachment' 'datasheets')}}
</caption>
<thead>
<tr>
@ -173,7 +173,7 @@
{{/if}}
</td>
<td>
{{action-button isDanger=true isXSmall=true label='X' onClick=(action 'deleteDatasheet' d)}}
{{action-button isDanger=true isXSmall=true label='X' onClick=(action 'deleteHasMany' d 'datasheets')}}
</td>
</tr>
{{/each}}