Page MenuHomePhabricator

[edit] links should not print in Wikidata
Closed, ResolvedPublic

Description

In printout, links to [edit] or [add] a statement should not be visible.

Patch-For-Review:

Event Timeline

FriedhelmW raised the priority of this task from to Low.
FriedhelmW updated the task description. (Show Details)
FriedhelmW added a project: Wikidata.org.
FriedhelmW added a subscriber: FriedhelmW.
FriedhelmW renamed this task from Wikidata: [edit] links should not print to [edit] links should not print in Wikidata.Jan 23 2015, 7:17 AM

In EntityParserOutputGenerator, call $options->setEditSection( false ) if $options->getIsPrintable()

Could this be solved using CSS @media print?

Some CSS similar to

 @media print {
	.wikibase-toolbarbutton {
		display: none;
	}
 }

should fix it.

Change 343851 had a related patch set uploaded (by Thiemo Mättig (WMDE)):
[mediawiki/extensions/Wikibase] Disable editing in printable=yes mode

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

I demoed this to @Lydia_Pintscher and got approval to add this to #wikidata-sprint. I spend most time on figuring out why the test behaves different from the production code, and found https://phabricator.wikimedia.org/source/mediawiki/browse/master/includes/MediaWiki.php;69fab9a8179350fc01876d9ea3a253d6e080e1db$179 *shudder*. All solved in https://gerrit.wikimedia.org/r/343851.

Change 343851 merged by jenkins-bot:
[mediawiki/extensions/Wikibase] Disable editing in printable=yes mode

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

Ehm you can print without using printable=yes of course...

This is what CSS media queries are for, not our printable=yes mode...

@TheDJ, that's right.

Some CSS similar to

 @media print {
	.wikibase-toolbarbutton {
		display: none;
	}
 }

should fix it.

thiemowmde moved this task from Review to Done on the Wikidata-Former-Sprint-Board board.
thiemowmde removed a project: Patch-For-Review.

you can print without using printable=yes […] This is what CSS media queries are for […]

Both should work. It appears the later was never a problem, but printable=yes was.

  • When calling a page with printable=yes, section editing is disabled on wikitext pages. The Wikibase UI should respect this and not initialize it's edit toolbars. Fixed with https://gerrit.wikimedia.org/r/343851.
  • When printing a page without calling the printable version first, a print stylesheet is applied, which already works fine, as far as I can see.

Well i include a screenshot what of what I currently see when hitting print:

The blocks are a bug with svg images in print mode in Safari, but i clearly get edit buttons atm, I see no evidence that they are being hidden for me. Am I misunderstanding the problem ?

thiemowmde removed thiemowmde as the assignee of this task.

I must have done something wrong. You are right, I also see edit buttons in the Firefox print preview now. I'm moving this ticket back because an essential part of it is not done. However, what we needed to do for T160256 in our current #wikidata-sprint is done.

Change 364615 had a related patch set uploaded (by AnotherLadsgroup; owner: Amir Sarabadani):
[mediawiki/extensions/Wikibase@master] Do not show edit buttons when it's being printed

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

Change 364615 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Do not show edit buttons when it's being printed

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