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

60 lines
1.9 KiB
HTML

<vn-watcher
vn-id="watcher"
url="ItemBotanicals"
data="$ctrl.botanical"
id-field="itemFk"
id-value="$ctrl.$params.id"
include="[{relation: 'genus'}, {relation: 'specie'}]"
auto-fill="true"
form="form">
</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
label="Botanical"
ng-model="$ctrl.botanical.botanical"
vn-focus>
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete
label="Genus"
ng-model="$ctrl.botanical.genusFk"
initial-data="$ctrl.botanical.genus"
url="Genera"
show-field="latin_genus_name"
value-field="genus_id">
</vn-autocomplete>
<vn-autocomplete
label="Species"
ng-model="$ctrl.botanical.specieFk"
initial-data="$ctrl.botanical.specie"
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
disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<!-- # #2680 Undo changes button bugs -->
<!-- <vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button> -->
</vn-button-bar>
</form>