Merge branch 'feature/login-page-4942'

This commit is contained in:
Jannis Moßhammer 2013-10-22 14:33:24 +02:00
commit a8cc72b3bd
5 changed files with 123 additions and 16 deletions

View File

@ -59,8 +59,9 @@ class AuthenticationController extends ActionController
public function loginAction() public function loginAction()
{ {
$credentials = new Credential(); $credentials = new Credential();
$this->_helper->layout->setLayout('inline'); $this->_helper->layout->setLayout('login');
$this->view->form = new LoginForm(); $this->view->form = new LoginForm();
$this->view->form->setRequest($this->_request); $this->view->form->setRequest($this->_request);
$this->view->title = "Icinga Web Login"; $this->view->title = "Icinga Web Login";
try { try {

View File

@ -62,13 +62,7 @@ class LoginForm extends Form
) )
); );
$this->addElement( $this->setSubmitLabel('Login');
'submit',
'submit',
array(
'label' => t('Login'),
'class' => 'pull-right'
)
);
} }
} }

View File

@ -0,0 +1,55 @@
<!DOCTYPE html>
<!--[if lt IE 7]>
<html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>
<html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>
<html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title><?= $this->title ? $this->title : 'Icinga Web'; ?></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<!-- Bootstrap and components -->
<link rel="stylesheet" href="<?= $this->baseUrl('static/stylesheet') ?>" media="screen">
<? if (isset($_GET['iframe']) && $_GET['iframe'] === 'true'): ?>
<base target="_parent"/>
<? endif ?>
<script src="<?= $this->baseUrl('js/vendor/modernizr-2.6.2.min.js') ?>"></script>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="<?= $this->baseUrl('js/vendor/html5shiv.js');?>"></script>
<script src="<?= $this->baseUrl('js/vendor/respond.min.js');?>"></script>
<![endif]-->
</head>
<body class="login">
<div class="logo-container">
<div class="image-container">
<div class="hidden-xs">
<img src="<?= $this->baseUrl('img/logo_icinga_big.png') ?>" width="400px">
</div>
<div class="hidden-sm hidden-lg hidden-md">
<img src="<?= $this->baseUrl('img/logo_icinga_big.png') ?>" width="200px">
</div>
</div>
</div>
<div class="form-container">
<?= $this->layout()->content; ?>
<div class="footer">
<br/>
Icinga 2 Web &copy; 2013 Icinga Team
</div>
</div>
</body>
</html>

View File

@ -1,14 +1,21 @@
<div class="well">
<h1>Login</h1>
<?= $this->form->render(); ?>
<?php if (isset($this->errorInfo)): ?> <?php if (isset($this->errorInfo)): ?>
<div class="alert alert-error"> <div class="row">
<br/>
<div class="md-offset-2 col-md-8 col-sm-8 col-sm-offset-2">
<div class="alert alert-danger">
<?= $this->errorInfo ?> <?= $this->errorInfo ?>
</div>
</div> </div>
<?php endif ?> </div>
<?php endif ?>
<div class="row">
<div class="col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3">
<div class="container">
<?= $this->form; ?>
</div>
</div>
</div>
</div>
<script type="text/javascript"> <script type="text/javascript">
/* /*

View File

@ -0,0 +1,50 @@
body.login {
position:absolute;
left:0px;
top:0px;
bottom:0px;
right:0px;
overflow:hidden;
.logo-container {
background-color: #666666;
background-image: linear-gradient(to bottom, #444444, #666666);
-ms-background-image: linear-gradient(to bottom, #444444, #666666);
-webkit-background-image: linear-gradient(to bottom, #444444, #666666);
-moz-background-image: linear-gradient(to bottom, #444444, #666666);
-o-background-image: linear-gradient(to bottom, #444444, #666666);
position:absolute;
top:0px;
bottom:60%;
left:0px;
right:0px;
border-bottom:1px solid black;
.image-container {
position:absolute;
bottom:1em;
left:0px;
right:0px;
text-align:center;
}
}
.form-container {
position:absolute;
top:45%;
left:0px;
bottom:0px;
right:0px;
border-bottom:1px solid black;
overflow:auto;
overflow-x:hidden;
}
.footer {
font-size:0.7em;
text-align:center;
}
}