Module:Message box: Difference between revisions
From The Kodiak Republic Wiki
Content added Content deleted
m (Pppery moved page Module:Message box/2 to Module:Message box without leaving a redirect) |
(These can just go, the first for being very Wikipedia-specific, and the second for being almost impossible to import properly) |
||
Line 163: | Line 163: | ||
self.typeClass = typeData.class |
self.typeClass = typeData.class |
||
self.typeImage = typeData.image |
self.typeImage = typeData.image |
||
-- Find if the box has been wrongly substituted. |
|||
self.isSubstituted = cfg.substCheck and args.subst == 'SUBST' |
|||
-- Find whether we are using a small message box. |
-- Find whether we are using a small message box. |
||
Line 301: | Line 298: | ||
end |
end |
||
self.info = args.info |
self.info = args.info |
||
if yesno(args.removalnotice) then |
|||
self.removalNotice = cfg.removalNotice |
|||
end |
|||
end |
end |
||
Line 433: | Line 427: | ||
local allSort = (self.title.namespace == 0 and 'Main:' or '') .. self.title.prefixedText |
local allSort = (self.title.namespace == 0 and 'Main:' or '') .. self.title.prefixedText |
||
self:addCat('all', 'Wikipedia message box parameter needs fixing', allSort) |
self:addCat('all', 'Wikipedia message box parameter needs fixing', allSort) |
||
end |
|||
if self.isSubstituted then |
|||
self:addCat('all', 'Pages with incorrectly substituted templates') |
|||
end |
end |
||
end |
end |
||
Line 468: | Line 459: | ||
function MessageBox:export() |
function MessageBox:export() |
||
local root = mw.html.create() |
local root = mw.html.create() |
||
-- Add the subst check error. |
|||
if self.isSubstituted and self.name then |
|||
root:tag('b') |
|||
:addClass('error') |
|||
:wikitext(string.format( |
|||
'Template <code>%s[[Template:%s|%s]]%s</code> has been incorrectly substituted.', |
|||
mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}') |
|||
)) |
|||
end |
|||
-- Create the box table. |
-- Create the box table. |
||
Line 537: | Line 518: | ||
:addClass('hide-when-compact') |
:addClass('hide-when-compact') |
||
:wikitext(self.info and (' ' .. self.info) or nil) |
:wikitext(self.info and (' ' .. self.info) or nil) |
||
end |
|||
if self.removalNotice then |
|||
textCellDiv:tag('small') |
|||
:addClass('hide-when-compact') |
|||
:tag('i') |
|||
:wikitext(string.format(" (%s)", self.removalNotice)) |
|||
end |
end |
||
else |
else |