ChangesList separates content elements from presentation
authorjdlrobson <jdlrobson@gmail.com>
Wed, 21 Nov 2018 22:55:48 +0000 (14:55 -0800)
committerJdlrobson <jrobson@wikimedia.org>
Tue, 18 Dec 2018 19:50:41 +0000 (19:50 +0000)
Special:RecentChanges and Special:Watchlist benefit from this change

Bug: T205581
Change-Id: If46d9ed904fdc6f01decbfde12ade0c47e282171

includes/changes/ChangesList.php
includes/changes/OldChangesList.php

index b1dff14..a39568b 100644 (file)
@@ -454,11 +454,9 @@ class ChangesList extends ContextSource {
                        );
                }
                if ( $rc->mAttribs['rc_type'] == RC_CATEGORIZE ) {
-                       $diffhist = $diffLink . $this->message['pipe-separator'] . $this->message['hist'];
+                       $histLink = $this->message['hist'];
                } else {
-                       $diffhist = $diffLink . $this->message['pipe-separator'];
-                       # History link
-                       $diffhist .= $this->linkRenderer->makeKnownLink(
+                       $histLink = $this->linkRenderer->makeKnownLink(
                                $rc->getTitle(),
                                new HtmlArmor( $this->message['hist'] ),
                                [ 'class' => 'mw-changeslist-history' ],
@@ -469,9 +467,11 @@ class ChangesList extends ContextSource {
                        );
                }
 
-               // @todo FIXME: Hard coded ". .". Is there a message for this? Should there be?
-               $s .= $this->msg( 'parentheses' )->rawParams( $diffhist )->escaped() .
-                       ' <span class="mw-changeslist-separator">. .</span> ';
+               $s .= Html::rawElement( 'div', [ 'class' => 'mw-changeslist-links' ],
+                               Html::rawElement( 'span', [], $diffLink ) .
+                               Html::rawElement( 'span', [], $histLink )
+                       ) .
+                       ' <span class="mw-changeslist-separator"></span> ';
        }
 
        /**
@@ -535,7 +535,7 @@ class ChangesList extends ContextSource {
                        htmlspecialchars( $this->getLanguage()->userTime(
                                $rc->mAttribs['rc_timestamp'],
                                $this->getUser()
-                       ) ) . '</span> <span class="mw-changeslist-separator">. .</span> ';
+                       ) ) . '</span> <span class="mw-changeslist-separator"></span> ';
        }
 
        /**
index a26f5b6..c15701b 100644 (file)
@@ -121,7 +121,7 @@ class OldChangesList extends ChangesList {
                if ( $this->getConfig()->get( 'RCShowChangedSize' ) ) {
                        $cd = $this->formatCharacterDifference( $rc );
                        if ( $cd !== '' ) {
-                               $html .= $cd . '  <span class="mw-changeslist-separator">. .</span> ';
+                               $html .= $cd . '  <span class="mw-changeslist-separator"></span> ';
                        }
                }