<div class="editor-container">
  <h4 class="bg-primary">User Account Login</h4>

  <form name="loginForm" ng-submit="loginForm.$valid && login()" enter-press="loginForm.$valid && login()" novalidate>

    <div class="form-group">
      <input class="form-control" type="text" name="username" placeholder="Username" ng-model="credentials.username" ng-pattern="/^[a-z0-9](_(?!(\.|_))|\.(?!(_|\.))|[a-z0-9]){4,18}[a-z0-9]$/i" required>
      <p class="help-block" ng-show="loginForm.username.$error.required && loginForm.username.$dirty">Please enter a username.</p>
      <p class="help-block" ng-show="loginForm.username.$error.pattern && loginForm.username.$dirty">Username must be 4 to 18 characters, containing only alphanumeric characters, periods, and underscores.</p>
    </div>


    <div class="form-group">
      <input class="form-control" type="password" name="password" placeholder="Password" ng-minlength="8" ng-model="credentials.password" ng-pattern="/^(?:[0-9]+[a-z]|[a-z]+[0-9])[a-z0-9`\-=\\\[\];',\./~!@#\$%\^&\*\(\)_\+|\{\}:<>\?]*$/i" required>
      <p class="help-block" ng-show="loginForm.password.$error.required && loginForm.password.$dirty" >Please enter a password.</p>
      <p class="help-block" ng-show="loginForm.password.$error.pattern && loginForm.password.$dirty">Your password must be 8 characters long and include 1 letter and number.</p>
    </div>

  
    <div ng-if="error" ng-bind-html="error"></div>

    <button class="btn btn-primary pull-right" type="submit" ng-disabled="loginForm.$invalid"><i class="fa fa-sign-in"></i> Sign In</button>
  </form>
  <a ui-sref="forgot">Forgot your password?</a>
  
</div>