Module:Changelog: Difference between revisions

Sur (talk | contribs)
m last_or_first now a named parameter rather than ordinally 2nd position
Sur (talk | contribs)
m corrected last_or_first to default to last instead of first
Line 160: Line 160:
local tag_to_search = frame.args[1]
local tag_to_search = frame.args[1]
local last_or_first = frame.args["last_or_first"]
local last_or_first = frame.args["last_or_first"]
if last_or_first == nil or last_or_first ~= 'last' then
if last_or_first == nil or last_or_first == 'last' then
last_or_first = 'last'
else
last_or_first = 'first'
last_or_first = 'first'
end
end
local list
local list = {}
if last_or_first == 'last' then
if last_or_first == 'last' then
list = ordered_ids
list = ordered_ids
else
else
-- Create the list in reverse
-- Create the list in reverse
local list = {}
for i = #ordered_ids, 1, -1 do
for i = #ordered_ids, 1, -1 do
table.insert(list, ordered_ids[i])
table.insert(list, ordered_ids[i])