Module:QuestList: Difference between revisions
query episodes
No edit summary |
(query episodes) |
||
Line 7:
function p.main(frame)
local args = frame:getParent().args
-- get all episodes by episode sequence order --
local episodes = mw.smw.ask{
'[[Category:Episodes]]',
'[[Episode sequence number::+]]',
'[[Release Date::+]]',
'?Name#-',
'order=asc',
'sort=
'
'
}
local table = mw.html.create('table')
:addClass('wikitable quest-table
:css{
['width'] = '
}
:attr{ cellspacing = '3' }
for _, episode in ipairs(episodes) do
table
:tag('tr')
:tag('
:
:wikitext('[[File:'.. episode.Name ..' episode icon.png|16px]] ' .. episode[1])
:done()
:done()
:tag('
:
:tag('th')
:wikitext('Type')
:done()
:tag('th')
:wikitext('Difficulty')
:done()
:tag('th')
:wikitext('Requirements')
:done()
:done()
if ( episode ) then
-- get all quests for episode --
local quests = mw.smw.ask{
'[[Category:Quests]]',
'[[Name::+]]',
('[[Episode::%s]]'):format( episode.Name ),
'?Quest type',
'?Difficulty',
'?Requirements',
'order=asc',
'sort=Quest type,override_seq,Difficulty'
}
-- get quests for episode --
for _, quest in ipairs( quests ) do
table
:
:
:
:
:
:
['width'] = '50px'
:wikitext( quest['Quest type'] )
:done()
:tag('td')
:wikitext( parse.difficulty_func( tostring(quest.Difficulty ) ) )
:done()
:tag('td')
:css {
['width'] = '55%'
}
:tag('div')
:addClass('lighttable checklist')
:newline()
:wikitext( quest.Requirements )
:newline()
:done()
:done()
:done()
end
end
end
end
table:done()
return table
|