<div class="container login-container" ng-controller="LoginController">
    <div class="row">
        <div class="col-md-4 col-md-offset-4">
            <div ng-show="error_message" class="alert alert-danger" role="alert">
                {{error_message}}
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">System Login</h3>
                </div>
                <div class="panel-body">
                    <form accept-charset="UTF-8" name="loginForm" novalidate>
                        <fieldset>
                            <div class="form-group"
                                 ng-class="{'has-error': loginForm.username.$invalid && !loginForm.username.$pristine}">
                                <input type="email" class="form-control" name="username"
                                       ng-model="user.username" placeholder="Email" required>
                                <p ng-show="loginForm.username.$invalid && !loginForm.username.$pristine"
                                   class="help-block">
                                    Please enter a valid username.
                                </p>
                            </div>
                            <div class="form-group"
                                 ng-class="{'has-error': loginForm.password.$invalid && !loginForm.password.$pristine}">
                                <input type="password" class="form-control" name="password"
                                       ng-model="user.password" placeholder="Password" required>
                                <p ng-show="loginForm.password.$invalid && !loginForm.password.$pristine"
                                   class="help-block">
                                    Please enter a valid password.
                                </p>
                            </div>
                            <button ng-click="login(user)" class="btn btn-primary"
                                    ng-disabled="loginForm.$invalid">Login
                            </button>
                        </fieldset>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>