<div class="card">
    <div class="card-header">
        <h2 class="card-title ng-binding ng-scope" ng-if="!vm.isEditMode">{{::vm.translate.get('Create Product')}}</h2>
        <h2 class="card-title ng-binding ng-scope" ng-if="vm.isEditMode">{{::vm.translate.get('Edit Product')}}</h2>
    </div>
    <div class="card-body">
        <form name="vendorForm" class="form-horizontal">
            <div class="col-sm-offset-2 bg-danger" ng-show="vm.validationErrors">
                <ul>
                    <li ng-repeat="error in vm.validationErrors track by $index">{{error}}</li>
                </ul>
            </div>
            <div class="form-group">
                <label class="control-label">{{::vm.translate.get('Name')}}</label>
                <div>
                    <input name="name" ng-model="vm.vendor.name" ng-change="vm.updateSlug()" class="form-control" />
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">{{::vm.translate.get('Slug')}}</label>
                <div>
                    <input name="slug" ng-model="vm.vendor.slug" class="form-control" />
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">{{::vm.translate.get('Email')}}</label>
                <div>
                    <input name="email" ng-model="vm.vendor.email" class="form-control" />
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">{{::vm.translate.get('Managers')}}</label>
                <div>
                    <p class="form-control-static">
                        <a ui-sref="user-edit({id: user.userId})" ng-repeat="user in vm.vendor.managers">{{user.email}} </a>
                        <a ui-sref="users" ng-if="vm.vendor.managers.length === 0 && vm.isEditMode">Add users as manager</a>
                        <span ng-if="!vm.isEditMode">After vendor is created. Go to user list and create or set users as managers</span>
                    </p>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">{{::vm.translate.get('Description')}}</label>
                <div>
                    <input name="description" ng-model="vm.vendor.description" class="form-control" />
                </div>
            </div>
            <div class="form-group">
                <div>
                    <div class="checkbox">
                        <label>
                            <input type="checkbox" ng-model="vm.vendor.isActive"> {{::vm.translate.get('Is Active')}}
                        </label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <div>
                    <button class="btn btn-success float-right" ng-click="vm.save()"><span class="fa fa-save"></span> {{::vm.translate.get('Save')}}</button>
                    <button ui-sref="vendors" class="btn btn-default">{{::vm.translate.get('Cancel')}}</button>
                </div>
            </div>
        </form>
    </div>
</div>