Commit e40b4620 by Torkel Ödegaard

began work on reset password view, and angular controller

parent 89418a15
...@@ -6,6 +6,7 @@ define([ ...@@ -6,6 +6,7 @@ define([
'./inspectCtrl', './inspectCtrl',
'./jsonEditorCtrl', './jsonEditorCtrl',
'./loginCtrl', './loginCtrl',
'./resetPasswordCtrl',
'./sidemenuCtrl', './sidemenuCtrl',
'./errorCtrl', './errorCtrl',
], function () {}); ], function () {});
define([
'angular',
'app',
'lodash'
],
function (angular, app, _) {
'use strict';
var module = angular.module('grafana.controllers');
module.controller('ResetPasswordCtrl', function($scope, contextSrv, backendSrv) {
contextSrv.sidemenu = false;
$scope.sendMode = true;
$scope.formModel = {};
$scope.sendResetEmail = function() {
if (!$scope.loginForm.$valid) {
return;
}
backendSrv.post('/api/user/password/send-reset-email', $scope.formModel).then(function() {
});
};
});
});
...@@ -91,7 +91,15 @@ ...@@ -91,7 +91,15 @@
</div> </div>
</div> </div>
<div class="row" style="margin-top: 100px"> <div class="row" style="margin-top: 40px">
<div class="text-center">
<a href="reset-password/send">
Forgot your password?
</a>
</div>
</div>
<div class="row" style="margin-top: 50px">
<div class="version-footer text-center small"> <div class="version-footer text-center small">
Grafana version: {{buildInfo.version}}, commit: {{buildInfo.commit}}, Grafana version: {{buildInfo.version}}, commit: {{buildInfo.commit}},
build date: {{buildInfo.buildstamp | date: 'yyyy-MM-dd HH:mm:ss' }} build date: {{buildInfo.buildstamp | date: 'yyyy-MM-dd HH:mm:ss' }}
......
<div class="container">
<div class="login-box">
<div class="login-box-logo">
<img src="img/logo_transparent_200x75.png">
</div>
<div class="login-inner-box">
<div class="login-tab-header">
<button class="btn-login-tab" class="active">
Reset password
</button>
</div>
<form name="sendResetForm" class="login-form">
<div class="tight-form" ng-if="sendMode">
<ul class="tight-form-list">
<li class="tight-form-item" style="width: 78px">
<strong>User</strong>
</li>
<li>
<input type="text" name="username" class="tight-form-input last" required ng-model='formModel.userOrEmail' placeholder="email or username" style="width: 253px">
</li>
</ul>
<div class="clearfix"></div>
</div>
<div class="login-submit-button-row">
<button type="submit" class="btn" ng-click="sendResetEmail();" ng-class="{'btn-inverse': !sendResetForm.$valid, 'btn-primary': sendResetForm.$valid}">
Send reset instructions
</button>
</div>
</form>
<div class="clearfix"></div>
</div>
</div>
</div>
...@@ -97,6 +97,10 @@ define([ ...@@ -97,6 +97,10 @@ define([
templateUrl: 'app/partials/login.html', templateUrl: 'app/partials/login.html',
controller : 'LoginCtrl', controller : 'LoginCtrl',
}) })
.when('/reset-password/send', {
templateUrl: 'app/partials/reset_password.html',
controller : 'ResetPasswordCtrl',
})
.otherwise({ .otherwise({
templateUrl: 'app/partials/error.html', templateUrl: 'app/partials/error.html',
controller: 'ErrorCtrl' controller: 'ErrorCtrl'
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
padding: 9px 7px; padding: 9px 7px;
font-size: 14px; font-size: 14px;
font-weight: bold; font-weight: bold;
width: 150px; min-width: 150px;
display: inline-block; display: inline-block;
border: 1px solid lighten(@btnInverseBackground, 10%); border: 1px solid lighten(@btnInverseBackground, 10%);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment