Module:Infobox road/sandbox: Difference between revisions

Content deleted Content added
Use display:table and margin:0 for browse tables
use sandbox subtemplate
 
(9 intermediate revisions by one other user not shown)
Line 4:
local yesno = require('Module:Yesno')
local langModule = require('Module:Lang')
local routeModule = require("Module:Infobox road/route/sandbox")
local parserModule = require("Module:Road data/parser")
local parser = parserModule.parser
Line 338:
 
--BROWSE LINKS
 
-- display:table and margin:0 override Minerva styling
local browseTableStyles = 'width:100%; background:none; border-collapse:collapse; display:table; margin:0;'
 
local function browse(args)
Line 348 ⟶ 345:
local nextRoute = args.next_route
if previousRoute or nextRoute then
local boxModule = require "Module:Road data/browse/sandbox"
local box = mw.html.create('table'):cssText(browseTableStyles)
local boxModule = require "Module:Road data/browse"
local primary = boxModule._browse(args)
local tblModule = require "Module:Road data/browsetable"
box:wikitext(primary)
return tostringtblModule._browsetable(boxprimary)
end
end
Line 366 ⟶ 362:
return nil
else
local tblModule = require "Module:Road data/browsetable"
local box = mw.html.create('table'):cssText(browseTableStyles)
-- Negative margin to counteract infobox border-spacing
box:wikitext(extended)
return tblModule._browsetable(extended, 'margin-top:-3px')
return tostring(box)
end
end