Content deleted Content added
BrandonXLF (talk | contribs) No edit summary |
BrandonXLF (talk | contribs) Use list instead of table |
||
Line 19:
local function getImage(image)
local file =
if string.match(image, '.-%.') then
Line 29:
file = mw.getCurrentFrame():expandTemplate{title = 'flagdeco', args = {image, noredlink = 'y'}}
end
return file
end
Line 38:
local entries = {}
local i = 1
local
[''] =
['date'] =
flag =
}
Line 55:
local key, val = line:match('^([a-z]*):? *(.*)$')
if
data[key] =
else
return require('Module:Error').error{'Invalid key ' .. key .. ' in argument ' .. i}
Line 62:
end
if
data[''] = getCountry(data[''])
else
return require('Module:Error').error{'A country is required in argument ' .. i}
end
if
data['date'] = getTimespan(data['date'])
else
return require('Module:Error').error{'A date is required in argument ' .. i}
end
Line 73 ⟶ 77:
hasFlags = true
end
data['flag'] = getImage(data['flag'] or '')
table.insert(entries, data)
end
local
:addClass('historical-affiliation')
▲ float = args.float or 'left',
local titleId = math.random()
▲ })
:
:addClass('historical-affiliation-title')
local list = container:tag('ul')
:attr('aria-labelledby', titleId)
:addClass('historical-affiliation-list')
▲ :wikitext(args.title and args.title or 'Historical affiliations')
for i, entry in ipairs(entries) do
local
▲ row:tag('td')
:wikitext(entry[''] .. entry['date'])
end
return tostring(
name = 'templatestyles',
args = { src = 'User:BrandonXLF/J/styles.css' }
}
end
|