Stop using mw-ui-big on login form buttons
[lhc/web/wiklou.git] / includes / templates / Userlogin.php
index 8bba426..345bb71 100644 (file)
@@ -70,12 +70,10 @@ class UserloginTemplate extends BaseTemplate {
                                        ?>
                                </label>
                                <?php
-                               $extraAttrs = array();
                                echo Html::input( 'wpName', $this->data['name'], 'text', array(
                                        'class' => 'loginText mw-ui-input',
                                        'id' => 'wpName1',
                                        'tabindex' => '1',
-                                       'size' => '20',
                                        // 'required' is blacklisted for now in Html.php due to browser issues.
                                        // Keeping here in case that changes.
                                        'required' => true,
@@ -90,14 +88,6 @@ class UserloginTemplate extends BaseTemplate {
                                <label for='wpPassword1'>
                                        <?php
                                        $this->msg( 'userlogin-yourpassword' );
-
-                                       if ( $this->data['useemail'] && $this->data['canreset'] && $this->data['resetlink'] === true ) {
-                                               echo ' ' . Linker::link(
-                                                       SpecialPage::getTitleFor( 'PasswordReset' ),
-                                                       $this->getMsg( 'userlogin-resetpassword-link' )->parse(),
-                                                       array( 'class' => 'mw-ui-flush-right' )
-                                               );
-                                       }
                                        ?>
                                </label>
                                <?php
@@ -105,7 +95,6 @@ class UserloginTemplate extends BaseTemplate {
                                        'class' => 'loginPassword mw-ui-input',
                                        'id' => 'wpPassword1',
                                        'tabindex' => '2',
-                                       'size' => '20',
                                        // Set focus to this field if username is filled in.
                                        'autofocus' => (bool)$this->data['name'],
                                        'placeholder' => $this->getMsg( 'userlogin-yourpassword-ph' )->text()
@@ -148,15 +137,19 @@ class UserloginTemplate extends BaseTemplate {
 
                        <div class="mw-ui-vform-field">
                                <?php
-                               echo Html::input( 'wpLoginAttempt', $this->getMsg( 'pt-login-button' )->text(), 'submit', array(
+                               $attrs = array(
                                        'id' => 'wpLoginAttempt',
+                                       'name' => 'wpLoginAttempt',
                                        'tabindex' => '6',
-                                       'class' => 'mw-ui-button mw-ui-big mw-ui-block mw-ui-constructive'
-                               ) );
+                               );
+                               $modifiers = array(
+                                       'mw-ui-constructive',
+                               );
+                               echo Html::submitButton( $this->getMsg( 'pt-login-button' )->text(), $attrs, $modifiers );
                                ?>
                        </div>
 
-                       <div class="mw-ui-vform-field" id="mw-userlogin-help">
+                       <div class="mw-ui-vform-field mw-form-related-link-container" id="mw-userlogin-help">
                                <?php
                                echo Html::element(
                                        'a',
@@ -169,21 +162,51 @@ class UserloginTemplate extends BaseTemplate {
                                );
                                ?>
                        </div>
+                       <?php
 
-                       <?php if ( $this->haveData( 'createOrLoginHref' ) ) { ?>
-                               <?php if ( $this->data['loggedin'] ) { ?>
-                                       <div id="mw-createaccount-another">
-                                               <a href="<?php $this->text( 'createOrLoginHref' ); ?>" id="mw-createaccount-join" tabindex="7"  class="mw-ui-button"><?php $this->msg( 'userlogin-createanother' ); ?></a>
+                       if ( $this->data['useemail'] && $this->data['canreset'] && $this->data['resetlink'] === true ) {
+                               echo Html::rawElement(
+                                       'div',
+                                       array(
+                                               'class' => 'mw-ui-vform-field mw-form-related-link-container',
+                                       ),
+                                       Linker::link(
+                                               SpecialPage::getTitleFor( 'PasswordReset' ),
+                                               $this->getMsg( 'userlogin-resetpassword-link' )->escaped()
+                                       )
+                               );
+                       }
+
+                       if ( $this->haveData( 'createOrLoginHref' ) ) {
+                               if ( $this->data['loggedin'] ) { ?>
+                                       <div class="mw-form-related-link-container mw-ui-vform-field">
+                                               <a href="<?php $this->text( 'createOrLoginHref' ); ?>" id="mw-createaccount-join" tabindex="7"><?php $this->msg( 'userlogin-createanother' ); ?></a>
                                        </div>
                                <?php } else { ?>
-                                       <div id="mw-createaccount-cta">
-                                               <?php $this->msg( 'userlogin-noaccount' ); ?><a href="<?php $this->text( 'createOrLoginHref' ); ?>" id="mw-createaccount-join" tabindex="7"  class="mw-ui-button mw-ui-progressive"><?php $this->msg( 'userlogin-joinproject' ); ?></a>
+                                       <div id="mw-createaccount-cta" class="mw-form-related-link-container mw-ui-vform-field">
+                                               <?php $this->msg( 'userlogin-noaccount' ); ?><a href="<?php $this->text( 'createOrLoginHref' ); ?>" id="mw-createaccount-join" tabindex="7" class="mw-ui-button mw-ui-progressive"><?php $this->msg( 'userlogin-joinproject' ); ?></a>
                                        </div>
-                               <?php } ?>
-                       <?php } ?>
-                       <?php if ( $this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?>
-                       <?php if ( $this->haveData( 'token' ) ) { ?><input type="hidden" name="wpLoginToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?>
-                       <?php if ( $this->data['cansecurelogin'] ) {?><input type="hidden" name="wpForceHttps" value="<?php $this->text( 'stickhttps' ); ?>" /><?php } ?>
+                               <?php
+                               }
+                       }
+
+                       // Hidden fields
+                       $fields = '';
+                       if ( $this->haveData( 'uselang' ) ) {
+                               $fields .= Html::hidden( 'uselang', $this->data['uselang'] );
+                       }
+                       if ( $this->haveData( 'token' ) ) {
+                               $fields .= Html::hidden( 'wpLoginToken', $this->data['token'] );
+                       }
+                       if ( $this->data['cansecurelogin'] ) {
+                               $fields .= Html::hidden( 'wpForceHttps', $this->data['stickhttps'] );
+                       }
+                       if ( $this->data['cansecurelogin'] && $this->haveData( 'fromhttp' ) ) {
+                               $fields .= Html::hidden( 'wpFromhttp', $this->data['fromhttp'] );
+                       }
+                       echo $fields;
+
+                       ?>
                </form>
        </div>
 </div>