Module:QuestList: Difference between revisions
m
no edit summary
mNo edit summary |
mNo edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1:
require('strict')
require('Module:Mw.html extension')
local purge = require('Module:Purge')._purge
local parse = require('Module:Param Parse')
Line 23 ⟶ 24:
local table = mw.html.create('table')
if (episodes == nil) then
:addClass('wikitable quest-table align-center-2 align-center-3 align-left-4')▼
table:wikitext("No quests available for " .. args.episode .. " " .. purge('source-'..mw.uri.anchorEncode(args.episode), '(update)', 'span'))
:css{▼
else
['width'] = '55%'▼
▲ :addClass('wikitable quest-table align-center-2 align-center-3 align-left-4')
:attr{ cellspacing = '3' }▼
:css{
for _, episode in ipairs(episodes) do▼
▲ :attr{ cellspacing = '3' }
:tag('tr')▼
:tag('th')▼
▲ for _, episode in ipairs(episodes) do
:attr('colspan', 4)▼
:wikitextIf(episode.Premium == true, '[[File:Premium Pass icon.png|16px]] ')▼
▲ :tag('tr')
:wikitext('[[File:'.. episode.Name ..' episode icon.png|16px]] ' .. episode[1])▼
▲ :tag('th')
▲ :attr('colspan', 4)
▲ :wikitextIf(episode.Premium == true, '[[File:Premium Pass icon.png|16px]] ')
▲ :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()
▲ :tag('th')
▲ :wikitext('Type')
▲ :done()
▲ :tag('th')
▲ :wikitext('Difficulty')
▲ :done()
▲ :tag('th')
▲ :wikitext('Requirements')
▲ :done()
▲ :done()
-- get all quests for episode --▼
local quests = mw.smw.ask{ ▼
('[[Episode::%s]]'):format( episode.Name ),▼
'?Requirements',▼
'sort=Quest type,override_seq,Difficulty'▼
▲ }
if (
-- get all quests for episode --
▲ local quests = mw.smw.ask{
for _, quest in ipairs( quests ) do▼
▲ ('[[Episode::%s]]'):format( episode.Name ),
:tag('td')▼
▲ 'sort=Quest type,override_seq,Difficulty'
['width'] = '50px'▼
:tag('td')▼
▲ for _, quest in ipairs( quests ) do
:wikitext( parse.difficulty_func( tostring(quest.Difficulty ) ) )▼
:tag('
:
:wikitext( quest[
:tag('
:
:
:done()
▲ :tag('td')
▲ :wikitext( parse.difficulty_func( tostring(quest.Difficulty ) ) )
:done()
▲ :tag('td')
▲ :css {
}
:tag('div')
:addClass('lighttable checklist')
:newline()
:newline()
:done()
:done()
end
end
table:done()
end
▲ table:done()
return table▼
▲ return table
end
|