diff --git a/application/forms/Authentication/LoginForm.php b/application/forms/Authentication/LoginForm.php index 97ca3ea2c..b9eb2f27d 100644 --- a/application/forms/Authentication/LoginForm.php +++ b/application/forms/Authentication/LoginForm.php @@ -1,32 +1,4 @@ - * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2 - * @author Icinga Development Team - * - */ -// {{{ICINGA_LICENSE_HEADER}}} namespace Icinga\Form\Authentication; @@ -49,32 +21,23 @@ class LoginForm extends Form protected function create() { $this->setName('form_login'); - $this->addElement( - 'text', - 'username', - array( - 'required' => true, - 'placeholder' => t('Username'), - ) - ); + $this->addElement('text', 'username', array( + 'label' => t('Username'), + 'placeholder' => t('Please enter your username...'), + 'required' => true, + )); - $this->addElement( - 'password', - 'password', - array( - 'placeholder' => t('Password'), - 'required' => true - ) - ); - $user = $this->getElement('username'); + $this->addElement('password', 'password', array( + 'label' => t('Password'), + 'placeholder' => t('...and your password'), + 'required' => true + )); // TODO: We need a place to intercept filled forms before rendering if (isset($_POST['username'])) { $this->getElement('password')->setAttrib('class', 'autofocus'); } else { - $user->setAttrib('class', 'autofocus'); + $this->getElement('username')->setAttrib('class', 'autofocus'); } $this->setSubmitLabel('Login'); - } } -// @codeCoverageIgnoreEnd diff --git a/public/css/icinga/forms.less b/public/css/icinga/forms.less index 433b1a346..156cab046 100644 --- a/public/css/icinga/forms.less +++ b/public/css/icinga/forms.less @@ -30,22 +30,16 @@ label { } input, select { + box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; - box-sizing: border-box; - background: #ddd; - color: #333; + border: 1px solid #ddd; padding: 0.2em; - border: 2px solid #ddd; + background: #fff; } -select { - /* https://bugzilla.mozilla.org/show_bug.cgi?id=649849 */ - -moz-appearance: none; - padding-right: 5px; - text-overflow: ''; - -webkit-appearance: none; - cursor: pointer; +input:focus, select:focus { + border-color: #333; } input[type=submit] { diff --git a/public/css/icinga/login.less b/public/css/icinga/login.less index 73a6fdc85..dd25c67e0 100644 --- a/public/css/icinga/login.less +++ b/public/css/icinga/login.less @@ -50,18 +50,43 @@ } .form label { - display: none; + font-weight: normal; + display: inline-block; + line-height: 2.5em; + width: 10em; + margin-right: 1em; + text-align: right; + } form { margin-left: auto; margin-right: auto; - width: 20em; + width: 40em; } form input { - width: 100%; + width: 18em; padding: 0.5em; + background: #ddd; + color: #333; + border: 1px solid #ddd; + } + + form input:focus { + background: white; + } + + input[type=submit] { + color: #eee; + border-color: #777; + background: #777; + margin-left: 11em; + } + + input[type=submit]:hover, a.button:hover, input[type=submit]:focus { + background-color: #333; + border-color: #333; } .footer {