Merge "Display format icon and message inside parameters table caption"

This commit is contained in:
jenkins-bot 2015-11-13 22:06:30 +00:00 committed by Gerrit Code Review
commit f9390b1a97
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. * @return string: HTML to insert in the page.
*/ */
public static function render( $input, $args, $parser, $frame ) { public static function render( $input, $args, $parser, $frame ) {
$parser->enableOOUI();
$ti = TemplateDataBlob::newFromJSON( $input ); $ti = TemplateDataBlob::newFromJSON( $input );
$status = $ti->getStatus(); $status = $ti->getStatus();

View file

@ -693,17 +693,26 @@ class TemplateDataBlob {
$data->description : $data->description :
wfMessage( 'templatedata-doc-desc-empty' )->inLanguage( $lang )->text() 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">' . '<table class="wikitable mw-templatedata-doc-params sortable">'
. Html::element( . Html::rawElement(
'caption', 'caption',
array(), 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>' . '<thead><tr>'
. Html::element( . Html::element(

View file

@ -79,13 +79,3 @@
/* @embed */ /* @embed */
background-image: url(images/parameter-set-ltr.svg); 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; 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-name,
.mw-templatedata-doc-param-type { .mw-templatedata-doc-param-type {
white-space: nowrap; 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);
}