salix/modules/item/front/botanical/index.html

54 lines
1.8 KiB
HTML

<mg-ajax
path="ItemBotanicals"
options="vnPatch">
</mg-ajax>
<vn-watcher
vn-id="watcher"
data="$ctrl.botanical"
id-field="itemFk"
form="form"
save="patch">
</vn-watcher>
<form name="form" ng-submit="watcher.submit()" ng-cloak class="vn-w-md">
<vn-card class="vn-pa-lg">
<vn-horizontal>
<vn-textfield
vn-one
label="Botanical"
ng-model="$ctrl.botanical.botanical"
vn-focus>
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete
vn-one
initial-data="$ctrl.botanical.genus"
ng-model="$ctrl.botanical.genusFk"
url="genera"
show-field="latin_genus_name"
value-field="genus_id"
label="Genus">
</vn-autocomplete>
<vn-autocomplete vn-one
label="Species"
initial-data="$ctrl.botanical.specie"
ng-model="$ctrl.botanical.specieFk"
url="species"
show-field="latin_species_name"
value-field="specie_id"
fields="['genus_id']"
include="'genus'">
<tpl-item>
<div>{{latin_species_name}}</div>
<div class="text-caption text-secondary">
{{genus.latin_genus_name}}
</div>
</tpl-item>
</vn-autocomplete>
</vn-horizontal>
</vn-card>
<vn-button-bar>
<vn-submit label="Save"></vn-submit>
<vn-button label="Undo changes" ng-if="watcher.dataChanged()" ng-click="watcher.loadOriginalData()"></vn-button>
</vn-button-bar>
</form>