Module:InfoboxHero: Difference between revisions

change tooltip type (the boring html title style)
move back to fancy tooltips, also add classes to label spans
Line 560: Line 560:
end
end
if row.link then
if row.link then
label_cell:wikitext(string.format('[[%s|<span>%s</span>]]:',
label_cell:wikitext(string.format('[[%s|<span class="infobox-h-stat-label">%s</span>]]:',
page_link(ctx, row.link), label_of(row)))
page_link(ctx, row.link), label_of(row)))
else
else
Line 616: Line 616:
local tr = tbl:tag('tr')
local tr = tbl:tag('tr')
local label = dict_module.translate(row.label_dict)
local label = dict_module.translate(row.label_dict)
local label_cell = tr:tag('td')
if row.tooltip then
if row.tooltip then
label_cell:attr('title', row.tooltip)
label = ctx.frame:expandTemplate{ title = 'Tooltip', args = { label, row.tooltip } }
end
end
if row.link then
if row.link then
label_cell:wikitext(string.format('[[%s|<span>%s</span>]]:',
tr:tag('td'):wikitext(string.format('[[%s|<span class="infobox-h-stat-label">%s</span>]]:',
page_link(ctx, row.link), label))
page_link(ctx, row.link), label))
else
else
label_cell:wikitext(label .. ':')
tr:tag('td'):wikitext(label .. ':')
end
end
tr:tag('td'):wikitext(ctx.args[row.param])
tr:tag('td'):wikitext(ctx.args[row.param])