Module:Tour stats: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 398: Line 398:
local get_row = require('Module:Live show row')._main
local get_row = require('Module:Live show row')._main
local list = root:tag('ul')
local list = root:tag('ul')
local artists = {}
local teases = 0
local abandoned = 0
local acoustic = 0
local piano = 0
for r = 1, #results do
for r = 1, #results do
local result = results[r]
local result = results[r]
list:tag('li'):wikitext(result['page_title'])
list:node(get_row(result))
list:node(get_row(result))
-- For counts
artists[result['artist']] = true
if result['tease'] == '1' then
teases = teases + 1
end
if result['abandoned'] == '1' then
abandoned = abandoned + 1
end
if result['acoustic'] == '1' then
acoustic = acoustic + 1
end
if result['piano'] == '1' then
piano = piano + 1
end
end
totals_info = {}
if acoustic > 0 then
table.insert(totals_info, acoustic .. ' acoustic')
end
if piano > 0 then
table.insert(totals_info, piano .. ' piano')
end
if teases > 0 then
table.insert(totals_info, teases .. ' ' .. lang:plural(teases, 'tease', 'teases'))
end
if abandoned > 0 then
table.insert(totals_info, abandoned .. ' abandoned')
end
if #totals_info > 0 then
totals_div:wikitext(' (' .. table.concat(totals_info, ', ') .. ')')
end
end
-- -- Add 'next 100' link
-- if mw.title.getCurrentTitle() == 'Module:Tour sutats' then
-- currentTitle = 'Template:Tour stats/sandbox'
-- else
-- currentTitle = mw.title.new(currentTitle)
-- end
-- link_url = currentTitle:fullUrl(args, 'https')


return tostring(root)
return tostring(root)