{{#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 options=options.adfgPermits selected=changeset.adfgPermit onchange=(action (mut changeset.adfgPermit)) searchField='name' as |adfgPermit| }} {{adfgPermit.name}} {{/power-select}} {{/validated-field}} {{#validated-field property='studyLocation' label='Study location' changeset=changeset}} {{#power-select options=options.studyLocations selected=changeset.studyLocation onchange=(action (mut changeset.studyLocation)) searchField='name' as |studyLocation| }} {{studyLocation.name}} {{/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}} {{input value=changeset.collectionStartDate type='date' class='form-control'}} {{/validated-field}} {{#validated-field property='collectionStartTime' label='Collection start time' changeset=changeset}} {{input value=changeset.collectionStartTime type='time' class='form-control'}} {{/validated-field}} {{#validated-field property='collectionEndDate' label='Collection end date' changeset=changeset}} {{input value=changeset.collectionEndDate type='date' class='form-control'}} {{/validated-field}} {{#validated-field property='collectionEndTime' label='Collection end time' changeset=changeset}} {{input value=changeset.collectionEndTime type='time' class='form-control'}} {{/validated-field}} {{/with}} {{/f.content}}
{{#each changesets.hasMany.collectionSpecies as |cs|}} {{/each}}
Species / Count Info {{action-button isSuccess=true isXSmall=true label='+' onClick=(action 'addCollectionSpecies')}}
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}} {{input value=cs.changeset.sex}} {{/validated-field}} {{action-button isDanger=true isXSmall=true label='X' onClick=(action 'deleteCollectionSpecies' cs)}}
{{f.save}} {{f.cancel}} {{/crud-form}}