{{#crud-form changesets=changesets onSave=(action onSave) onCancel=(action onCancel) as |f| }}
{{#f.content class='form'}} {{#with changesets.model as |changeset|}} {{#validated-field property='project' label='Project' changeset=changeset}} {{#power-select options=options.projects selected=changeset.project onchange=(action (mut changeset.project)) searchField='name' as |project| }} {{project.name}} {{/power-select}} {{/validated-field}} {{#validated-field property='adfgPermit' label='ADFG Permit' changeset=changeset}} {{#power-select-with-create options=options.adfgPermits selected=changeset.adfgPermit onchange=(action (mut changeset.adfgPermit)) oncreate=(action 'addOption' 'adfg-permit' 'adfgPermits' 'adfgPermit' 'name') searchField='name' as |adfgPermit term| }} {{adfgPermit.name}} {{/power-select-with-create}} {{/validated-field}} {{#validated-field property='studyLocation' changeset=changeset}} {{#power-select search=(action 'searchStudyLocation') options=options.studyLocations selected=changeset.studyLocation onchange=(action (mut changeset.studyLocation)) searchField='code' as |studyLocation| }} {{studyLocation.code}} {{/power-select}} {{/validated-field}} {{#validated-field property='collectionType' label='Collection type' changeset=changeset}} {{#power-select options=options.collectionTypes selected=changeset.collectionType onchange=(action (mut changeset.collectionType)) searchField='name' as |collectionType| }} {{collectionType.name}} {{/power-select}} {{/validated-field}} {{#validated-field property='collectionMethod' label='Collection method' changeset=changeset}} {{#power-select options=options.collectionMethods selected=changeset.collectionMethod onchange=(action (mut changeset.collectionMethod)) searchField='name' as |collectionMethod| }} {{collectionMethod.name}} {{/power-select}} {{/validated-field}} {{#validated-field property='numberOfTraps' label='Number of traps' changeset=changeset}} {{input value=changeset.numberOfTraps type='number' class='form-control'}} {{/validated-field}} {{#validated-field property='collectionStartDate' label='Collection start date' changeset=changeset}} {{ pikaday-input onSelection=(action (mut changeset.collectionStartDate)) value=changeset.collectionStartDate useUTC=true placeholder='MM/DD/YYYY' format='MM/DD/YYYY' class='form-control' }} {{/validated-field}} {{#validated-field property='collectionStartTime' label='Collection start time' changeset=changeset}} {{input value=changeset.collectionStartTime type='time' class='form-control' placeholder='HH:MM:SS (24 hour)'}} {{/validated-field}} {{#validated-field property='collectionEndDate' label='Collection end date' changeset=changeset}} {{ pikaday-input onSelection=(action (mut changeset.collectionEndDate)) value=changeset.collectionEndDate useUTC=true placeholder='MM/DD/YYYY' format='MM/DD/YYYY' class='form-control' }} {{/validated-field}} {{#validated-field property='collectionEndTime' label='Collection end time' changeset=changeset}} {{input value=changeset.collectionEndTime type='time' class='form-control' placeholder='HH:MM:SS (24 hour)'}} {{/validated-field}} {{/with}} {{/f.content}}
{{#validated-field property='notes' label='Notes' changeset=changesets.model}} {{textarea value=changesets.model.notes class='form-control'}} {{/validated-field}}
{{#each changesets.hasMany.collectionSpecies as |cs|}} {{/each}}
Species / Count Info {{action-button isSuccess=true isXSmall=true label='+' onClick=(action 'addHasMany' 'collection-species' 'collectionSpecies')}}
Species Count Count Estimated Sex Delete
{{#validated-field property='species' changeset=cs.changeset}} {{#power-select options=options.species selected=cs.changeset.species onchange=(action (mut cs.changeset.species)) searchField='commonName' as |species| }} {{species.commonName}} {{/power-select}} {{/validated-field}} {{#validated-field property='count' changeset=cs.changeset}} {{input value=cs.changeset.count}} {{/validated-field}} {{#validated-field property='countEstimated' changeset=cs.changeset}} {{input checked=cs.changeset.countEstimated type='checkbox'}} {{/validated-field}} {{#validated-field property='sex' changeset=cs.changeset}} {{#power-select options=options.sexes selected=cs.changeset.sex onchange=(action (mut cs.changeset.sex)) searchField='name' as |sex| }} {{sex.name}} {{/power-select}} {{/validated-field}} {{action-button isDanger=true isXSmall=true label='X' onClick=(action 'deleteHasMany' cs 'collectionSpecies')}}
{{#each changesets.hasMany.envMeasurements as |cm|}} {{/each}}
Environmental Measurements {{action-button isSuccess=true isXSmall=true label='+' onClick=(action 'addHasMany' 'collection-measurement' 'envMeasurements')}}
Date Measured Time Measured Water Temperature (deg C) Air Temperature (deg C) Delete
{{#validated-field property='dateMeasured' changeset=cm.changeset}} {{ pikaday-input onSelection=(action (mut cm.changeset.dateMeasured)) value=cm.changeset.dateMeasured useUTC=true placeholder='MM/DD/YYYY' format='MM/DD/YYYY' class='form-control' }} {{/validated-field}} {{#validated-field property='timeMeasured' changeset=cm.changeset}} {{input value=cm.changeset.timeMeasured type='time' class='form-control'}} {{/validated-field}} {{#validated-field property='waterTempC' changeset=cm.changeset}} {{input value=cm.changeset.waterTempC class='form-control'}} {{/validated-field}} {{#validated-field property='airTempC' changeset=cm.changeset}} {{input value=cm.changeset.airTempC class='form-control'}} {{/validated-field}} {{action-button isDanger=true isXSmall=true label='X' onClick=(action 'deleteHasMany' cm 'envMeasurements')}}
{{#each changesets.hasMany.datasheets as |d|}} {{/each}}
Attachments {{action-button isSuccess=true isXSmall=true label='+' onClick=(action 'addHasMany' 'datasheet-attachment' 'datasheets')}}
File Delete
{{#if d.model.isNew}} {{#validated-field property='datasheet' changeset=d.changeset}} {{/validated-field}} {{else}} {{ d.model.datasheet }} {{/if}} {{action-button isDanger=true isXSmall=true label='X' onClick=(action 'deleteHasMany' d 'datasheets')}}
{{f.save}} {{f.cancel}} {{/crud-form}}