Improve log entries display in change lists
authorjdlrobson <jdlrobson@gmail.com>
Mon, 5 Aug 2019 19:08:57 +0000 (12:08 -0700)
committerjdlrobson <jdlrobson@gmail.com>
Mon, 5 Aug 2019 19:23:39 +0000 (12:23 -0700)
Log entries are wrapped with parenthesis - not hardcoded into HTML
causing stray brackets in Minerva where this element is floated.
Has no impact on other skins

In addition to this the entire log entry item is wrapped in a new
span mw-changeslist-log-entry to ensure the text is recognised
as a whole entity - on Minerva floats were leading to the action
and the action object being separated (e.g. uploaded and "File:Name
were separated

Bug: T229360
Change-Id: Idae997b15f68bb0dfcaa857f7458ba3497233d41

includes/changes/ChangesList.php

index 31b4443..5ced294 100644 (file)
@@ -451,9 +451,9 @@ class ChangesList extends ContextSource {
        public function insertLog( &$s, $title, $logtype ) {
                $page = new LogPage( $logtype );
                $logname = $page->getName()->setContext( $this->getContext() )->text();
-               $s .= $this->msg( 'parentheses' )->rawParams(
-                       $this->linkRenderer->makeKnownLink( $title, $logname )
-               )->escaped();
+               $s .= Html::rawElement( 'span', [
+                       'class' => 'mw-changeslist-links'
+               ], $this->linkRenderer->makeKnownLink( $title, $logname ) );
        }
 
        /**
@@ -605,7 +605,9 @@ class ChangesList extends ContextSource {
                $formatter->setShowUserToolLinks( true );
                $mark = $this->getLanguage()->getDirMark();
 
-               return $formatter->getActionText() . " $mark" . $formatter->getComment();
+               return Html::openElement( 'span', [ 'class' => 'mw-changeslist-log-entry' ] )
+                       . $formatter->getActionText() . " $mark" . $formatter->getComment()
+                       . Html::closeElement( 'span' );
        }
 
        /**