Module:WikiProjectBanner/Note

MyWikiBiz, Author Your Legacy — Wednesday May 01, 2024
< Module:WikiProjectBanner
Revision as of 07:58, 16 July 2021 by Zoran (talk | contribs) (Pywikibot 6.4.0)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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

-------------------------------------------------------------------------------
--                               Note class                                  --
-- This module contains the Note class used in Module:WikiProjectBanner. It  --
-- is used to generate the requests and notices rows.                        --
-------------------------------------------------------------------------------
 
local Row = require('Module:WikiProjectBanner/Row')

local Note = setmetatable({}, Row)
Note.__index = Note

function Note.new(args, bannerData, cfg, rowCfg)
	local obj = Row.new(args, bannerData, cfg, rowCfg)
	setmetatable(obj, Note)

	-- Text
	if rowCfg.image then
		obj:setIcon(string.format(
				'[[File:%s|x25px|center|alt=Note icon]]',
				rowCfg.image
		))
	end
	obj:setText(rowCfg.text)

	-- Categories
	obj:addCategory(rowCfg.category)

	return obj
end

return Note