<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://commons.islamical.org/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AInformation%2Fslim</id>
	<title>Module:Information/slim - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://commons.islamical.org/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AInformation%2Fslim"/>
	<link rel="alternate" type="text/html" href="https://commons.islamical.org/w/index.php?title=Module:Information/slim&amp;action=history"/>
	<updated>2026-09-26T22:57:33Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://commons.islamical.org/w/index.php?title=Module:Information/slim&amp;diff=3851&amp;oldid=prev</id>
		<title>Shahroudi: Created page with &quot;--[[     __  __           _       _        ___        __                            _   _               |  \/  | ___   __| |_   _| | ___ _|_ _|_ __  / _| ___  _ __ _ __ ___   __ _| |_(_) ___  _ __    | |\/| |/ _ \ / _` | | | | |/ _ (_)| || &#039;_ \| |_ / _ \| &#039;__| &#039;_ ` _ \ / _` | __| |/ _ \| &#039;_ \   | |  | | (_) | (_| | |_| | |  __/_ | || | | |  _| (_) | |  | | | | | | (_| | |_| | (_) | | | |  |_|  |_|\___/ \__,_|\__,_|_|\___(_)___|_| |_|_|  \___/|_|  |_| |_| |_|\__,_|\__|_|\...&quot;</title>
		<link rel="alternate" type="text/html" href="https://commons.islamical.org/w/index.php?title=Module:Information/slim&amp;diff=3851&amp;oldid=prev"/>
		<updated>2025-11-05T02:46:48Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;--[[     __  __           _       _        ___        __                            _   _               |  \/  | ___   __| |_   _| | ___ _|_ _|_ __  / _| ___  _ __ _ __ ___   __ _| |_(_) ___  _ __    | |\/| |/ _ \ / _` | | | | |/ _ (_)| || &amp;#039;_ \| |_ / _ \| &amp;#039;__| &amp;#039;_ ` _ \ / _` | __| |/ _ \| &amp;#039;_ \   | |  | | (_) | (_| | |_| | |  __/_ | || | | |  _| (_) | |  | | | | | | (_| | |_| | (_) | | | |  |_|  |_|\___/ \__,_|\__,_|_|\___(_)___|_| |_|_|  \___/|_|  |_| |_| |_|\__,_|\__|_|\...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--[[  &lt;br /&gt;
  __  __           _       _        ___        __                            _   _             &lt;br /&gt;
 |  \/  | ___   __| |_   _| | ___ _|_ _|_ __  / _| ___  _ __ _ __ ___   __ _| |_(_) ___  _ __  &lt;br /&gt;
 | |\/| |/ _ \ / _` | | | | |/ _ (_)| || &amp;#039;_ \| |_ / _ \| &amp;#039;__| &amp;#039;_ ` _ \ / _` | __| |/ _ \| &amp;#039;_ \ &lt;br /&gt;
 | |  | | (_) | (_| | |_| | |  __/_ | || | | |  _| (_) | |  | | | | | | (_| | |_| | (_) | | | |&lt;br /&gt;
 |_|  |_|\___/ \__,_|\__,_|_|\___(_)___|_| |_|_|  \___/|_|  |_| |_| |_|\__,_|\__|_|\___/|_| |_|&lt;br /&gt;
                                                                                               &lt;br /&gt;
This module is intended to be the engine behind &amp;quot;Template:Information&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Please do not modify this code without applying the changes first at&lt;br /&gt;
&amp;quot;Module:Information/sandbox&amp;quot; and testing at &amp;quot;Module:Information/testcases&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Authors and maintainers:&lt;br /&gt;
* User:Jarekt - original version &lt;br /&gt;
]]&lt;br /&gt;
local ISOdate = require(&amp;#039;Module:ISOdate&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
-- ====================================================================&lt;br /&gt;
-- === This function is just responsible for producing HTML of the  ===&lt;br /&gt;
-- === template. At this stage all the fields are already filed     ===&lt;br /&gt;
-- ====================================================================&lt;br /&gt;
local function Build_html(args)&lt;br /&gt;
	&lt;br /&gt;
	-- get text direction&lt;br /&gt;
	local dir = &amp;#039;ltr&amp;#039;&lt;br /&gt;
	if mw.language.new( args.lang ):isRTL() then&lt;br /&gt;
		dir = &amp;#039;rtl&amp;#039;&lt;br /&gt;
	end &lt;br /&gt;
&lt;br /&gt;
	-- Permissions tag&lt;br /&gt;
	local tag1 = mw.message.new( &amp;quot;wm-license-information-permission&amp;quot; ):inLanguage(args.lang):plain()&lt;br /&gt;
	local tag2 = mw.message.new( &amp;quot;wm-license-information-permission-reusing-link&amp;quot; ):inLanguage(args.lang):plain()&lt;br /&gt;
	local tag3 = mw.message.new( &amp;quot;wm-license-information-permission-reusing-text&amp;quot; ):inLanguage(args.lang):plain()&lt;br /&gt;
	local permission_tag  = string.format(&amp;quot;%s&amp;lt;br /&amp;gt;&amp;lt;small&amp;gt;([[%s|%s]])&amp;lt;/small&amp;gt;&amp;quot;, tag1, tag2, tag3)&lt;br /&gt;
	tag1 = mw.message.new( &amp;quot;wm-license-information-description&amp;quot; ):inLanguage(args.lang):plain()&lt;br /&gt;
	tag2 = mw.title.getCurrentTitle().text -- pagename&lt;br /&gt;
	local description_tag = string.format(&amp;#039;%s&amp;lt;span class=&amp;quot;summary fn&amp;quot; style=&amp;quot;display:none&amp;quot;&amp;gt;%s&amp;lt;/span&amp;gt;&amp;#039;, tag1, tag2)&lt;br /&gt;
	tag3 = string.format(&amp;#039; lang=&amp;quot;%s&amp;quot;&amp;#039;, args.lang)&lt;br /&gt;
&lt;br /&gt;
	-- add other fields&lt;br /&gt;
	local params = {&lt;br /&gt;
		{field=&amp;#039;description&amp;#039;    , id=&amp;#039;fileinfotpl_desc&amp;#039;  , tag=description_tag,                  alt=&amp;#039;Description missing&amp;#039;, wrapper=&amp;#039;%s&amp;#039;, td=&amp;#039; class=&amp;quot;description&amp;quot;&amp;#039;},&lt;br /&gt;
		{field=&amp;#039;other_fields_1&amp;#039;},&lt;br /&gt;
		{field=&amp;#039;date&amp;#039;           , id=&amp;#039;fileinfotpl_date&amp;#039;  , tag=&amp;#039;wm-license-information-date&amp;#039;,                               wrapper=&amp;#039;%s&amp;#039;, td=tag3},&lt;br /&gt;
		{field=&amp;#039;source&amp;#039;         , id=&amp;#039;fileinfotpl_src&amp;#039;   , tag=&amp;#039;wm-license-information-source&amp;#039;,  alt=&amp;#039;Source missing&amp;#039;,      wrapper=&amp;#039;%s&amp;#039;}, &lt;br /&gt;
		{field=&amp;#039;author&amp;#039;         , id=&amp;#039;fileinfotpl_aut&amp;#039;   , tag=&amp;#039;wm-license-information-author&amp;#039;,  alt=&amp;#039;Author missing&amp;#039;,      wrapper=&amp;#039;%s&amp;#039;},&lt;br /&gt;
		{field=&amp;#039;permission&amp;#039;     , id=&amp;#039;fileinfotpl_perm&amp;#039;  , tag=permission_tag,                                              wrapper=&amp;#039;%s&amp;#039;},&lt;br /&gt;
		{field=&amp;#039;other_versions&amp;#039; , id=&amp;#039;fileinfotpl_ver&amp;#039;   , tag=&amp;#039;wm-license-information-other-versions&amp;#039;,                     wrapper=&amp;#039;%s&amp;#039;}, &lt;br /&gt;
		{field=&amp;#039;other_fields&amp;#039;}&lt;br /&gt;
	}&lt;br /&gt;
	local results = {}&lt;br /&gt;
	for _, param in ipairs(params) do&lt;br /&gt;
		local field, tag, cell1, cell2, id&lt;br /&gt;
		field = args[param.field]&lt;br /&gt;
		if field and mw.ustring.match(field,&amp;quot;^[%s%p]+$&amp;quot;) then field=nul; end -- ignore panctuatin only fields&lt;br /&gt;
&lt;br /&gt;
		if param.id then -- skip &amp;quot;other fields&amp;quot; parameter&lt;br /&gt;
			if field then  -- add &amp;quot;id&amp;quot; to first &amp;lt;td&amp;gt; cell only if the field is present&lt;br /&gt;
				id = string.format(&amp;#039;id=&amp;quot;%s&amp;quot; &amp;#039;, param.id)&lt;br /&gt;
			elseif param.alt then -- Some field have &amp;quot;Missing&amp;quot; message if field is not provided&lt;br /&gt;
				field = mw.getCurrentFrame():expandTemplate{ title = param.alt }&lt;br /&gt;
			end&lt;br /&gt;
			if field or args.demo then  -- skip the row if still no field&lt;br /&gt;
				tag = param.tag&lt;br /&gt;
				if string.sub(tag,1,10) == &amp;#039;wm-license&amp;#039; then&lt;br /&gt;
					tag = mw.message.new( tag ):inLanguage(args.lang):plain() -- label message in args.lang language&lt;br /&gt;
				end&lt;br /&gt;
				cell1 = string.format(&amp;#039;&amp;lt;td %sclass=&amp;quot;fileinfo-paramfield&amp;quot; lang=&amp;quot;%s&amp;quot;&amp;gt;%s&amp;lt;/td&amp;gt;\n&amp;#039;, id or &amp;#039;&amp;#039;, args.lang, tag)&lt;br /&gt;
				cell2 = string.format(&amp;#039;&amp;lt;td%s&amp;gt;&amp;#039;.. param.wrapper ..&amp;#039;&amp;lt;/td&amp;gt;&amp;#039;, param.td or &amp;#039;&amp;#039;, field or &amp;#039;&amp;#039;)&lt;br /&gt;
				field = string.format(&amp;#039;&amp;lt;tr style=&amp;quot;vertical-align: top&amp;quot;&amp;gt;\n%s%s\n&amp;lt;/tr&amp;gt;\n\n&amp;#039;, cell1, cell2)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		table.insert(results, field)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- add table and outer layers&lt;br /&gt;
	local style = string.format(&amp;#039;class=&amp;quot;fileinfotpl-type-information toccolours vevent&amp;quot; style=&amp;quot;width: 100%%;&amp;quot; dir=&amp;quot;%s&amp;quot; cellpadding=&amp;quot;4&amp;quot;&amp;#039;, dir)&lt;br /&gt;
	results = string.format(&amp;#039;&amp;lt;table %s&amp;gt;\n\n%s\n&amp;lt;/table&amp;gt;\n&amp;#039;, style, table.concat(results))&lt;br /&gt;
	results = string.format(&amp;#039;&amp;lt;div class=&amp;quot;hproduct commons-file-information-table&amp;quot;&amp;gt;\n%s\n&amp;lt;/div&amp;gt;\n&amp;#039;, results)&lt;br /&gt;
	return results&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- ==================================================&lt;br /&gt;
-- === External functions ===========================&lt;br /&gt;
-- ==================================================&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- ===========================================================================&lt;br /&gt;
-- === Version of the function to be called from other LUA codes&lt;br /&gt;
-- ===========================================================================&lt;br /&gt;
function p._information(args)&lt;br /&gt;
	&lt;br /&gt;
	-- ====================================================&lt;br /&gt;
	-- === add tag templates used for tracking          === &lt;br /&gt;
	-- ====================================================&lt;br /&gt;
	local frame = mw.getCurrentFrame()&lt;br /&gt;
	if args.date then&lt;br /&gt;
		args.date = ISOdate._ISOdate(args.date, args.lang, &amp;#039;&amp;#039;, &amp;#039;dtstart&amp;#039;, &amp;#039;100-999&amp;#039;)      -- apply ISODate to function to date string to convert date in ISO format to translated date string&lt;br /&gt;
	    -- add an empty template which can be used as a tag in PetScan&lt;br /&gt;
		local d    = os.date(&amp;#039;!*t&amp;#039;)                   -- current date table&lt;br /&gt;
		local current_year  = tonumber(d.year)        -- current year&lt;br /&gt;
		local creation_year = tonumber(ISOdate._ISOyear(args.date))&lt;br /&gt;
		if creation_year and current_year and (current_year-creation_year)&amp;gt;200 then&lt;br /&gt;
			frame:expandTemplate{ title =&amp;#039;Works created more than 200 years ago&amp;#039; }&lt;br /&gt;
		end&lt;br /&gt;
	end &lt;br /&gt;
	frame:expandTemplate{ title = &amp;#039;Infobox template tag&amp;#039; } -- add the template tag&lt;br /&gt;
	return frame:preprocess(Build_html(args))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- ===========================================================================&lt;br /&gt;
-- === Version of the function to be called from template namespace&lt;br /&gt;
-- ===========================================================================&lt;br /&gt;
function p.information(frame)&lt;br /&gt;
	-- switch to lowercase parameters to make them case independent&lt;br /&gt;
	local args = {}&lt;br /&gt;
	for name, value in pairs( frame:getParent().args ) do &lt;br /&gt;
		if value ~= &amp;#039;&amp;#039; then -- nuke empty strings&lt;br /&gt;
			local name1 = string.gsub( string.lower(name), &amp;#039; &amp;#039;, &amp;#039;_&amp;#039;)&lt;br /&gt;
			args[name1] = value&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	for name, value in pairs( frame.args ) do &lt;br /&gt;
		if value ~= &amp;#039;&amp;#039; then -- nuke empty strings&lt;br /&gt;
			local name1 = string.gsub( string.lower(name), &amp;#039; &amp;#039;, &amp;#039;_&amp;#039;)&lt;br /&gt;
			args[name1] = value&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if not (args.lang and mw.language.isSupportedLanguage(args.lang)) then &lt;br /&gt;
		args.lang = frame:callParserFunction( &amp;quot;int&amp;quot;, &amp;quot;lang&amp;quot; ) -- get user&amp;#039;s chosen language&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- call the inner &amp;quot;core&amp;quot; function&lt;br /&gt;
	return p._information(args)	&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Shahroudi</name></author>
	</entry>
</feed>