Left align caption and put [Edit template data] inline

Bug: T339806
Change-Id: I69a46e64810edf458b8a8ee3e043f6dbc287c8aa
This commit is contained in:
Ed Sanders 2023-06-21 17:43:39 +01:00
parent 855156c95f
commit 6107710ef1
3 changed files with 17 additions and 21 deletions

View file

@ -72,16 +72,16 @@ class TemplateDataHtmlFormatter {
. '</header>'
. '<table class="wikitable mw-templatedata-doc-params' . $sorting . '">'
. Html::rawElement( 'caption', [],
Html::rawElement( 'p',
[ 'class' => 'mw-templatedata-caption' ],
$this->localizer->msg( 'templatedata-doc-params' )->escaped() .
// Edit interface is only loaded in the template namespace (see Hooks::onEditPage)
( $showEditLink && $frameTitle->inNamespace( NS_TEMPLATE ) ?
Html::element( 'mw:edittemplatedata', [
'page' => $frameTitle->getPrefixedText()
] ) :
''
) .
Html::element( 'p',
[ 'class' => 'mw-templatedata-caption' ],
$this->localizer->msg( 'templatedata-doc-params' )->text()
)
)
. ( $formatMsg ?
Html::rawElement( 'p', [],

View file

@ -1,16 +1,15 @@
.mw-templatedata-doc-params {
tbody > tr > th {
caption {
text-align: left;
font-weight: normal;
}
.mw-templatedata-caption {
margin: 0.5em 10em;
font-size: 1.2em;
}
.mw-editsection-like {
float: right;
line-height: 2.5em;
tbody > tr > th {
text-align: left;
font-weight: normal;
}
}

View file

@ -1447,8 +1447,7 @@ class TemplateDataBlobTest extends MediaWikiIntegrationTestCase {
<header><p class="mw-templatedata-doc-desc mw-templatedata-doc-muted">(templatedata-doc-desc-empty)</p></header>
<table class="wikitable mw-templatedata-doc-params">
<caption>
<mw:edittemplatedata page="Template:Test/doc"></mw:edittemplatedata>
<p class="mw-templatedata-caption">(templatedata-doc-params)</p>
<p class="mw-templatedata-caption">(templatedata-doc-params)<mw:edittemplatedata page="Template:Test/doc"></mw:edittemplatedata></p>
</caption>
<thead><tr><th colspan="2">(templatedata-doc-param-name)</th><th>(templatedata-doc-param-desc)</th><th>(templatedata-doc-param-type)</th><th>(templatedata-doc-param-status)</th></tr></thead>
<tbody>
@ -1467,8 +1466,7 @@ HTML
<header><p class="mw-templatedata-doc-desc mw-templatedata-doc-muted">(templatedata-doc-desc-empty)</p></header>
<table class="wikitable mw-templatedata-doc-params sortable">
<caption>
<mw:edittemplatedata page="Template:Test/doc"></mw:edittemplatedata>
<p class="mw-templatedata-caption">(templatedata-doc-params)</p>
<p class="mw-templatedata-caption">(templatedata-doc-params)<mw:edittemplatedata page="Template:Test/doc"></mw:edittemplatedata></p>
</caption>
<thead><tr><th colspan="2">(templatedata-doc-param-name)</th><th>(templatedata-doc-param-desc)</th><th>(templatedata-doc-param-type)</th><th>(templatedata-doc-param-status)</th></tr></thead>
<tbody>
@ -1510,8 +1508,7 @@ HTML
<header><p class="mw-templatedata-doc-desc">Template docs</p></header>
<table class="wikitable mw-templatedata-doc-params sortable">
<caption>
<mw:edittemplatedata page="Template:Test/doc"></mw:edittemplatedata>
<p class="mw-templatedata-caption">(templatedata-doc-params)</p>
<p class="mw-templatedata-caption">(templatedata-doc-params)<mw:edittemplatedata page="Template:Test/doc"></mw:edittemplatedata></p>
</caption>
<thead><tr><th colspan="2">(templatedata-doc-param-name)</th><th>(templatedata-doc-param-desc)</th><th>(templatedata-doc-param-type)</th><th>(templatedata-doc-param-status)</th></tr></thead>
<tbody>