mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-23 23:44:53 +00:00
Make page linked notification link to diff
This changes the page linked notification to link to the diff of when the page was changed and removes the "View changes" button. Bug: T324849 Change-Id: I25a3de3ce5c02be3abbab1d2d2dd1aad8d287cbd
This commit is contained in:
parent
2a3f7d377c
commit
06d7a488fd
|
@ -34,8 +34,16 @@ class EchoPageLinkedPresentationModel extends EchoEventPresentationModel {
|
|||
if ( $this->isBundled() ) {
|
||||
return false;
|
||||
} else {
|
||||
$params = [];
|
||||
if ( $this->event->getExtraParam( 'revid' ) ) {
|
||||
$params = [
|
||||
'oldid' => 'prev',
|
||||
'diff' => $this->event->getExtraParam( 'revid' )
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
'url' => $this->getPageFrom()->getFullURL(),
|
||||
'url' => $this->getPageFrom()->getFullURL( $params ),
|
||||
'label' => $this->msg( 'notification-link-text-view-page' )->text(),
|
||||
];
|
||||
}
|
||||
|
@ -51,20 +59,7 @@ class EchoPageLinkedPresentationModel extends EchoEventPresentationModel {
|
|||
'prioritized' => true
|
||||
];
|
||||
|
||||
$revid = $this->event->getExtraParam( 'revid' );
|
||||
$diffLink = null;
|
||||
if ( $revid !== null ) {
|
||||
$diffLink = [
|
||||
'url' => $this->getPageFrom()->getFullURL( [ 'diff' => $revid, 'oldid' => 'prev' ] ),
|
||||
'label' => $this->msg( 'notification-link-text-view-changes', $this->getViewingUserForGender() )
|
||||
->text(),
|
||||
'description' => '',
|
||||
'icon' => 'changes',
|
||||
'prioritized' => true
|
||||
];
|
||||
}
|
||||
|
||||
return [ $whatLinksHereLink, $diffLink, $this->getMuteLink() ];
|
||||
return [ $whatLinksHereLink, $this->getMuteLink() ];
|
||||
}
|
||||
|
||||
protected function getMuteLink() {
|
||||
|
|
Loading…
Reference in a new issue