Victorbarbu has uploaded a new change for review. https://gerrit.wikimedia.org/r/258897
Change subject: Displaying contributions in table ...................................................................... Displaying contributions in table The Special:Contributions page is now displayed using a table instead the old li tags. This design makes it easier to read and makes it more organized. Change-Id: If8ba59d9f23d5e6e9f4bb461a31953ab1d8efd70 Todo: https://doc.wikimedia.org/mediawiki-core/master/php/todo.html#_todo000143 --- M includes/specials/SpecialContributions.php 1 file changed, 21 insertions(+), 14 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/97/258897/1 diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index b1908c2..dafefbf 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -938,14 +938,15 @@ * @return string */ function getStartBody() { - return "<ul class=\"mw-contributions-list\">\n"; + return "<table class=\"mw-contributions-list wikitable\">\n". + "<tr><td>Timestamp</td><td>Author</td><td></td><td>Diff</td><td>Flags</td><td>Current</td><td>Comment</td></tr>"; } /** * @return string */ function getEndBody() { - return "</ul>\n"; + return "</table>\n"; } /** @@ -1004,6 +1005,7 @@ $topmarktext .= ' ' . Linker::generateRollback( $rev, $this->getContext() ); } } + # Is there a visible previous revision? if ( $rev->userCan( Revision::DELETED_TEXT, $user ) && $rev->getParentId() !== 0 ) { $difftext = Linker::linkKnown( @@ -1029,22 +1031,18 @@ // For some reason rev_parent_id isn't populated for this row. // Its rumoured this is true on wikipedia for some revisions (bug 34922). // Next best thing is to have the total number of bytes. - $chardiff = ' <span class="mw-changeslist-separator">. .</span> '; - $chardiff .= Linker::formatRevisionSize( $row->rev_len ); - $chardiff .= ' <span class="mw-changeslist-separator">. .</span> '; + $chardiff = Linker::formatRevisionSize( $row->rev_len ); } else { $parentLen = 0; if ( isset( $this->mParentLens[$row->rev_parent_id] ) ) { $parentLen = $this->mParentLens[$row->rev_parent_id]; } - $chardiff = ' <span class="mw-changeslist-separator">. .</span> '; - $chardiff .= ChangesList::showCharacterDifference( + $chardiff = ChangesList::showCharacterDifference( $parentLen, $row->rev_len, $this->getContext() ); - $chardiff .= ' <span class="mw-changeslist-separator">. .</span> '; } $lang = $this->getLanguage(); @@ -1062,7 +1060,9 @@ } if ( $rev->isDeleted( Revision::DELETED_TEXT ) ) { $d = '<span class="history-deleted">' . $d . '</span>'; + $d = '<span class="history-deleted">' . $d . '</span>'; } + # Show user names for /newbies as there may be different users. # Note that we already excluded rows with hidden user names. @@ -1092,11 +1092,18 @@ $del .= ' '; } - $diffHistLinks = $this->msg( 'parentheses' ) - ->rawParams( $difftext . $this->messages['pipe-separator'] . $histlink ) - ->escaped(); - $ret = "{$del}{$d} {$diffHistLinks}{$chardiff}{$nflag}{$mflag} "; - $ret .= "{$link}{$userlink} {$comment} {$topmarktext}"; + $diffHistLinks = $difftext . $this->messages['pipe-separator'] . $histlink; + + $d = Html::rawElement( 'td', array(), $d ); + $diffHistLinks = Html::rawElement( 'td', array( 'style' => 'white-space: nowrap;' ), $diffHistLinks ); + $chardiff = Html::rawElement( 'td', array(), $chardiff ); + $flags = Html::rawElement( 'td', array(), $nflag.$mflag ); + $links = Html::rawElement( 'td', array( 'style' => 'white-space: nowrap;' ), $link.$userlink ); + $topmarktext = Html::rawElement( 'td', array(), $topmarktext ); + $comment = Html::rawElement( 'td', array(), $comment ); + + $ret = "{$del} {$d} {$links} {$diffHistLinks}{$chardiff}{$flags} "; + $ret .= "{$topmarktext} {$comment}"; # Denote if username is redacted for this edit if ( $rev->isDeleted( Revision::DELETED_USER ) ) { @@ -1121,7 +1128,7 @@ wfDebug( "Dropping Special:Contribution row that could not be formatted\n" ); $ret = "<!-- Could not format Special:Contribution row. -->\n"; } else { - $ret = Html::rawElement( 'li', array( 'class' => $classes ), $ret ) . "\n"; + $ret = Html::rawElement( 'tr', array( 'class' => $classes, 'background: red; color: white' ), $ret ) . "\n"; } return $ret; -- To view, visit https://gerrit.wikimedia.org/r/258897 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If8ba59d9f23d5e6e9f4bb461a31953ab1d8efd70 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Victorbarbu <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
