Adrian Lang has uploaded a new change for review. https://gerrit.wikimedia.org/r/119457
Change subject: Simplify wb-snak template, pass template options in JS ...................................................................... Simplify wb-snak template, pass template options in JS This removes an ugly $1 class in JS-rendered claims. It's related to bug 62527. Change-Id: Ie030fc7e2a4ff6b840c02fe1c7ab75c65b7f13bf --- M lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.js M lib/resources/templates.php M repo/includes/ClaimHtmlGenerator.php 3 files changed, 3 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/57/119457/1 diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.js b/lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.js index db7e3fa..5159d05 100644 --- a/lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.js +++ b/lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.js @@ -56,6 +56,7 @@ */ options: { template: 'wb-snak', + templateParams: [ '', '', '' ], templateShortCuts: { '$property': '.wb-snak-property', '$snakValue': '.wb-snak-value', diff --git a/lib/resources/templates.php b/lib/resources/templates.php index 655ac33..0f9695f 100644 --- a/lib/resources/templates.php +++ b/lib/resources/templates.php @@ -111,8 +111,8 @@ <div class="wb-snak-property" dir="auto">$2</div> </div> <div class="wb-snak-value-container" dir="auto"> - <div class="wb-snak-typeselector">$3</div> - <div class="wb-snak-value">$4</div> + <div class="wb-snak-typeselector"></div> + <div class="wb-snak-value">$3</div> </div> </div> HTML; diff --git a/repo/includes/ClaimHtmlGenerator.php b/repo/includes/ClaimHtmlGenerator.php index 33e399d..f4af15d 100644 --- a/repo/includes/ClaimHtmlGenerator.php +++ b/repo/includes/ClaimHtmlGenerator.php @@ -70,7 +70,6 @@ '', // Link to property. NOTE: we don't display this ever (instead, we generate it on // Claim group level) If this was a public function, this should be generated // anyhow since important when displaying a Claim on its own. - '', // type selector, JS only ( $formattedValue === '' ) ? ' ' : $formattedValue ); @@ -254,7 +253,6 @@ 'wb-snakview', // Display property link only once for snaks featuring the same property: $propertyLink, - '', ( $snak->getType() === 'value' ) ? $this->getFormattedSnakValue( $snak ) : '' ); } -- To view, visit https://gerrit.wikimedia.org/r/119457 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie030fc7e2a4ff6b840c02fe1c7ab75c65b7f13bf Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Adrian Lang <adrian.l...@wikimedia.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits