<div>
<!-- Alejandro Galue (agalue@opennms.org) -->

<div class="modal-header">
  <h3 class="modal-title">Asset Field</h3>
</div>

<div class="modal-body">
  <form name="assetForm">
    <div class="form-group">
      <div class="form-group">
        <label class="col-form-label" for="name">Name</label>
        <input class="form-control" type="text" id="asset-name" name="name" placeholder="Asset Name (choose one from the list)"
               ng-model="asset.name" typeahead-min-length="0" uib-typeahead="asset for asset in getAvailableAssetFields() | filter:$viewValue" typeahead-editable="false" required
               ng-class="{ 'is-invalid' : assetForm.name.$invalid }">
        <p ng-show="assetForm.name.$invalid" class="invalid-feedback">A valid asset field name is required.</p>
      </div>
      <div class="form-group">
        <label class="col-form-label" for="value">Value</label>
        <input class="form-control" type="text" id="asset-value" name="value" placeholder="Asset Value" ng-model="asset.value" required
               ng-class="{ 'is-invalid' : assetForm.value.$invalid }">
        <p ng-show="assetForm.value.$invalid" class="invalid-feedback">A non empty value is required.</p>
      </div>
    </div>
  </form>
</div>

<div class="modal-footer">
  <button type="button" class="btn btn-primary" id="save-asset" ng-click="save()" ng-disabled="assetForm.$invalid">Save</button>
  <button type="button" class="btn btn-secondary" id="cancel-asset" ng-click="cancel()" >Cancel</button>
</div>

</div>
