Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion ui/src/app/login/controllers/LoginCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

function LoginCtrl($scope, $state, UserService) {
$scope.user = {};
$scope.inputType = 'password';
$scope.login = function(){
$scope.incorrectCredentials = false;
$scope.unApproved = false;
Expand All @@ -17,7 +18,15 @@
} else if(status.state == 403) {
$scope.incorrectCredentials = true;
}
});
});
};

$scope.hideShowPassword = () => {
if ($scope.inputType === 'password') {
$scope.inputType = 'text';
} else {
$scope.inputType = 'password';
}
};

$scope.signup = function() {
Expand Down
9 changes: 7 additions & 2 deletions ui/src/app/views/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
<img class="logo" ng-src="assets/images/logo.png">
<div layout="column" class="login-content">
<md-input-container class="input-container">
<label>User name</label>
<label>Username</label>
<input type="text" ng-model="user.user_name" />
</md-input-container>
<md-input-container class="input-container">
<label>Password</label>
<input type="password" ng-model="user.password" ng-enter="login()" />
<input type="{{inputType}}" ng-model="user.password" ng-enter="login()" />
</md-input-container>
<label><input type="checkbox" id="checkbox" ng-model="passwordCheckbox" ng-click="hideShowPassword()"/>
<span ng-if="passwordCheckbox">Hide password</span>
<span ng-if="!passwordCheckbox">Show password</span>
</label><br/>
</md-input-container>
<md-button class="md-raised md-primary login-button" ng-click="login()">Login</md-button>
<div layout="row">
Expand Down