Module:Event list: Difference between revisions

Content deleted Content added
No edit summary
m Pppery moved page Module:EventList to Module:Event list without leaving a redirect: Make module name match template name
 
(4 intermediate revisions by one other user not shown)
Line 10:
local cols = tonumber(args['columns'] or '2') or 2
local datewidth = args['datewidth'] or '-1'
local datealign = args['datealign'] or ''
local collapse = args['collapse'] or 'collapsed'
 
Line 24 ⟶ 25:
local i = tonumber(tostring(k):match( '^%s*date([%d]+)%s*$' ) or '-1')
if i ~= -1 then
table.insert(eventnums, ki)
else
i = tonumber(tostring(k):match( '^%s*event([%d]+)%s*$' ) or '-1')
if i ~= -1 then
table.insert(eventnums, ki)
else
i = tonumber(k) or -1
Line 68 ⟶ 69:
:css('cellpadding', '0px')
:css('margin', '-1px')
:css('font-size', '8588%')
:css('line-height', '95100%')
local tr = innertable:tag('tr'):css('vertical-align', 'top')
tr:tag('th')
:attr('scope', 'col')
:css('width', datewidth)
:css('text-align', (datealign ~= 'left'):wikitext( and datealign or 'Dateleft')
:css('border-bottom', '1px #aaa solid')
tr:tag('th'):attr('scope', 'col'):css('text-align', 'left'):wikitext('Event description')
:wikitext('Date')
tr:tag('th')
:attr('scope', 'col')
:css('text-align', 'left')
:css('border-bottom', '1px #aaa solid')
:wikitext('Event description')
for j=1,percol do
k = k + 1
Line 80 ⟶ 90:
local e = (args['event' .. n] or '') .. (args[2*(n-1)+2] or '')
if d ~= '' or e ~= '' then
tr = innertable:tag('tr'):css('vertical-align', 'top')
tr:tag('td'):css('text-align',(datealign ~= '') and datealign or nil):wikitext(d)
tr:tag('td'):wikitext(e)
end