WiP - some improvements to the login form

This commit is contained in:
Ludovic Marcotte 2015-02-13 09:14:10 -05:00 committed by Francis Lachapelle
parent fcd5abfafc
commit e5726d2840
2 changed files with 33 additions and 11 deletions

View file

@ -12,8 +12,8 @@
><var:string var:value="doctype" const:escapeHTML="NO"/> ><var:string var:value="doctype" const:escapeHTML="NO"/>
<md-content md-scroll-y="true"> <md-content md-scroll-y="true">
<div> <div data-ng-controller="loginController">
<div id="aboutBox" style="display:none;"> <!-- <div id="aboutBox" style="display:none;">
<div> <div>
<p class="logo"><img const:alt="SOGo" rsrc:src="img/sogo-logo.png"/></p> <p class="logo"><img const:alt="SOGo" rsrc:src="img/sogo-logo.png"/></p>
<p>Version <var:string value="version"/> <span class="buildDate">(<var:string value="buildDate" />)</span></p> <p>Version <var:string value="version"/> <span class="buildDate">(<var:string value="buildDate" />)</span></p>
@ -24,14 +24,14 @@
<p><a id="aboutClose" href="#" class="button"> <p><a id="aboutClose" href="#" class="button">
<span><var:string label:value="OK" /></span></a></p> <span><var:string label:value="OK" /></span></a></p>
</div> </div>
</div> </div> -->
<nav class="top-bar"> <!-- <nav class="top-bar">
<section class="top-bar-section"> <section class="top-bar-section">
<ul class="right"> <ul class="right">
<li><a href="#"><var:string label:value="About" /></a></li> <li><a href="#"><var:string label:value="About" /></a></li>
</ul> </ul>
</section> </section>
</nav> </nav> -->
<div id="login"> <div id="login">
<div id="logo"> <div id="logo">
<img const:alt="*" id="splash" rsrc:src="img/sogo-logo.png"/> <img const:alt="*" id="splash" rsrc:src="img/sogo-logo.png"/>
@ -42,7 +42,7 @@
<md-input-container> <md-input-container>
<label><var:string label:value="Username:"/> <label><var:string label:value="Username:"/>
</label> </label>
<input type="text" data-ng-model="creds.username" var:data-ng-init="cookieUsername" required="required" /> <input type="text" data-ng-model="creds.username" var:data-ng-init='cookieUsername' required="required" />
</md-input-container> </md-input-container>
<md-input-container> <md-input-container>
<label><var:string label:value="Password:"/> <label><var:string label:value="Password:"/>
@ -72,15 +72,24 @@
/> />
</label> </label>
</var:if> </var:if>
<!--
<md-checkbox data-ng-model="creds.rememberLogin"> <md-checkbox data-ng-model="creds.rememberLogin">
<label><var:string label:value="Remember username"/></label> <label><var:string label:value="Remember username"/></label>
</md-checkbox> </md-checkbox> -->
<label> <!-- <label> -->
<md-button type="submit" class="small" data-ng-disabled='!loginForm.$valid'> <md-button type="submit" class="md-raised md-primary" data-ng-disabled='!loginForm.$valid'>
<var:string label:value="Connect" /></md-button> <var:string label:value="Connect" /></md-button>
</label> <!-- </label> -->
<md-switch data-ng-model="creds.rememberLogin">
<var:string label:value="Remember username"/>
</md-switch>
<label id="animation"><!-- busy.gif! --></label> <label id="animation"><!-- busy.gif! --></label>
</form> </form>
<md-toolbar>
<md-button ng-click="showAbout()">
About
</md-button>
</md-toolbar>
</div> </div>
</div> </div>
</md-content> </md-content>

View file

@ -6,7 +6,7 @@
angular.module('SOGo.MainUI', ['SOGo.Authentication', 'SOGo.UI']) angular.module('SOGo.MainUI', ['SOGo.Authentication', 'SOGo.UI'])
.controller('loginController', ['$scope', 'Authentication', function($scope, Authentication) { .controller('loginController', ['$scope', '$mdDialog', 'Authentication', function($scope, $mdDialog, Authentication) {
$scope.warning = false; $scope.warning = false;
$scope.creds = { username: null, password: null }; $scope.creds = { username: null, password: null };
$scope.login = function(creds) { $scope.login = function(creds) {
@ -19,5 +19,18 @@
}); });
return false; return false;
}; };
$scope.showAbout = function() {
var alert;
alert = $mdDialog.alert({
title: 'About SOGo',
content: 'This is SOGo v3!',
ok: 'OK'
});
$mdDialog
.show( alert )
.finally(function() {
alert = undefined;
});
};
}]); }]);
})(); })();