Module:Archive: Difference between revisions

Content deleted Content added
Per talk, this will use the yellow Template:tmbox in talk namespace and grey Template:mbox elsewhere.
display on template page, see talk for details
Line 99:
local namespace
if self.currentTitle.isTalkPage == true then
namespace = "'talk"'
else
namespace = "'main"'
end
Line 130:
end
 
-- Hardcode tmbox style on the template's page.
-- PS: Needs to be changed if the template is renamed!
local mainTemplatePage = ''
if self.currentTitle.fullText == 'Template:Automatic archive navigator' then
mainTemplatePage = 'talk'
end
local mbox = require('Module:Message box').main('mbox', {
demospace = args.demospace or mainTemplatePage,
image = image,
imageright = args.imageright,
Line 216 ⟶ 224:
 
function Navigator:makeArchiveLinksWikitable()
local args = self.args
local lang = mw.language.getContentLanguage()
local nums = self:getArchiveNums()
local noLinks = #nums
-- Skip number processing if |prev and |next are defined.
if args.prev or args.next then
local archives = {}
if args.prev then archives[#archives + 1] = mw.title.new(args.prev) end
archives[#archives + 1] = self.currentTitle
if args.next then archives[#archives + 1] = mw.title.new(args.next) end
local links = {
'{| style="width:30em;background:transparent;' ..
'margin:0 auto 0.5em;text-align:center"'
}
for i, title in ipairs(archives) do
links[#links + 1] = '\n| '
if tostring(title) == self.currentTitle.prefixedText then
links[#links + 1] = string.format(
'<span style="font-size:115%%;">%s</span>',
makeWikilink(title.fullText, title.subpageText)
)
else
links[#links + 1] = makeWikilink(title.fullText, title.subpageText)
end
end
links[#links + 1] = '\n|}'
return table.concat(links)
end
if noLinks < 1 then
return ''