jenkins-bot has submitted this change and it was merged.

Change subject: Do not bold all entries of an unvisited page on the Watchlist
......................................................................


Do not bold all entries of an unvisited page on the Watchlist

When a page is unvisited (wl_notificationtimestamp IS NOT NULL) all
entries of that page on the watchlist gets bold 
(class=mw-changeslist-line-watched),
because wl_notificationtimestamp is only checked for null.

wl_notificationtimestamp should be compared against rc_timestamp to
find only the really unvisited pages since the last visit on that page.

It is confusing, when all entries of a page on the watchlist gets bold,
but only some of the newer are unvisited.

Support for old and enhanced watchlist.

Change-Id: I7265141a6c84bcbdd7b651bd2983a08b73c6ddfe
---
M includes/ChangesList.php
M resources/mediawiki.special/mediawiki.special.changeslist.css
2 files changed, 12 insertions(+), 5 deletions(-)

Approvals:
  Anomie: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/ChangesList.php b/includes/ChangesList.php
index 73d3b61..5ecd4d9 100644
--- a/includes/ChangesList.php
+++ b/includes/ChangesList.php
@@ -618,7 +618,8 @@
 
                // Indicate watched status on the line to allow for more
                // comprehensive styling.
-               $classes[] = $watched ? 'mw-changeslist-line-watched' : 
'mw-changeslist-line-not-watched';
+               $classes[] = $watched && $rc->mAttribs['rc_timestamp'] >= 
$watched
+                       ? 'mw-changeslist-line-watched' : 
'mw-changeslist-line-not-watched';
 
                // Moved pages (very very old, not supported anymore)
                if ( $rc->mAttribs['rc_type'] == RC_MOVE || 
$rc->mAttribs['rc_type'] == RC_MOVE_OVER_REDIRECT ) {
@@ -880,7 +881,8 @@
                        $classes[] = Sanitizer::escapeClass( 'mw-changeslist-ns'
                                        . $block[0]->mAttribs['rc_namespace'] . 
'-' . $block[0]->mAttribs['rc_title'] );
                }
-               $classes[] = $block[0]->watched ? 'mw-changeslist-line-watched' 
: 'mw-changeslist-line-not-watched';
+               $classes[] = $block[0]->watched && 
$block[0]->mAttribs['rc_timestamp'] >= $block[0]->watched
+                       ? 'mw-changeslist-line-watched' : 
'mw-changeslist-line-not-watched';
                $r = Html::openElement( 'table', array( 'class' => $classes ) ) 
.
                        Html::openElement( 'tr' );
 
@@ -1061,7 +1063,10 @@
                        $classes = array();
                        $type = $rcObj->mAttribs['rc_type'];
 
-                       $r .= '<tr><td></td><td class="mw-enhanced-rc">';
+                       $trClass = $rcObj->watched && 
$rcObj->mAttribs['rc_timestamp'] >= $rcObj->watched
+                               ? ' class="mw-enhanced-watched"' : '';
+
+                       $r .= '<tr' . $trClass . '><td></td><td 
class="mw-enhanced-rc">';
                        $r .= $this->recentChangesFlags( array(
                                'newpage' => $type == RC_NEW,
                                'minor' => $rcObj->mAttribs['rc_minor'],
@@ -1202,7 +1207,8 @@
                        $classes[] = Sanitizer::escapeClass( 
'mw-changeslist-ns' .
                                        $rcObj->mAttribs['rc_namespace'] . '-' 
. $rcObj->mAttribs['rc_title'] );
                }
-               $classes[] = $rcObj->watched ? 'mw-changeslist-line-watched' : 
'mw-changeslist-line-not-watched';
+               $classes[] = $rcObj->watched && 
$rcObj->mAttribs['rc_timestamp'] >= $rcObj->watched
+                       ? 'mw-changeslist-line-watched' : 
'mw-changeslist-line-not-watched';
                $r = Html::openElement( 'table', array( 'class' => $classes ) ) 
.
                        Html::openElement( 'tr' );
 
diff --git a/resources/mediawiki.special/mediawiki.special.changeslist.css 
b/resources/mediawiki.special/mediawiki.special.changeslist.css
index ab57314..3c841e5 100644
--- a/resources/mediawiki.special/mediawiki.special.changeslist.css
+++ b/resources/mediawiki.special/mediawiki.special.changeslist.css
@@ -59,6 +59,7 @@
        background: url(images/arrow-expanded.png) no-repeat left bottom;
 }
 
-.mw-changeslist-line-watched .mw-title {
+.mw-changeslist-line-watched .mw-title,
+.mw-enhanced-watched .mw-enhanced-rc-time {
        font-weight: bold;
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/41592
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7265141a6c84bcbdd7b651bd2983a08b73c6ddfe
Gerrit-PatchSet: 11
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Dereckson <[email protected]>
Gerrit-Reviewer: Umherirrender <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to