WiP - some improvements to the login form

pull/91/head
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"/>
<md-content md-scroll-y="true">
<div>
<div id="aboutBox" style="display:none;">
<div data-ng-controller="loginController">
<!-- <div id="aboutBox" style="display:none;">
<div>
<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>
@ -24,14 +24,14 @@
<p><a id="aboutClose" href="#" class="button">
<span><var:string label:value="OK" /></span></a></p>
</div>
</div>
<nav class="top-bar">
</div> -->
<!-- <nav class="top-bar">
<section class="top-bar-section">
<ul class="right">
<li><a href="#"><var:string label:value="About" /></a></li>
</ul>
</section>
</nav>
</nav> -->
<div id="login">
<div id="logo">
<img const:alt="*" id="splash" rsrc:src="img/sogo-logo.png"/>
@ -42,7 +42,7 @@
<md-input-container>
<label><var:string label:value="Username:"/>
</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>
<label><var:string label:value="Password:"/>
@ -72,15 +72,24 @@
/>
</label>
</var:if>
<!--
<md-checkbox data-ng-model="creds.rememberLogin">
<label><var:string label:value="Remember username"/></label>
</md-checkbox>
<label>
<md-button type="submit" class="small" data-ng-disabled='!loginForm.$valid'>
</md-checkbox> -->
<!-- <label> -->
<md-button type="submit" class="md-raised md-primary" data-ng-disabled='!loginForm.$valid'>
<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>
</form>
<md-toolbar>
<md-button ng-click="showAbout()">
About
</md-button>
</md-toolbar>
</div>
</div>
</md-content>

View File

@ -6,7 +6,7 @@
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.creds = { username: null, password: null };
$scope.login = function(creds) {
@ -19,5 +19,18 @@
});
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;
});
};
}]);
})();