parent
4dbfcfa98b
commit
a4264ac16c
3 changed files with 101 additions and 94 deletions
|
@ -11,6 +11,7 @@ export default Model.extend({
|
||||||
collectionStartTime: attr('string-null-to-empty'),
|
collectionStartTime: attr('string-null-to-empty'),
|
||||||
collectionEndDate: attr('string-null-to-empty'),
|
collectionEndDate: attr('string-null-to-empty'),
|
||||||
collectionEndTime: attr('string-null-to-empty'),
|
collectionEndTime: attr('string-null-to-empty'),
|
||||||
|
notes: attr('string'),
|
||||||
|
|
||||||
project: belongsTo('project'),
|
project: belongsTo('project'),
|
||||||
studyLocation: belongsTo('study-location'),
|
studyLocation: belongsTo('study-location'),
|
||||||
|
|
|
@ -92,95 +92,105 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<table class="table">
|
<div class="row">
|
||||||
<caption>
|
<div class="col-md-12">
|
||||||
Species / Count Info
|
{{#validated-field property='notes' label='Notes' changeset=changesets.model}}
|
||||||
{{action-button isSuccess=true isXSmall=true label='+' onClick=(action 'addHasMany' 'collection-species' 'collectionSpecies')}}
|
{{textarea value=changesets.model.notes class='form-control'}}
|
||||||
</caption>
|
{{/validated-field}}
|
||||||
<thead>
|
</div>
|
||||||
<tr>
|
</div>
|
||||||
<th class="col-md-3">Species</th>
|
<div class="row">
|
||||||
<th class="col-md-3">Count</th>
|
<div class="col-md-12">
|
||||||
<th class="col-md-3">Count Estimated</th>
|
<table class="table">
|
||||||
<th class="col-md-3">Sex</th>
|
<caption>
|
||||||
<th class="col-md-1">Delete</th>
|
Species / Count Info
|
||||||
</tr>
|
{{action-button isSuccess=true isXSmall=true label='+' onClick=(action 'addHasMany' 'collection-species' 'collectionSpecies')}}
|
||||||
</thead>
|
</caption>
|
||||||
<tbody>
|
<thead>
|
||||||
{{#each changesets.hasMany.collectionSpecies as |cs|}}
|
<tr>
|
||||||
<tr class="form">
|
<th class="col-md-3">Species</th>
|
||||||
<td class="col-md-3">
|
<th class="col-md-3">Count</th>
|
||||||
{{#validated-field property='species' changeset=cs.changeset}}
|
<th class="col-md-3">Count Estimated</th>
|
||||||
{{#power-select
|
<th class="col-md-3">Sex</th>
|
||||||
options=options.species
|
<th class="col-md-1">Delete</th>
|
||||||
selected=cs.changeset.species
|
</tr>
|
||||||
onchange=(action (mut cs.changeset.species))
|
</thead>
|
||||||
searchField='commonName'
|
<tbody>
|
||||||
as |species|
|
{{#each changesets.hasMany.collectionSpecies as |cs|}}
|
||||||
}}
|
<tr class="form">
|
||||||
{{species.commonName}}
|
<td class="col-md-3">
|
||||||
{{/power-select}}
|
{{#validated-field property='species' changeset=cs.changeset}}
|
||||||
{{/validated-field}}
|
{{#power-select
|
||||||
</td>
|
options=options.species
|
||||||
<td class="col-md-3">
|
selected=cs.changeset.species
|
||||||
{{#validated-field property='count' changeset=cs.changeset}}
|
onchange=(action (mut cs.changeset.species))
|
||||||
{{input value=cs.changeset.count}}
|
searchField='commonName'
|
||||||
{{/validated-field}}
|
as |species|
|
||||||
</td>
|
}}
|
||||||
<td class="col-md-3">
|
{{species.commonName}}
|
||||||
{{#validated-field property='countEstimated' changeset=cs.changeset}}
|
{{/power-select}}
|
||||||
{{input checked=cs.changeset.countEstimated type='checkbox'}}
|
{{/validated-field}}
|
||||||
{{/validated-field}}
|
</td>
|
||||||
</td>
|
<td class="col-md-3">
|
||||||
<td class="col-md-3">
|
{{#validated-field property='count' changeset=cs.changeset}}
|
||||||
{{#validated-field property='sex' changeset=cs.changeset}}
|
{{input value=cs.changeset.count}}
|
||||||
{{input value=cs.changeset.sex}}
|
{{/validated-field}}
|
||||||
{{/validated-field}}
|
</td>
|
||||||
</td>
|
<td class="col-md-3">
|
||||||
<td class="col-md-2">
|
{{#validated-field property='countEstimated' changeset=cs.changeset}}
|
||||||
{{action-button isDanger=true isXSmall=true label='X' onClick=(action 'deleteHasMany' cs 'collectionSpecies')}}
|
{{input checked=cs.changeset.countEstimated type='checkbox'}}
|
||||||
</td>
|
{{/validated-field}}
|
||||||
</tr>
|
</td>
|
||||||
{{/each}}
|
<td class="col-md-3">
|
||||||
</tbody>
|
{{#validated-field property='sex' changeset=cs.changeset}}
|
||||||
</table>
|
{{input value=cs.changeset.sex}}
|
||||||
</div>
|
{{/validated-field}}
|
||||||
</div>
|
</td>
|
||||||
<div class="row">
|
<td class="col-md-2">
|
||||||
<div class="col-md-12">
|
{{action-button isDanger=true isXSmall=true label='X' onClick=(action 'deleteHasMany' cs 'collectionSpecies')}}
|
||||||
<form enctype="multipart/form-data">
|
</td>
|
||||||
<table class="table">
|
</tr>
|
||||||
<caption>
|
{{/each}}
|
||||||
Attachments
|
</tbody>
|
||||||
{{action-button isSuccess=true isXSmall=true label='+' onClick=(action 'addHasMany' 'datasheet-attachment' 'datasheets')}}
|
</table>
|
||||||
</caption>
|
</div>
|
||||||
<thead>
|
</div>
|
||||||
<tr>
|
<div class="row">
|
||||||
<th>File</th>
|
<div class="col-md-12">
|
||||||
<th>Delete</th>
|
<form enctype="multipart/form-data">
|
||||||
</tr>
|
<table class="table">
|
||||||
</thead>
|
<caption>
|
||||||
<tbody>
|
Attachments
|
||||||
{{#each changesets.hasMany.datasheets as |d|}}
|
{{action-button isSuccess=true isXSmall=true label='+' onClick=(action 'addHasMany' 'datasheet-attachment' 'datasheets')}}
|
||||||
<tr class="form">
|
</caption>
|
||||||
<td>
|
<thead>
|
||||||
{{#if d.model.isNew}}
|
<tr>
|
||||||
{{#validated-field property='datasheet' changeset=d.changeset}}
|
<th>File</th>
|
||||||
<input type="file" onchange={{action 'updateDatasheet' d.changeset}} accept="image/png,image/jpeg,application/pdf">
|
<th>Delete</th>
|
||||||
{{/validated-field}}
|
</tr>
|
||||||
{{else}}
|
</thead>
|
||||||
<a href="{{ d.model.datasheet }}">{{ d.model.datasheet }}</a>
|
<tbody>
|
||||||
{{/if}}
|
{{#each changesets.hasMany.datasheets as |d|}}
|
||||||
</td>
|
<tr class="form">
|
||||||
<td>
|
<td>
|
||||||
{{action-button isDanger=true isXSmall=true label='X' onClick=(action 'deleteHasMany' d 'datasheets')}}
|
{{#if d.model.isNew}}
|
||||||
</td>
|
{{#validated-field property='datasheet' changeset=d.changeset}}
|
||||||
</tr>
|
<input type="file" onchange={{action 'updateDatasheet' d.changeset}} accept="image/png,image/jpeg,application/pdf">
|
||||||
{{/each}}
|
{{/validated-field}}
|
||||||
</tbody>
|
{{else}}
|
||||||
</table>
|
<a href="{{ d.model.datasheet }}">{{ d.model.datasheet }}</a>
|
||||||
</form>
|
{{/if}}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{action-button isDanger=true isXSmall=true label='X' onClick=(action 'deleteHasMany' d 'datasheets')}}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{/each}}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{f.save}} {{f.cancel}}
|
{{f.save}} {{f.cancel}}
|
||||||
|
|
|
@ -36,11 +36,7 @@
|
||||||
<h3>Notes</h3>
|
<h3>Notes</h3>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<ul>
|
{{model.[0].notes}}
|
||||||
<li>PLACEHOLDER</li>
|
|
||||||
<li>PLACEHOLDER</li>
|
|
||||||
<li>PLACEHOLDER</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue