[MediaWiki-commits] [Gerrit] Don't show dead edit links in diff/old revisions - change (mediawiki...Wikibase)

2014-10-17 Thread WMDE
Thiemo Mättig (WMDE) has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/167177

Change subject: Don't show dead edit links in diff/old revisions
..

Don't show dead edit links in diff/old revisions

Bug: 72177
Change-Id: I2cd252c4c9b2c6ccabf911ab08d3af46da42bf23
---
M repo/includes/View/SectionEditLinkGenerator.php
1 file changed, 9 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/77/167177/1

diff --git a/repo/includes/View/SectionEditLinkGenerator.php 
b/repo/includes/View/SectionEditLinkGenerator.php
index 6a14275..17fbaef 100644
--- a/repo/includes/View/SectionEditLinkGenerator.php
+++ b/repo/includes/View/SectionEditLinkGenerator.php
@@ -47,9 +47,7 @@
$html = wfTemplate( 'wikibase-toolbar-container',
wfTemplate( 'wikibase-toolbar',
'',
-   wfTemplate( 'wikibase-toolbar-bracketed',
-   $toolbarButton
-   )
+   $toolbarButton
)
);
 
@@ -87,18 +85,16 @@
 */
private function getToolbarButton( $cssClassSuffix, $buttonLabel, 
$editUrl = null ) {
if ( $editUrl !== null ) {
-   return wfTemplate( 'wikibase-toolbar-button',
-   'wikibase-toolbar-button-' . $cssClassSuffix,
-   $editUrl,
-   $buttonLabel
-   );
-   } else {
-   return wfTemplate( 'wikibase-toolbar-button',
-   'wikibase-toolbar-button-' . $cssClassSuffix . 
' ui-state-disabled',
-   '#',
-   $buttonLabel
+   return wfTemplate( 'wikibase-toolbar-bracketed',
+   wfTemplate( 'wikibase-toolbar-button',
+   'wikibase-toolbar-button-' . 
$cssClassSuffix,
+   $editUrl,
+   $buttonLabel
+   )
);
}
+
+   return '';
}
 
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2cd252c4c9b2c6ccabf911ab08d3af46da42bf23
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.de

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Don't show dead edit links in diff/old revisions - change (mediawiki...Wikibase)

2014-10-17 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Don't show dead edit links in diff/old revisions
..


Don't show dead edit links in diff/old revisions

These are just dead anchor links anyway. In diff/old revisions they
are not needed, also not as a placeholder for the JavaScript since
the JavaScript should not run in diff/old revisions anyway. See
I429f44a.

Bug: 72177
Change-Id: I2cd252c4c9b2c6ccabf911ab08d3af46da42bf23
---
M repo/includes/View/SectionEditLinkGenerator.php
M repo/tests/phpunit/includes/View/SectionEditLinkGeneratorTest.php
2 files changed, 12 insertions(+), 22 deletions(-)

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



diff --git a/repo/includes/View/SectionEditLinkGenerator.php 
b/repo/includes/View/SectionEditLinkGenerator.php
index 6a14275..17fbaef 100644
--- a/repo/includes/View/SectionEditLinkGenerator.php
+++ b/repo/includes/View/SectionEditLinkGenerator.php
@@ -47,9 +47,7 @@
$html = wfTemplate( 'wikibase-toolbar-container',
wfTemplate( 'wikibase-toolbar',
'',
-   wfTemplate( 'wikibase-toolbar-bracketed',
-   $toolbarButton
-   )
+   $toolbarButton
)
);
 
@@ -87,18 +85,16 @@
 */
private function getToolbarButton( $cssClassSuffix, $buttonLabel, 
$editUrl = null ) {
if ( $editUrl !== null ) {
-   return wfTemplate( 'wikibase-toolbar-button',
-   'wikibase-toolbar-button-' . $cssClassSuffix,
-   $editUrl,
-   $buttonLabel
-   );
-   } else {
-   return wfTemplate( 'wikibase-toolbar-button',
-   'wikibase-toolbar-button-' . $cssClassSuffix . 
' ui-state-disabled',
-   '#',
-   $buttonLabel
+   return wfTemplate( 'wikibase-toolbar-bracketed',
+   wfTemplate( 'wikibase-toolbar-button',
+   'wikibase-toolbar-button-' . 
$cssClassSuffix,
+   $editUrl,
+   $buttonLabel
+   )
);
}
+
+   return '';
}
 
 }
diff --git a/repo/tests/phpunit/includes/View/SectionEditLinkGeneratorTest.php 
b/repo/tests/phpunit/includes/View/SectionEditLinkGeneratorTest.php
index 1d54103..cb70ca6 100644
--- a/repo/tests/phpunit/includes/View/SectionEditLinkGeneratorTest.php
+++ b/repo/tests/phpunit/includes/View/SectionEditLinkGeneratorTest.php
@@ -27,7 +27,7 @@
$key = $action === 'add' ? 'wikibase-add' : 'wikibase-edit';
$msg = wfMessage( $key )-inLanguage( $langCode );
 
-   $html = $generator-getHtmlForEditSection( $pageName, array(), 
'', $msg, $enabled );
+   $html = $generator-getHtmlForEditSection( $pageName, array( 
'Q1' ), '', $msg, $enabled );
$matcher = array(
'tag' = 'span',
'class' = 'wikibase-toolbar'
@@ -107,14 +107,8 @@
$enabled
);
 
-   $this-assertNotTag( array(
-   'tag' = 'a',
-   'attributes' = array( 'href' = 
'regexp:+\bSpecial:SetLabel\b+' )
-   ), $html );
-   $this-assertTag( array(
-   'tag' = 'span',
-   'attributes' = array( 'class' = 'ui-state-disabled' )
-   ), $html );
+   $this-assertNotContains( 'a ', $html );
+   $this-assertNotContains( 'wikibase-toolbar-button', $html );
}
 
public function getHtmlForEditSection_disabledProvider() {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2cd252c4c9b2c6ccabf911ab08d3af46da42bf23
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.de
Gerrit-Reviewer: Adrian Lang adrian.l...@wikimedia.de
Gerrit-Reviewer: Daniel Kinzler daniel.kinz...@wikimedia.de
Gerrit-Reviewer: Hoo man h...@online.de
Gerrit-Reviewer: jenkins-bot 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits