Wrap revision info and nav in a div for easy formatting in MobileFrontend
authorBaha <bmansurov@wikimedia.org>
Tue, 2 Aug 2016 18:45:22 +0000 (14:45 -0400)
committerBaha <bmansurov@wikimedia.org>
Wed, 3 Aug 2016 05:03:54 +0000 (01:03 -0400)
Revision info and nav used to be combined with breadcrumbs which made
styling the revision info and nav complicated. The patch wraps these
two divs into an outer div so that MF can style them together easily.

Also make sure rev info and nav appear on different lines as the
`br` tag between them has been removed because of wrapping.

Bug: T139930
Change-Id: Ic7ecf3be7eac6500c20cfc3b3b1fa49d4b4e0d19

includes/page/Article.php
resources/src/mediawiki.legacy/shared.css

index 2a6f88c..6396aaa 100644 (file)
@@ -1438,14 +1438,13 @@ class Article implements Page {
                        : 'revision-info';
 
                $outputPage = $context->getOutput();
-               $outputPage->addSubtitle( "<div id=\"mw-{$infomsg}\">" .
+               $revisionInfo = "<div id=\"mw-{$infomsg}\">" .
                        $context->msg( $infomsg, $td )
                                ->rawParams( $userlinks )
                                ->params( $revision->getId(), $tddate, $tdtime, $revision->getUserText() )
                                ->rawParams( Linker::revComment( $revision, true, true ) )
                                ->parse() .
-                       "</div>"
-               );
+                       "</div>";
 
                $lnk = $current
                        ? $context->msg( 'currentrevisionlink' )->escaped()
@@ -1517,10 +1516,12 @@ class Article implements Page {
                        $cdel .= ' ';
                }
 
-               $outputPage->addSubtitle( "<div id=\"mw-revision-nav\">" . $cdel .
+               // the outer div is need for styling the revision info and nav in MobileFrontend
+               $outputPage->addSubtitle( "<div class=\"mw-revision\">" . $revisionInfo .
+                       "<div id=\"mw-revision-nav\">" . $cdel .
                        $context->msg( 'revision-nav' )->rawParams(
                                $prevdiff, $prevlink, $lnk, $curdiff, $nextlink, $nextdiff
-                       )->escaped() . "</div>" );
+                       )->escaped() . "</div></div>" );
        }
 
        /**
index fc16377..8fcc667 100644 (file)
@@ -704,7 +704,6 @@ ol:lang(or) li {
 #mw-revision-info-current,
 #mw-revision-nav {
        direction: ltr;
-       display: inline;
 }
 
 /* Images */