Module:Solar eclipse/sandbox: Difference between revisions

Content deleted Content added
No edit summary
testing previous/next section (wip)
Line 86:
else
return c
end
end
 
local function createLink(label, suffix)
if not label or label == '' then
return ''
end
local link = mw.ustring.format('%s solar eclipse', label)
if ifexist(link) then
return string.format('[[%s|%s]]', link, label)
else
return label
end
end
Line 143 ⟶ 155:
"<div style='line-height:1.2em; padding-top:0.1em;'>" ..
(args['map_caption'] or '') .. "</div>", '') .. '</div>')
local prevLink = createLink(args['previous'], 'solar eclipse')
local nextLink = createLink(args['next'], 'solar eclipse')
local belowstr = ifnotempty(prevLink .. nextLink,
string.format('<div style="display:flex; justify-content:space-between;">%s %s</div>', prevLink, nextLink),
'')
 
return frame:expandTemplate{ title = 'infobox', args = {
Line 150 ⟶ 168:
["aboveclass"] = "summary",
["abovestyle"] = "padding-bottom:0.25em; background:" .. bgcolor .. "; line-height:1.2em; text-align:center; font-size:115%;",
["below"] = belowstr,
["belowstyle"] = "text-align:center; font-size:90%; padding-top:0.5em;",
------------------ Images and maps ------------------
["image"] = InfoboxImage(args['image']),
Line 212 ⟶ 232:
loadsolardb(frame,args['1'])
end
args['previous'] = args['previous']
args['next'] = args['next']
 
return infobox(frame)