Jump to content

Module talk:Infobox military conflict/Archive 4

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by ClueBot III (talk | contribs) at 02:31, 28 May 2018 (Archiving 1 discussion from Module talk:Infobox military conflict. (BOT)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Archive 1Archive 2Archive 3Archive 4Archive 5

Why are campaignbox infoboxes wrapped?

It seems pages which use this module are getting below-par mobile experiences as the mobile view excepts any element which matches the css selector .infobox to be a top-level element, however when campaignbox is enabled self.args.campaignbox it is wrapped in a table like so:

<table style="float:right;clear:right;background:transparent;margin:0;padding:0" ><tbody><tr><td> <!-- infobox --> </td></tr></table>

Any reason why these styles cannot be added on the .infobox element itself? Jdlrobson (talk) 22:29, 27 June 2017 (UTC)

Jdlrobson, outer wrapper was supposed to be equivalent to {{stack}} so that left floating elements are not bunched up at the bottom of the last right floating element. given that this is now completely broken, you should probably undo your changes and debug first. Frietjes (talk) 20:28, 6 July 2017 (UTC)
I have reversed the changes and put more tests in the testcases. Frietjes (talk) 21:15, 6 July 2017 (UTC)
Frietjes the changes look good. With regards to the text alignment - that can be fixed by adding `text-align:center;` to the element with .navbox-title

Wrapping in stack template would be a suitable alternative. We're considering a fix for infoboxes wrapped in stack template so that would be preferable on the long term than the current situation! Thanks for reviewing my change and helping make it better. Jdlrobson (talk) 21:33, 6 July 2017 (UTC)

Jdlrobson, it's not just the title that's being left aligned, but also the content inside the box. we don't have control over the content passed through the |campaignbox=, so it's better the container doesn't enforce styling on the object being passed inside. if you can come up with a fix for {{stack}}, then we can just the same fix inside this module. Frietjes (talk) 21:36, 6 July 2017 (UTC)
Frietjes the plan would be to look for any .infobox elements inside a mw-stack class. So if you can add that class the parent element to the template, I can take it from there and get it fixed (https://phabricator.wikimedia.org/T170006) :) Jdlrobson (talk) 18:05, 7 July 2017 (UTC)
Jdlrobson, we now have 'mw-stack mobile-float-reset' in the outer table class definition. note that {{stack}} uses a div container, instead of a table container. we can almost certainly switch to a div container if necessary. a test case is now American Revolutionary War. thank you for working on this. Frietjes (talk) 19:31, 7 July 2017 (UTC)
Jdlrobson, I also added these classes to template:infobox civil conflict. I think those are the only two, but I will add to any others if I find them. Frietjes (talk) 19:33, 7 July 2017 (UTC)