Content deleted Content added
simplify code Tag: Reverted |
restore |
||
Line 204:
if args[v]['system'] then -- Header row
local stop_noun = data[v]['header stop noun'] or i18n[lang]['stop_noun']
mw.logObject(data[v])
table.insert(wikitable, table.concat({'\n|-',
'\n!', style['header cell'], i18n[lang]['preceding'](stop_noun),
'\n!', style['header midcell'], (data[v]['system style'] and data[v]['system style'] or table.concat({(data[v]['system icon'] and data[v]['system icon'] .. ' ' or ''), (data[v]['system title'] or ('[['.. args[v]['system'] ..']]'))})),
'\n!', style['header cell'], i18n[lang]['following'](stop_noun)
}))
Line 500 ⟶ 501:
local greatercontrast = require('Module:Color contrast')._greatercontrast
text_color = text_color and '#' .. text_color or greatercontrast{color}
local bold = (yesno(args.bold) == false) or ';font-weight:
else▼
croute = '<span style="background-color: #%s; border: .075em solid #%s; border-radius: .5em; padding: 0 .3em;%scolor: %s; %s font-size: inherit; white-space: nowrap;">%s</span>%s', -- [[Template:Bahnlinie]]▼
end▼
fallback = '<div class="legend" style="-webkit-column-break-inside: avoid; page-break-inside: avoid; break-inside: avoid-column;"><span class="legend-color" style="display: inline-block; width: 1.5em; height: 1.5em; margin: 1px 0; border: 1px solid black; background-color: #%s;"> </span> %s %s</div>', -- [[Template:Legend]] (fallback; duplication to simplify logic)▼
if link then▼
result = '<span style="background-color:#' .. color .. ';border:.075em solid #' .. border_color .. ';border-radius:.5em;padding:0 .3em">[[' .. link .. '|<span style="color:' .. text_color .. bold .. ';font-size:inherit;white-space:nowrap">' .. lineN .. '</span>]]</span>'
else▼
▲
▲ if link then
elseif inline == 'xroute' then -- [[Template:Bahnlinie]]
if link then
▲ else
result = '<span style="border:.075em solid #' .. border_color .. ';border-radius:.5em;padding:0 .3em">[[' .. link .. '|<span style="color:#' .. color .. bold .. ';font-size:inherit;white-space:nowrap">' .. lineN .. '</span>]]</span>'
result = '<span style="border:.075em solid #' .. border_color .. ';border-radius:.5em;padding:0 .3em;color:#' .. color .. bold .. ';font-size:inherit;white-space:nowrap">' .. lineN .. '</span>'
▲ end
end
else -- [[Template:Legend]] (fallback; duplication to simplify logic)
▲ if inline == 'route' or inline == 'croute' then
▲
▲ elseif inline == 'xroute' then
▲ else
end
end
|