17,233
edits
(add AoL, LttP, LA to staging. gonna do all four before going live) |
m (change label class to zdw-label to distinguish from bootstrap) |
||
(13 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
:tag( 'ul' ) | :tag( 'ul' ) | ||
for _, section in ipairs( sections ) do | for _, section in ipairs( sections ) do | ||
-- !!!! This may break if Template:Main is modified !!!! | -- !!!! This may break if Template:Main is modified !!!! | ||
local expandedMainTemplate = section.summary:match( 'Main article: %[%[(.-)]]' ) | local expandedMainTemplate = section.summary:match( 'Main article: %[%[(.-)]]' ) | ||
local link = | local link = expandedMainTemplate and mw.text.split( expandedMainTemplate, '|' )[1] | ||
list:tag( 'li' ) | list:tag( 'li' ) | ||
:wikitext( '[[' .. (link or section.name) .. '|' .. section.name .. ']]' ) | :wikitext( '[[' .. (link or section.name) .. '|' .. section.name .. ']]' ) | ||
Line 27: | Line 26: | ||
-- override | -- override | ||
function Listbox:renderContent() | function Listbox:renderContent() | ||
local listing = Listing._parseListing | local listing = Listing._parseListing( self.subject ) | ||
-- If categories weren't set already (because caller used single arg), then use the ones parsed from the page. | |||
-- CODE SMELL: setting unrelated state. this only works because renderFooter is called after renderContent. | |||
if #self.categories == 0 then self.categories = listing.categories end | |||
local content = mw.html.create( 'table' ) | local content = mw.html.create( 'table' ) | ||
Line 42: | Line 45: | ||
local row = content:tag( 'tr' ) | local row = content:tag( 'tr' ) | ||
row:tag( 'th' ) | row:tag( 'th' ) | ||
:addClass( 'label' ) | :addClass( 'zdw-label' ) | ||
:wikitext( group.name ) | :wikitext( group.name ) | ||
local cell = row:tag( 'td' ) | local cell = row:tag( 'td' ) | ||
Line 66: | Line 69: | ||
getParent = function() return { | getParent = function() return { | ||
args = { | args = { | ||
[1] = "The Legend of Zelda | [1] = "The Legend of Zelda Locations" | ||
} | } | ||
} end | } end |