@using InventoryTraker.Web.Helpers
@model InventoryTraker.Web.Models.InventoryTypeViewModel
<form novalidate
	  name="vm.form"
	  ng-submit="vm.form.$valid && vm.save()">
	<fieldset ng-disabled="vm.saving">

		<div class="modal-header">
			<h3 class="modal-title"><i class="fa fa-cube"></i> Edit Commodity Type</h3>
		</div>

		<div class="modal-body">

            <div class="alert alert-info" ng-hide="vm.errorMessages.length">
                Edit details for the commodity below.
            </div>
            <div class="alert alert-danger" ng-show="vm.errorMessages.length">
                There were problems saving the commodity.
                <ul>
                    <li ng-repeat="error in vm.errorMessages">{{error}}</li>
                </ul>
            </div>

			@Html.Angular().FormForModel("vm.inventoryType")

		</div>

		<div class="modal-footer">
			<button class="btn btn-success">Save</button>
			<button type="button" class="btn" ng-click="$parent.$dismiss()">Cancel</button>
		</div>

	</fieldset>
</form>