Module:Documentation: Difference between revisions
m rebase dev changes onto prod |
Use Special pages for edit, history, purge; update to look more like the template on enwiki with the brackets around each link |
||
| Line 149: | Line 149: | ||
end | end | ||
local docClass = '' | local docClass = '' | ||
local colour = '00000000' | local colour = '00000000' | ||
| Line 156: | Line 154: | ||
local category | local category | ||
if noDoc then | if noDoc then | ||
docClass = 'documentation-noDoc' | docClass = 'documentation-noDoc' | ||
colour = '33333333' | colour = '33333333' | ||
| Line 180: | Line 176: | ||
end | end | ||
-- Generates the [view][edit][history][refresh] or [create][refresh] links | |||
links = mw.html.create( 'span' ) | links = mw.html.create( 'span' ) | ||
:attr( 'id', 'documentation-header-tools' ) | :attr( 'id', 'documentation-header-tools' ) | ||
:css( 'float', 'right' ) | :css( 'float', 'right' ) | ||
: | |||
local purgeLink = '[[Special:Purge/' .. docPage.fullText .. '|' .. f:preprocess('{{lc:{{int:smw purge}}}}') .. ']]' | |||
if not noDoc and page ~= docPage then | |||
local viewLink = '[[' .. docPage.fullText .. '|' .. f:preprocess('{{lc:{{int:view}}}}') .. ']]' | |||
local editLink = '[[Special:EditPage/' .. docPage.fullText .. '|' .. f:preprocess('{{lc:{{int:edit}}}}') .. ']]' | |||
local historyLink = '[[Special:PageHistory/' .. docPage.fullText .. '|' .. f:preprocess('{{lc:{{int:history short}}}}') .. ']]' | |||
links:wikitext("[" .. viewLink .. "] [" .. editLink .. "] [" .. historyLink .. "] [" .. purgeLink .. "]") | |||
else | |||
local createLink = '[' .. docPage:canonicalUrl{action = 'edit', preload = 'Template:Documentation/preload' } .. ' ' .. f:preprocess('{{lc:{{int:create}}}}') .. ']' | |||
links:wikitext("[" .. createLink .. "] [" .. purgeLink .. "]") | |||
end | |||
local body = mw.html.create( 'div' ):addClass( 'documentation' ) | local body = mw.html.create( 'div' ):addClass( 'documentation' ) | ||