Aude has submitted this change and it was merged. Change subject: New build, removing changes to PropertyView not ready for deployment ......................................................................
New build, removing changes to PropertyView not ready for deployment Change-Id: Iebaa67cf9ed12171458164f240e9d2931527c78e --- M composer.lock M extensions/Wikibase/lib/resources/templates.php M extensions/Wikibase/lib/resources/wikibase.css M extensions/Wikibase/repo/i18n/en.json M extensions/Wikibase/repo/i18n/qqq.json M extensions/Wikibase/repo/includes/EntityView.php M extensions/Wikibase/repo/includes/ItemView.php M extensions/Wikibase/repo/includes/PropertyView.php M vendor/autoload.php M vendor/composer/autoload_real.php M vendor/composer/installed.json 11 files changed, 79 insertions(+), 137 deletions(-) Approvals: Aude: Verified; Looks good to me, approved WikidataJenkins: Verified diff --git a/composer.lock b/composer.lock index 127334f..c220268 100644 --- a/composer.lock +++ b/composer.lock @@ -46,7 +46,7 @@ { "name": "Kyle Robinson Young", "email": "k...@dontkry.com", - "homepage": "https://github.com/shama", + "homepage": "http://dontkry.com", "role": "Developer" } ], @@ -856,12 +856,12 @@ "source": { "type": "git", "url": "https://github.com/wikimedia/mediawiki-extensions-Wikibase.git", - "reference": "102ad65816818449eacc4b34cdb968b8780faece" + "reference": "5ae31248b63c708dd14d32c1d0ffa43a217a6a75" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/102ad65816818449eacc4b34cdb968b8780faece", - "reference": "102ad65816818449eacc4b34cdb968b8780faece", + "url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/5ae31248b63c708dd14d32c1d0ffa43a217a6a75", + "reference": "5ae31248b63c708dd14d32c1d0ffa43a217a6a75", "shasum": "" }, "require": { @@ -920,7 +920,7 @@ "wikibaserepo", "wikidata" ], - "time": "2014-04-02 09:45:10" + "time": "2014-04-03 10:21:28" } ], "packages-dev": [ diff --git a/extensions/Wikibase/lib/resources/templates.php b/extensions/Wikibase/lib/resources/templates.php index 4b977b4..d8f49e4 100644 --- a/extensions/Wikibase/lib/resources/templates.php +++ b/extensions/Wikibase/lib/resources/templates.php @@ -26,9 +26,15 @@ HTML; - $templates['wb-entity-header-separator'] = + $templates['wb-entity-content'] = <<<HTML +$1 <!-- label --> +$2 <!-- description --> <hr class="wb-hr" /> +$3 <!-- aliases --> +$4 <!-- table of contents --> +$5 <!-- terms --> +$6 <!-- claims --> HTML; $templates['wb-entity-toc'] = @@ -340,7 +346,7 @@ <<<HTML <div class="wb-datatype wb-value-row"> <span class="wb-datatype-label">$1</span> - <span class="wb-datatype-value">$2</span> + <span class="wb-value">$2</span> </div> HTML; diff --git a/extensions/Wikibase/lib/resources/wikibase.css b/extensions/Wikibase/lib/resources/wikibase.css index 6729754..c148c50 100644 --- a/extensions/Wikibase/lib/resources/wikibase.css +++ b/extensions/Wikibase/lib/resources/wikibase.css @@ -1011,14 +1011,15 @@ /********** PROPERTY PAGE **********/ .wb-propertypage .wb-datatype { + float: left; clear: both; - margin-bottom: .2em; - margin-top: .5em; + margin-left: 10px; + margin-top: 2em; } -.wb-propertypage .wb-datatype-label { - font-weight: bold; - padding-left: 10px; +.wb-propertypage .wb-datatype span { + display: inline; + margin-right: .3em; } /********** /PROPERTY PAGE **********/ diff --git a/extensions/Wikibase/repo/i18n/en.json b/extensions/Wikibase/repo/i18n/en.json index bb4d035..17ad99d 100644 --- a/extensions/Wikibase/repo/i18n/en.json +++ b/extensions/Wikibase/repo/i18n/en.json @@ -32,9 +32,7 @@ "wikibase-alias-edit-placeholder": "enter an alias", "wikibase-label-input-help-message": "Enter the title of this data set in $1.", "wikibase-description-input-help-message": "Enter a short description in $1.", - "wikibase-claims": "Claims", "wikibase-statements": "Statements", - "wikibase-constraints": "Constraints", "wikibase-terms": "In other languages", "wikibase-sitelinks-add": "add a link to a site-link", "wikibase-sitelinks-empty": "No site-link for this item yet.", diff --git a/extensions/Wikibase/repo/i18n/qqq.json b/extensions/Wikibase/repo/i18n/qqq.json index c6f3569..434f97d 100644 --- a/extensions/Wikibase/repo/i18n/qqq.json +++ b/extensions/Wikibase/repo/i18n/qqq.json @@ -53,9 +53,7 @@ "wikibase-alias-edit-placeholder": "This is a generic placeholder message used while editing the list of aliases of an item. It is displayed in an empty input box which can be used to define a new alias.", "wikibase-label-input-help-message": "[[File:Screenshot WikidataRepo 2012-05-13 I.png|right|0x150px]]\nBubble help message for entering the label of the data set used for a specific item. Takes on additional argument ($1) that is the sub site identifier, i.e. \"English\" in nominative singular form. See also Wikidatas glossary for [[d:Wikidata:Glossary#languageattribute-label|label]] and [[d:Wikidata:Glossary#Item|item]].\n\nParameters:\n* $1 - language name\n{{Related|Wikibase-input-help-message}}", "wikibase-description-input-help-message": "[[File:Screenshot WikidataRepo 2012-05-13 H.png|right|0x150px]]\nBubble help message for entering the description of the data set used for a specific item. Takes on additional argument that is the sub site identifier, ie. \"English\" in nominative singular form. See also Wikidatas glossary for [[d:Wikidata:Glossary#languageattribute-description|description]] and [[d:Wikidata:Glossary#Item|item]].\n\nParameters:\n* $1 - language name\n{{Related|Wikibase-input-help-message}}", - "wikibase-claims": "Heading for the list of claims giving specific information about the currently viewed entity. See also Wikidata's glossary for [[m:d:Wikidata:Glossary#Claim|claim]].", "wikibase-statements": "Heading for the list of statements giving specific information about the currently viewed item. See also Wikidata's glossary for [[m:d:Wikidata:Glossary#Statement|statements]] and [[m:d:Wikidata:Glossary#Item|item]].", - "wikibase-constraints": "Heading for the list of claims defining constraints for the currently viewed property. See also Wikidata's glossary for [[m:d:Wikidata:Glossary#Claims|claims]] and [[m:d:Wikidata:Glossary#Property|property]].", "wikibase-terms": "Heading for the table with the labels and descriptions in other languages.\n{{Identical|Otherlanguages}}", "wikibase-sitelinks-add": "Add a sitelink to a language specific page on the cluster. See also Wikidata's glossary for [[d:Wikidata:Glossary#Sitelink|sitelinks]].", "wikibase-sitelinks-empty": "There are no site links for any of the language specific pages on the given cluster. See also Wikidatas glossary for [[d:Wikidata:Glossary#sitelinks|sitelinks]] and [[d:Wikidata:Glossary#sitelinks-title|title]].", diff --git a/extensions/Wikibase/repo/includes/EntityView.php b/extensions/Wikibase/repo/includes/EntityView.php index 53424b4..343b9ec 100644 --- a/extensions/Wikibase/repo/includes/EntityView.php +++ b/extensions/Wikibase/repo/includes/EntityView.php @@ -220,19 +220,32 @@ public function getInnerHtml( EntityRevision $entityRevision, $editable = true ) { wfProfileIn( __METHOD__ ); - $entity = $entityRevision->getEntity(); + $claims = ''; - $html = ''; + if ( $entityRevision->getEntity()->getType() === 'item' ) { + $claims = $this->getHtmlForClaims( $entityRevision->getEntity(), $editable ); + } - $html .= $this->getHtmlForLabel( $entity, $editable ); - $html .= $this->getHtmlForDescription( $entity, $editable ); + if ( $entityRevision->getEntity()->getId() ) { + // Placeholder for a termbox for the present item. + // EntityViewPlaceholderExpander must know about the parameters used here. + $languageTerms = $this->textInjector->newMarker( + 'termbox', + $entityRevision->getEntity()->getId()->getSerialization() + ); + } else { + //NOTE: this should only happen during testing + $languageTerms = ''; + } - $html .= wfTemplate( 'wb-entity-header-separator' ); - - $html .= $this->getHtmlForAliases( $entity, $editable ); - $html .= $this->getHtmlForToc(); - $html .= $this->getHtmlForTermBox( $entity, $editable ); - $html .= $this->getHtmlForClaims( $entity, $editable ); + $html = wfTemplate( 'wb-entity-content', + $this->getHtmlForLabel( $entityRevision->getEntity(), $editable ), + $this->getHtmlForDescription( $entityRevision->getEntity(), $editable ), + $this->getHtmlForAliases( $entityRevision->getEntity(), $editable ), + $this->getHtmlForToc(), + $languageTerms, + $claims + ); wfProfileOut( __METHOD__ ); return $html; @@ -283,25 +296,6 @@ */ protected function getTocSections() { return array(); - } - - /** - * @param Entity $entity - * @param bool $editable - * - * @return string - */ - protected function getHtmlForTermBox( Entity $entity, $editable = true ) { - if ( $entity->getId() ) { - // Placeholder for a termbox for the present item. - // EntityViewPlaceholderExpander must know about the parameters used here. - return $this->textInjector->newMarker( - 'termbox', - $entity->getId()->getSerialization() - ); - } - - return ''; } /** @@ -482,26 +476,6 @@ } /** - * Returns the HTML for the heading of the claims section - * - * @since 0.5 - * - * @param Entity $entity - * @param bool $editable - * - * @return string - */ - protected function getHtmlForClaimsSectionHeading( Entity $entity, $editable = true ) { - $html = wfTemplate( - 'wb-section-heading', - wfMessage( 'wikibase-claims' ), - 'claims' // ID - TODO: should not be added if output page is not the entity's page - ); - - return $html; - } - - /** * Builds and returns the HTML representing a WikibaseEntity's claims. * * @since 0.2 @@ -514,8 +488,13 @@ wfProfileIn( __METHOD__ ); $claims = $entity->getClaims(); + $html = ''; - $html = $this->getHtmlForClaimsSectionHeading( $entity, $editable ); + $html .= wfTemplate( + 'wb-section-heading', + wfMessage( 'wikibase-statements' ), + 'claims' // ID - TODO: should not be added if output page is not the entity's page + ); // aggregate claims by properties $claimsByProperty = array(); diff --git a/extensions/Wikibase/repo/includes/ItemView.php b/extensions/Wikibase/repo/includes/ItemView.php index 3d9ed9c..75a33f1 100644 --- a/extensions/Wikibase/repo/includes/ItemView.php +++ b/extensions/Wikibase/repo/includes/ItemView.php @@ -30,26 +30,6 @@ } /** - * Returns the HTML for the heading of the claims section - * - * @since 0.5 - * - * @param Entity $entity - * @param bool $editable - * - * @return string - */ - protected function getHtmlForClaimsSectionHeading( Entity $entity, $editable = true ) { - $html = wfTemplate( - 'wb-section-heading', - wfMessage( 'wikibase-statements' ), - 'claims' // ID - TODO: should not be added if output page is not the entity's page - ); - - return $html; - } - - /** * @see EntityView::getTocSections */ protected function getTocSections() { diff --git a/extensions/Wikibase/repo/includes/PropertyView.php b/extensions/Wikibase/repo/includes/PropertyView.php index 2f86870..1019088 100644 --- a/extensions/Wikibase/repo/includes/PropertyView.php +++ b/extensions/Wikibase/repo/includes/PropertyView.php @@ -18,66 +18,46 @@ class PropertyView extends EntityView { /** - * Builds and returns the inner HTML for representing a whole WikibaseEntity. The difference to getHtml() is that - * this does not group all the HTMl within one parent node as one entity. + * @see EntityView::getInnerHtml * - * @string - * - * @param EntityRevision $entityRevision + * @param EntityRevision $propertyRevision * @param bool $editable * * @throws \InvalidArgumentException * @return string */ - public function getInnerHtml( EntityRevision $entityRevision, $editable = true ) { + public function getInnerHtml( EntityRevision $propertyRevision, $editable = true ) { wfProfileIn( __METHOD__ ); - /* @var Property $property */ - $property = $entityRevision->getEntity(); + $property = $propertyRevision->getEntity(); if ( !( $property instanceof Property ) ) { throw new \InvalidArgumentException( '$propertyRevision must contain a Property' ); } + /* @var Property $property */ + + $html = parent::getInnerHtml( $propertyRevision, $editable ); + + $html .= $this->getHtmlForDataType( + $this->getDataType( $property ), + $editable + ); + + $html .= $this->getFooterHtml(); + + wfProfileOut( __METHOD__ ); + return $html; + } + + protected function getFooterHtml() { $html = ''; - - $html .= $this->getHtmlForLabel( $property, $editable ); - $html .= $this->getHtmlForDescription( $property, $editable ); - $html .= $this->getHtmlForDataType( $this->getDataType( $property ) ); - - $html .= wfTemplate( 'wb-entity-header-separator' ); - - $html .= $this->getHtmlForAliases( $property, $editable ); - $html .= $this->getHtmlForToc(); - $html .= $this->getHtmlForTermBox( $property, $editable ); - $html .= $this->getHtmlForClaims( $property, $editable ); $footer = $this->msg( 'wikibase-property-footer' ); if ( !$footer->isBlank() ) { $html .= "\n" . $footer->parse(); } - - wfProfileOut( __METHOD__ ); - return $html; - } - - /** - * Returns the HTML for the heading of the claims section - * - * @since 0.5 - * - * @param Entity $entity - * @param bool $editable - * - * @return string - */ - protected function getHtmlForClaimsSectionHeading( Entity $entity, $editable = true ) { - $html = wfTemplate( - 'wb-section-heading', - wfMessage( 'wikibase-constraints' ), - 'claims' // ID - TODO: should not be added if output page is not the entity's page - ); return $html; } diff --git a/vendor/autoload.php b/vendor/autoload.php index d3b2d68..753ea7a 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer' . '/autoload_real.php'; -return ComposerAutoloaderInitc45d24b19968980e0947159a61cc9111::getLoader(); +return ComposerAutoloaderInitb2f430e3c2039577b93e1d27f94dd640::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 29ef807..5f79915 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInitc45d24b19968980e0947159a61cc9111 +class ComposerAutoloaderInitb2f430e3c2039577b93e1d27f94dd640 { private static $loader; @@ -19,9 +19,9 @@ return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInitc45d24b19968980e0947159a61cc9111', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInitb2f430e3c2039577b93e1d27f94dd640', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInitc45d24b19968980e0947159a61cc9111', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInitb2f430e3c2039577b93e1d27f94dd640', 'loadClassLoader')); $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); @@ -45,14 +45,14 @@ $includeFiles = require __DIR__ . '/autoload_files.php'; foreach ($includeFiles as $file) { - composerRequirec45d24b19968980e0947159a61cc9111($file); + composerRequireb2f430e3c2039577b93e1d27f94dd640($file); } return $loader; } } -function composerRequirec45d24b19968980e0947159a61cc9111($file) +function composerRequireb2f430e3c2039577b93e1d27f94dd640($file) { require $file; } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 56c0f18..af4b9e5 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -43,7 +43,7 @@ { "name": "Kyle Robinson Young", "email": "k...@dontkry.com", - "homepage": "https://github.com/shama", + "homepage": "http://dontkry.com", "role": "Developer" } ], @@ -883,12 +883,12 @@ "source": { "type": "git", "url": "https://github.com/wikimedia/mediawiki-extensions-Wikibase.git", - "reference": "102ad65816818449eacc4b34cdb968b8780faece" + "reference": "5ae31248b63c708dd14d32c1d0ffa43a217a6a75" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/102ad65816818449eacc4b34cdb968b8780faece", - "reference": "102ad65816818449eacc4b34cdb968b8780faece", + "url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/5ae31248b63c708dd14d32c1d0ffa43a217a6a75", + "reference": "5ae31248b63c708dd14d32c1d0ffa43a217a6a75", "shasum": "" }, "require": { @@ -907,7 +907,7 @@ "wikibase/data-model": "~0.7.2", "wikibase/easyrdf_lite": "~0.8.1" }, - "time": "2014-04-02 09:45:10", + "time": "2014-04-03 10:21:28", "type": "mediawiki-extension", "installation-source": "dist", "autoload": { -- To view, visit https://gerrit.wikimedia.org/r/123667 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iebaa67cf9ed12171458164f240e9d2931527c78e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikidata Gerrit-Branch: mw1.23-wmf21 Gerrit-Owner: Aude <aude.w...@gmail.com> Gerrit-Reviewer: Addshore <addshorew...@gmail.com> Gerrit-Reviewer: Aude <aude.w...@gmail.com> Gerrit-Reviewer: Tobias Gritschacher <tobias.gritschac...@wikimedia.de> Gerrit-Reviewer: WikidataJenkins <wikidata-servi...@wikimedia.de> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits