r64956 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64955‎ | r64956 | r64957 >
Date:10:31, 12 April 2010
Author:raymond
Status:ok (Comments)
Tags:
Comment:
* Use standard 'wikitable' class instead of using an own design
* Make table sortable
* Add an invisible timestamp for proper sorting of the "Attached on" column
Modified paths:
  • /trunk/extensions/CentralAuth/CentralAuth.php (modified) (history)
  • /trunk/extensions/CentralAuth/SpecialCentralAuth.php (modified) (history)
  • /trunk/extensions/CentralAuth/centralauth.css (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralAuth/CentralAuth.php
@@ -129,7 +129,7 @@
130130 /**
131131 * A CSS file version. Change each time centralauth.css is changed.
132132 */
133 -$wgCentralAuthStyleVersion = 1;
 133+$wgCentralAuthStyleVersion = 2;
134134
135135 /**
136136 * List of local pages global users may edit while being globally locked.
Index: trunk/extensions/CentralAuth/SpecialCentralAuth.php
@@ -318,7 +318,7 @@
319319 'id' => 'mw-centralauth-merged' ) ) .
320320 Xml::hidden( 'wpMethod', 'unmerge' ) .
321321 Xml::hidden( 'wpEditToken', $wgUser->editToken() ) .
322 - '<table id="mw-wikis-list">' .
 322+ Xml::openElement( 'table', array( 'class' => 'wikitable sortable mw-centralauth-wikislist' ) ) . "\n" .
323323 '<thead><tr>' .
324324 ( $this->mCanUnmerge ? '<th></th>' : '' ) .
325325 '<th>' . wfMsgHtml( 'centralauth-admin-list-localwiki' ) . '</th>'.
@@ -367,7 +367,12 @@
368368 return '<tr>' .
369369 ( $this->mCanUnmerge ? '<td>' . $this->adminCheck( $row['wiki'] ) . '</td>' : '' ).
370370 '<td>' . $this->foreignUserLink( $row['wiki'] ) . '</td>' .
371 - '<td>' . htmlspecialchars( $wgLang->timeanddate( $row['attachedTimestamp'] ) ) . '</td>' .
 371+ '<td>' .
 372+ // invisible, to make this column sortable
 373+ Html::element( 'span', array( 'style' => 'display: none' ), htmlspecialchars( $row['attachedTimestamp'] ) ) .
 374+ // visible date and time in users preference
 375+ htmlspecialchars( $wgLang->timeanddate( $row['attachedTimestamp'] ) ) .
 376+ '</td>' .
372377 '<td style="text-align: center">' . $this->formatMergeMethod( $row['attachedMethod'] ) . '</td>' .
373378 '<td>' . $this->formatBlockStatus( $row ) . '</td>' .
374379 '<td style="text-align: right">' . $this->formatEditcount( $row ) . '</td>' .
Index: trunk/extensions/CentralAuth/centralauth.css
@@ -1,18 +1,3 @@
2 -#mw-wikis-list {
3 - margin: 1em 1em 1em 0;
4 - background: #f9f9f9;
5 - border: 1px #aaa solid;
6 - border-collapse: collapse;
7 -}
8 -#mw-wikis-list td {
9 - border: 1px #aaa solid;
10 - padding: 0.2em;
11 -}
12 -#mw-wikis-list th {
13 - background: #f2f2f2;
14 - text-align: center;
15 -}
16 -
172 .merge-method-help {
183 color: #aaa;
194 cursor: pointer;

Comments

#Comment by Platonides (talk | contribs)   20:42, 3 May 2010

You will need r65875 for the sortable to not sort the heading.

Status & tagging log