Module:CareerList: Difference between revisions
Content deleted Content added
PeaceDeadC (talk | contribs) No edit summary |
PeaceDeadC (talk | contribs) No edit summary |
||
Line 1:
local p = {}
local cfg = mw.loadData('Module:CareerList/config')
local function getSiteLink(site)
site = mw.ustring.lower(site)
return url:gsub('$1', id)
end
local function makeCell(args, bgcolor)
local site = args.site or ''
local
local
local notes = args.notes or 'N/A'
local link = getSiteLink(site):gsub('$1', id)
local bg = (site == 'Website') and '#E7E7E7' or '#DADADA'
local rowbg = (bgcolor == '#FFFFFF') and '#F3F3F3' or '#FFFFFF'
return string.format([[
<tr style="background-color: %s;">
<td style="background-color: %s;">%s</td>
<td style="background-color: %s;"><a href="%s">%s</a></td>
<td>%s</td>
<td>%s</td>
</tr>
]], bgcolor, bg, site, rowbg, link, alias, alias, notes)
end
function p.
local
local bgcolor = '#F2F2F2'
local rows = ''
for row in mw.ustring.gmatch(list, '{{CareerListCell(.-)}}') do
bgcolor = (bgcolor == '#FFFFFF') and '#F3F3F3' or '#FFFFFF'
end
return string.format([[
<table class="wikitable" style="width: 100%; margin: 1em 0; background-color: %s;">
<caption>%s</caption>
<tr>
<th style="width: 15%;">Type</th>
<th style="width: 35%;">Name</th>
<th style="width: 35%;">Alias</th>
<th style="width: 15%;">Notes</th>
</tr>
%s
</table>
]], bgcolor, title, rows)
end
| |||