Module:Redirect template: Difference between revisions

m 1 revision imported: Templates and CSS files
m 1 revision imported: template update
 
(One intermediate revision by one other user not shown)
Line 16: Line 16:
category = { 14, '[[wp:categorization|category]]' },
category = { 14, '[[wp:categorization|category]]' },
user = { 2, '[[wp:user pages|user]]' },
user = { 2, '[[wp:user pages|user]]' },
draft = { 118, '[[wp:drafts|draft]]' },
}
}


Line 42: Line 43:
local namespace = mw.title.getCurrentTitle().namespace
local namespace = mw.title.getCurrentTitle().namespace


--- XXX: this is a HORRIBLE HACK. kill it with fire as soon as https://bugzilla.wikimedia.org/show_bug.cgi?id=12974 is fixed
--- XXX: this is a HORRIBLE HACK. kill it with fire as soon as https://phabricator.wikimedia.org/T14974 is fixed
local beCompatibleWithBug12974 = args.info and (args.info:find('^[:;#*]', 1) == 1 or args.info:find('{|', 1, true) == 1) and '\n' or ' '
--- [[phab:T14974]] was previously known as [[bugzilla:12974]] https://bugzilla.wikimedia.org/show_bug.cgi?id=12974
local beCompatibleWithBug14974 = args.info and (args.info:find('^[:;#*]', 1) == 1 or args.info:find('{|', 1, true) == 1) and '\n' or ' '
local content = string.format('\n<div class="rcat %s">\n*%sThis is a redirect%s%s.%s%s\n</div>',
local content = string.format('\n<div class="rcat %s">\n*%sThis is a redirect%s%s.%s%s\n</div>',
Line 50: Line 52:
args.from and (' from ' .. args.from) or '',
args.from and (' from ' .. args.from) or '',
args.to and (' to ' .. args.to) or '',
args.to and (' to ' .. args.to) or '',
args.info and beCompatibleWithBug12974 or '',
args.info and beCompatibleWithBug14974 or '',
args.info or ''
args.info or ''
)
)