Modul:Vorlage:Phab: Unterschied zwischen den Versionen
2015-03-27
wp>PerfektesChaos (2015-03-26) |
wp>PerfektesChaos (2015-03-27) |
||
Zeile 1: | Zeile 1: | ||
--[=[ 2015-03- | --[=[ 2015-03-27 | ||
{{Template:Phab}} | {{Template:Phab}} | ||
]=] | ]=] | ||
Zeile 235: | Zeile 235: | ||
-- Returns string URL, if fine | -- Returns string URL, if fine | ||
local s = type( args ) | local s = type( args ) | ||
local r, show, tags | local n, r, show, tags | ||
if s == "table" then | if s == "table" then | ||
if type( args.Engage ) == "string" then | if type( args.Engage ) == "string" then | ||
tags = args.Engage | tags = args.Engage | ||
end | end | ||
if args.Show and ( args.Show ~= "" ) then | |||
if | show = args.Show | ||
end | end | ||
if not tags or tags == "" then | elseif s == "string" then | ||
tags = args | |||
end | |||
if not tags or tags == "" then | |||
tags = "MediaWiki-General-or-Unknown" | |||
end | |||
tags = mw.text.split( tags, "%s+" ) | |||
n = #tags | |||
if show and n > 1 then | |||
show = false | |||
end | |||
for i = 1, n do | |||
s = tags[ i ] | |||
if r then | |||
r = r .. " | " | |||
else | |||
r = "" | |||
end | end | ||
if not show then | |||
show = "#" .. s | |||
if show | |||
show = | |||
end | end | ||
r = string.format( "%s[%stag/%s %s]", | |||
r, Site, s:lower(), show ) | |||
end -- for i | |||
return r | return r | ||
end -- phabBoards() | end -- phabBoards() | ||
Zeile 329: | Zeile 324: | ||
if type( details ) ~= "table" then | if type( details ) ~= "table" then | ||
details = { } | details = { } | ||
end | |||
if details.say then | |||
table.insert( pages, details.say ) | |||
end | end | ||
if details.support then | if details.support then | ||
Zeile 564: | Zeile 562: | ||
elseif load then | elseif load then | ||
if show then | if show then | ||
show = "r" .. show | show = "r" .. show | ||
-- lapsus = ( not args.project ) | |||
else | else | ||
show = "GIT:" | show = "GIT:" | ||
Zeile 574: | Zeile 572: | ||
end | end | ||
if not r then | if not r then | ||
if not scope:find( "/", 3, true ) then | |||
error( "Unknown project: " .. scope, 0 ) | |||
end | |||
r = git( swift, scope, slot, source, jump, since ) | r = git( swift, scope, slot, source, jump, since ) | ||
lapsus = true | lapsus = true | ||
Zeile 839: | Zeile 840: | ||
local lucky, r = pcall( main, frame:getParent().args, frame ) | local lucky, r = pcall( main, frame:getParent().args, frame ) | ||
if not lucky then | if not lucky then | ||
r = string.format( "<span class=\"error\">%s</span>", r ) | local sick = "[[Category:Wikipedia:Vorlagenfehler/Vorlage:Phab]]" | ||
r = string.format( "<span class=\"error\">%s</span>%s", | |||
r, sick ) | |||
end | end | ||
return r | return r |