Add vform format to HTMLForm, use in PasswordReset
authorS Page <spage@wikimedia.org>
Wed, 26 Jun 2013 06:03:17 +0000 (23:03 -0700)
committerMatt Walker <mwalker@wikimedia.org>
Tue, 15 Oct 2013 17:21:00 +0000 (10:21 -0700)
commitd32891d99f185e5cf2b0e25bf947de221d4c3295
tree1ad3bd749d6608faffb420d92b34c411b31aa5a5
parentda081e4857c7f85787dbf318ffbfcb12e214ade2
Add vform format to HTMLForm, use in PasswordReset

This adds a new 'vform' display format to HTMLForm which styles forms
using it in the new compact stacked vertical format:
* Applies class mw-ui-vform to the form.
* Gives Submit button 'mw-ui-{button,big,block,primary}' classes and
  spaced block styling.
* Styles the error class.
* HTMLForm divs are too nested to get styling "for free", so add
  .mw-ui-vform-div selector to Agora CSS and apply this class to form
  divs (maybe not ideal fix).
* HTMLCheckField nests the checkbox inside label.
* Add method to setShowEmptyLabel(); vform format sets this false as it
  doesn't want generated HTML for empty labels adding vertical space.

In FormSpecialPage, don't set the wrapper legend with its old-school
line around the form if in vform style.

Build new mediawiki.ui CSS with the .mw-ui-vform-div styling

Special:PasswordReset requests the new styling with setDisplayFormat( 'vform' )
and turns off the wrapper legend.

(This version of the patch doesn't switch the default format of HTMLForm,
individual forms have to choose it.)

Notes are at
https://www.mediawiki.org/wiki/Agora/Engineering#HTMLForm_Issues

Change-Id: Id03d185bbee990595bfc469a61163cc598fc3441
includes/HTMLForm.php
includes/SpecialPage.php
includes/specials/SpecialPasswordReset.php
resources/mediawiki.ui/mediawiki.ui.default.css
resources/mediawiki.ui/mediawiki.ui.vector.css
resources/mediawiki.ui/sourcefiles/scss/components/default/_forms.scss