Cleanup: Template variables

- Remove unused html-prebodyhtml template variable
- Don't use html- prefixed variables as if statements - this is
not supported by Mustache. (set to '' to confirm)

Change-Id: I0c860b4b2277e1796afa3e482cf61e95ef4fb342
This commit is contained in:
jdlrobson 2020-07-10 14:31:09 -07:00
parent c4cc51d744
commit c405ffb155
3 changed files with 11 additions and 21 deletions

View File

@ -133,6 +133,9 @@ class VectorTemplate extends BaseTemplate {
//
// Conditionally used values must use null to indicate absence (not false or '').
$mainPageHref = Skin::makeMainPageUrl();
// From Skin::getNewtalks(). Always returns string, cast to null if empty.
$newTalksHtml = $skin->getNewtalks() ?: null;
// @phan-suppress-next-line PhanUndeclaredMethod
$commonSkinData = $skin->getTemplateData() + [
'html-headelement' => $out->headElement( $skin ),
@ -144,8 +147,7 @@ class VectorTemplate extends BaseTemplate {
'html-title' => $out->getPageTitle(),
'msg-tagline' => $skin->msg( 'tagline' )->text(),
// From Skin::getNewtalks(). Always returns string, cast to null if empty.
'html-newtalk' => $skin->getNewtalks() ?: null,
'html-newtalk' => $newTalksHtml ? '<div class="usermessage">' . $newTalksHtml . '</div>' : '',
'msg-vector-jumptonavigation' => $skin->msg( 'vector-jumptonavigation' )->text(),
'msg-vector-jumptosearch' => $skin->msg( 'vector-jumptosearch' )->text(),

View File

@ -7,7 +7,6 @@
"featured article". An empty array if none are defined.
string page-langcode the content language of the article. Assumed to be escaped HTML.
string html-title
string html-prebodyhtml
bool page-isarticle
string msg-tagline
string html-subtitle
@ -39,17 +38,14 @@
<div id="mw-head-base" class="noprint"></div>
<div id="content" class="mw-body" role="main">
<a id="top"></a>
{{#html-sitenotice}}
<div id="siteNotice" class="mw-body-content">{{{html-sitenotice}}}</div>
{{/html-sitenotice}}
<div id="siteNotice" class="mw-body-content">{{{html-sitenotice}}}</div>
{{>Indicators}}
<h1 id="firstHeading" class="firstHeading" lang="{{page-langcode}}">{{{html-title}}}</h1>
{{{html-prebodyhtml}}}
<div id="bodyContent" class="mw-body-content">
{{#page-isarticle}}<div id="siteSub" class="noprint">{{msg-tagline}}</div>{{/page-isarticle}}
<div id="contentSub"{{{html-userlangattributes}}}>{{{html-subtitle}}}</div>
{{#html-undelete}}<div id="contentSub2">{{{html-undelete}}}</div>{{/html-undelete}}
{{#html-newtalk}}<div class="usermessage">{{{html-newtalk}}}</div>{{/html-newtalk}}
<div id="contentSub2">{{{html-undelete}}}</div>
{{{html-newtalk}}}
{{!
Keep this empty `div` for compatibility with gadgets and user scripts
using this place to insert extra elements before.
@ -58,9 +54,7 @@
<a class="mw-jump-link" href="#mw-head">{{msg-vector-jumptonavigation}}</a>
<a class="mw-jump-link" href="#searchInput">{{msg-vector-jumptosearch}}</a>
{{{html-bodycontent}}}
{{#html-printfooter}}
<div class="printfooter">{{{html-printfooter}}}</div>
{{/html-printfooter}}
{{{html-catlinks}}}
{{{html-debuglog}}}
</div>

View File

@ -7,7 +7,6 @@
"featured article". An empty array if none are defined.
string page-langcode the content language of the article. Assumed to be escaped HTML.
string html-title
string html-prebodyhtml
bool page-isarticle
string msg-tagline
string html-subtitle
@ -57,17 +56,14 @@
<!-- Please do not use role attribute as CSS selector, it is deprecated. -->
<main id="content" class="mw-body" role="main">
<a id="top"></a>
{{#html-sitenotice}}
<div id="siteNotice" class="mw-body-content">{{{html-sitenotice}}}</div>
{{/html-sitenotice}}
<div id="siteNotice" class="mw-body-content">{{{html-sitenotice}}}</div>
{{>Indicators}}
<h1 id="firstHeading" class="firstHeading" lang="{{page-langcode}}">{{{html-title}}}</h1>
{{{html-prebodyhtml}}}
<div id="bodyContent" class="mw-body-content">
{{#page-isarticle}}<div id="siteSub" class="noprint">{{msg-tagline}}</div>{{/page-isarticle}}
<div id="contentSub"{{{html-userlangattributes}}}>{{{html-subtitle}}}</div>
{{#html-undelete}}<div id="contentSub2">{{{html-undelete}}}</div>{{/html-undelete}}
{{#html-newtalk}}<div class="usermessage">{{{html-newtalk}}}</div>{{/html-newtalk}}
<div id="contentSub2">{{{html-undelete}}}</div>
{{{html-newtalk}}}
{{!
Keep this empty `div` for compatibility with gadgets and user scripts
using this place to insert extra elements before.
@ -76,9 +72,7 @@
<a class="mw-jump-link" href="#mw-sidebar-button">{{msg-vector-jumptonavigation}}</a>
<a class="mw-jump-link" href="#searchInput">{{msg-vector-jumptosearch}}</a>
{{{html-bodycontent}}}
{{#html-printfooter}}
<div class="printfooter">{{{html-printfooter}}}</div>
{{/html-printfooter}}
<div class="printfooter">{{{html-printfooter}}}</div>
{{{html-catlinks}}}
{{{html-debuglog}}}
</div>