Module:Variants: Difference between revisions
Fix errors
(Format low➨high for items with a range of profession levels; Align levels to the right) |
(Fix errors) |
||
Line 59:
return ':No variants found.'
end
local profession_b_flag = false
for _, entry in ipairs(smw_data) do
if entry['Profession B'] or entry['Profession Level B'] then
profession_b_flag = true
end
break
end
local table = mw.html.create('table')
:addClass('sortable wikitable')
Line 68 ⟶ 77:
:tag('th')
:wikitext('Level')
:attrIf(
:done()
:done()
Line 76 ⟶ 85:
return nil
end
local level_text = tostring(level or '?')
if high then
level_text = ('%s➨%d'):format(level_text, high)
Line 84 ⟶ 93:
for _, entry in ipairs(smw_data) do
local profession_level_a = entry['Profession Level A'] or '?'
local profession_level_b = entry['Profession Level B'] or '?'
local profession_b = entry['Profession B'] or ''
table
:tag('tr')
Line 97 ⟶ 110:
:css{ ['text-align'] = 'right' }
:wikitext(formatProfessionLevel(entry['Profession A'], entry['Profession Level A'], entry['Profession Level A High']))
:
▲ :IF(entry['Profession B'])
:tag('td')
:IF(entry['Profession B'])
:css{ ['text-align'] = 'right' }
:wikitext(formatProfessionLevel(entry['Profession B'], entry['Profession Level B'], entry['Profession Level B High']))
|