This site is no longer actively maintained. It exists for historical purposes as an example of Phabricator integration and Lua scripting.

Module:Reports

From cpt
Revision as of 16:26, 9 June 2019 by Ccicalese (talk | contribs) (Created page with "local p = {} function p.cleanse(frame) local s = frame.args[1] s = string.gsub( s, '{', '{' ) s = string.gsub( s, '}', '}' ) s = string.gsub( s, '%[', '[' )...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:Reports/doc

local p = {}

function p.cleanse(frame)
	local s = frame.args[1]
	s = string.gsub( s, '{', '{' )
	s = string.gsub( s, '}', '}' )
	s = string.gsub( s, '%[', '[' )
	s = string.gsub( s, '%]', ']' )
	s = string.gsub( s, '|', '|' )
	return s
end

function p.cptWorkboardsTableRow(frame)
	local s = ''
	local link = frame.args[1]
	local category = frame.args[2]
	local kanban = frame.args[3]
	local backlog = frame.args[4]
	if ( #category > 0 and ( #kanban == 0 and #backlog == 0 )) or
		( #category == 0 and ( #kanban > 0 or ( #backlog > 0 and backlog ~= 'Watching / External' ))) then
		s = s .. '\n|' .. link
		s = s .. '\n|' .. category
		s = s .. '\n|' .. kanban
		s = s .. '\n|' .. backlog
		s = s .. '\n|-'
	end
	return s	
end

return p