This repository has been archived on 2025-03-30. You can view files and clone it, but cannot push or open issues or pull requests.
hymenobacterdotinfo/app/templates/components/strains/strain-details.hbs
2015-06-03 09:25:26 -08:00

133 lines
3.4 KiB
Handlebars

<div class="span-1">
<fieldset {{bind-attr class=":flakes-information-box isEditing"}}>
<legend>
Strain
{{#if isEditing}}
{{input value=strain.strainName}}
{{else}}
{{strain.strainName}}
{{/if}}
{{display-errors a=strain.errors.strainName}}
</legend>
{{! ROW 1 }}
<div class="grid-4">
<dl class="span-2">
<dt>Species</dt>
<dd>
{{#if isEditing}}
{{
view "select"
content=species
optionValuePath="content.id"
optionLabelPath="content.speciesName"
selection=strain.species
}}
{{else}}
<em>{{strain.species.speciesName}}</em>
{{/if}}
</dd>
</dl>
<dl class="span-2">
<dt>Type Strain?</dt>
<dd>
{{#if isEditing}}
{{input type="checkbox" checked=strain.typeStrain}}
{{/if}}
{{if strain.typeStrain 'Yes' 'No'}}
{{display-errors a=strain.errors.typeStrain}}
</dd>
</dl>
</div>
{{! ROW 2 }}
<div class="grid-4">
<dl class="span-2">
<dt>Accession Numbers</dt>
<dd>
{{#if isEditing}}
{{input value=strain.accessionNumbers}}
{{else}}
{{strain.accessionNumbers}}
{{/if}}
{{display-errors a=strain.errors.accessionNumbers}}
</dd>
</dl>
<dl class="span-2">
<dt>Genbank</dt>
<dd>
{{#if isEditing}}
{{input value=strain.genbank}}
{{else}}
{{strain.genbank}}
{{/if}}
{{display-errors a=strain.errors.genbank}}
</dd>
</dl>
</div>
{{! ROW 3 }}
<div class="grid-4">
<dl class="span-4">
<dt>Isolated From</dt>
<dd>
{{#if isEditing}}
{{textarea value=strain.isolatedFrom cols="70" rows="3"}}
{{else}}
{{strain.isolatedFrom}}
{{/if}}
{{display-errors a=strain.errors.isolatedFrom}}
</dd>
</dl>
</div>
{{! ROW 4 }}
<div class="grid-4">
<dl class="span-4">
<dt>Notes</dt>
<dd>
{{#if isEditing}}
{{textarea value=strain.notes cols="70" rows="3"}}
{{else}}
{{strain.notes}}
{{/if}}
{{display-errors a=strain.errors.notes}}
</dd>
</dl>
</div>
{{! ROW 5 }}
<div class="grid-4">
<dl class="span-1">
<dt>Record Created</dt>
<dd>{{null-time strain.createdAt 'LL'}}</dd>
</dl>
<dl class="span-1">
<dt>Record Updated</dt>
<dd>{{null-time strain.updatedAt 'LL'}}</dd>
</dl>
<dl class="span-1">
<dt>Record Deleted</dt>
<dd>{{null-time strain.deletedAt 'LL'}}</dd>
</dl>
<dl class="span-1"></dl>
</div>
{{! ROW 6 }}
{{#if (can "edit strain" strain)}}
<div class="grid-4">
<div class="span-1">
{{! Does nothing ATM }}
<a {{bind-attr class=":smaller isEditing:button-red:button-gray"}} {{action 'editStrain'}}>
{{#if isEditing}}Cancel{{else}}Edit{{/if}}
</a>
{{#if isEditing}}
<a class="button-green smaller" {{action 'saveStrain'}}>
Save
</a>
{{/if}}
</div>
</div>
{{/if}}
</fieldset>
</div>