Display format icon and message inside parameters table caption

Change-Id: Id9d6620ed766645384d31c63aacd7c8167c1ce19
This commit is contained in:
Ed Sanders 2015-11-13 12:35:07 -08:00
parent dbf9a85aa8
commit c069153411
4 changed files with 37 additions and 18 deletions

View file

@ -136,6 +136,7 @@ class TemplateDataHooks {
* @return string: HTML to insert in the page.
*/
public static function render( $input, $args, $parser, $frame ) {
$parser->enableOOUI();
$ti = TemplateDataBlob::newFromJSON( $input );
$status = $ti->getStatus();

View file

@ -693,17 +693,26 @@ class TemplateDataBlob {
$data->description :
wfMessage( 'templatedata-doc-desc-empty' )->inLanguage( $lang )->text()
)
. Html::element(
'p',
array(),
// Messages: templatedata-modal-format-inline, templatedata-modal-format-block
wfMessage( 'templatedata-doc-format-' . $data->format )->inLanguage( $lang )->text()
)
. '<table class="wikitable mw-templatedata-doc-params sortable">'
. Html::element(
. Html::rawElement(
'caption',
array(),
wfMessage( 'templatedata-doc-params' )->inLanguage( $lang )->text()
Html::element(
'p',
array(),
wfMessage( 'templatedata-doc-params' )->inLanguage( $lang )->text()
)
. Html::rawElement(
'p',
array(),
new OOUI\IconWidget( array( 'icon' => 'template-format-' . $data->format ) )
. Html::element(
'span',
array( 'class' => 'mw-templatedata-format' ),
// Messages: templatedata-modal-format-inline, templatedata-modal-format-block
wfMessage( 'templatedata-doc-format-' . $data->format )->inLanguage( $lang )->text()
)
)
)
. '<thead><tr>'
. Html::element(

View file

@ -79,13 +79,3 @@
/* @embed */
background-image: url(images/parameter-set-ltr.svg);
}
.oo-ui-icon-template-format-block {
/* @embed */
background-image: url(images/block-ltr.svg);
}
.oo-ui-icon-template-format-inline {
/* @embed */
background-image: url(images/inline.svg);
}

View file

@ -14,7 +14,26 @@
color: #777;
}
.mw-templatedata-doc-params .oo-ui-widget {
font-size: 0.9143em;
}
.mw-templatedata-format {
font-weight: normal;
font-size: 0.85em;
}
.mw-templatedata-doc-param-name,
.mw-templatedata-doc-param-type {
white-space: nowrap;
}
.oo-ui-icon-template-format-block {
/* @embed */
background-image: url(../modules/images/block-ltr.svg);
}
.oo-ui-icon-template-format-inline {
/* @embed */
background-image: url(../modules/images/inline.svg);
}