<form name="form">
  <div class="panel panel-default">
    <div class="panel-heading">
      <a href="" ui-sref="^.list" class="btn btn-xs btn-default"><i class="fa fa-arrow-left"></i></a>
      <span ng-show="!ctrl.user.id" translate>Add a new user</span>
      <span ng-show="ctrl.user.id" translate>Edit user</span>
    </div>
    <div class="panel-body">
      <div class="row">
        <div class="col-md-4">
          <div class="alert alert-danger" ng-if="addError" translate>Could not add user!</div>
          <form name="form" ng-submit="ctrl.submit()">
            <fieldset>
              <div class="form-group">
                <label translate>Email</label>
                <input type="text" class="form-control" ng-model="ctrl.user.email" required/>
              </div>

              <div class="form-group">
                <label translate>Username</label>
                <input type="text" class="form-control" ng-model="ctrl.user.username" required/>
              </div>
              <div class="form-group">
                <label translate>First name</label>
                <input type="text" class="form-control" ng-model="ctrl.user.firstName" />
              </div>

              <div class="form-group">
                <label translate>Last name</label>
                <input type="text" class="form-control" ng-model="ctrl.user.lastName" />
              </div>
              <div class="form-group" ng-if="!ctrl.user.id">
                <label>Password</label>
                <input type="password" class="form-control" ng-model="ctrl.user.password" required/>
              </div>
            </fieldset>
          </form>
        </div>
      </div>
    </div>
    <div class="panel-footer">
      <button type="submit" class="btn btn-primary btn-success" ng-click="ctrl.submit()" ng-disabled="form.$invalid">
        Submit
      </button>
      
    </div>
  </div>
</form>
