Module:Mainspace editnotice and Module:Mainspace editnotice/sandbox: Difference between pages

(Difference between pages)
Jump to navigation Jump to search
Page 1
Page 2
imported>SD0001
expand comment
 
imported>S.A. Julio
test
 
Line 1: Line 1:
local Arguments = require('Module:Arguments')
local Arguments = require('Module:Arguments')
local Disambiguation = require('Module:Disambiguation')
local Disambiguation = require('Module:Disambiguation/sandbox')
local TfaTitle = require('Module:TFA title')
local TfaTitle = require('Module:TFA title')


Line 61: Line 61:
for _, getNotice in pairs(notices) do
for _, getNotice in pairs(notices) do
local template = getNotice(page, context)
local template = getNotice(page, context)
if template then
text = text .. (template and ('<div class="editnotice-link" style="clear: both; float: right; margin: 0px 0.8em; padding: 0; line-height: 1em;"> <small>[[Template:'..template..'|'..template..']]</small> </div>' .. frame:expandTemplate{ title = template }) or '')
local template_link = '<div class="editnotice-link" style="clear: both; float: right; margin: 0px 0.8em; padding: 0; line-height: 1em;"> <small>[[Template:'..template..'|'..template..']]</small> </div>'
text = text .. template_link .. frame:expandTemplate{ title = template }
end
end
 
-- Add a link to view and modify the page's editnotice.
-- Not needed if there is no editnotice, because then MediaWiki itself adds
-- the link through [[MediaWiki:Editnotice-notext]].
-- Also skip it if a page editnotice exists, as in that case it probably
-- adds the link, and we want to avoid a duplicate one.
if text ~= '' and not mw.title.new('Template:Editnotices/Page/' .. page.fullText).exists then
text = text .. '<div class="editnotice-link sysop-show templateeditor-show pagemover-show" style="clear: both; float: right; margin: 0px 0.8em; padding: 0; line-height: 1em; display: none"><small>[[Template:Editnotices/Page/'.. page.fullText ..'|Page notice]]</small></div>'
end
end
return text
return text