Module:RfP header: Difference between revisions

From Test Wiki
Jump to navigation Jump to search
m (+TOC, per Special:Diff/23426)
(Update)
 
(24 intermediate revisions by 5 users not shown)
Line 3: Line 3:
local m_body_a = ''
local m_body_a = ''
local m_i = 1
local m_i = 1
while mw.title.new('Request permissions/Archive' .. m_i , 4).exists do
while mw.title.new('Request for permissions/Archive ' .. m_i , 4).exists do
m_i = m_i + 1
m_i = m_i + 1
end
end
Line 9: Line 9:
local m_apn = 1
local m_apn = 1
local m_body_b = ''
local m_body_b = ''
local m_summary = ''
local m_timestamp = frame:callParserFunction( 'REVISIONTIMESTAMP', 'Test Wiki:Request for permissions' )
local m_time = frame:callParserFunction( '#time', 'Y-m-d"T"H:i:s"Z"', m_timestamp )
local m_id = frame:callParserFunction( 'REVISIONID', 'Test Wiki:Request for permissions' )
local m_editor = frame:callParserFunction( 'REVISIONUSER', 'Test Wiki:Request for permissions' )
m_summary = mw.uri.encode( 'Archiving [[Test Wiki:Request for permissions]] (revision as of [[Special:PermaLink/' .. m_id .. '|' .. m_time .. ']], last edit by [[Special:Contributions/' .. m_editor .. '|' .. m_editor .. ']])' ,'PATH')
while m_apn <= m_i - 1 do
while m_apn <= m_i - 1 do
m_body_b = m_body_b .. '\n' .. '|-\n' .. '|colspan="3" style="background-color: #457645" align="center"|[[File:Human-folder.png|25px|link=Test Wiki:Request permissions/Archive' .. m_apn .. ']][[Test Wiki:Request permissions/Archive' .. m_apn .. '|<span style="color:#FFFFFF; text-decoration:underline">Archive' .. m_apn .. '</span>]]'
m_body_b = m_body_b .. '\n' .. '|-\n' .. '|colspan="3" style="background-color: #457645" align="center"|[[File:Human-folder.png|25px|link=Test Wiki:Request for permissions/Archive ' .. m_apn .. ']][[Test Wiki:Request for permissions/Archive ' .. m_apn .. '|<span style="color:#FFFFFF; text-decoration:underline">Archive ' .. m_apn .. '</span>]]'
m_apn = m_apn + 1
m_apn = m_apn + 1
end
end
if mw.allToString( mw.title.getCurrentTitle() ) == 'Test Wiki:Request permissions' then
if mw.allToString( mw.title.getCurrentTitle() ) == 'Test Wiki:Request for permissions' then
m_body_a = m_body_a .. '{| style="width: 100%; border: 3px double #662; padding: .3em; background-color: darkgreen; color: #EEE"\n| colspan="3" style="background-color: #888" align="center" | ' .. "'''Request permissions'''" .. '\n|-\n|<center>You can request administrator or other permissions below. You must already be an administrator to be eligible for Bureaucrat. Interface administrator rights may only be granted by the stewards and are only given to highly trusted users. Rights may be removed after 3 months of [[Test Wiki:Inactivity policy|<span style="color:#FFFFFF; text-decoration:underline">inactivity</span>]].<br/>\nOther Permissions: Bot,  translate administrator, interwiki admin,  autopatrol,  <br>\nFor Steward or System Administrator, a vote should take place on the [[Test_Wiki:Community_portal|<span style="color:#FFFFFF; text-decoration:underline">community portal</span>]].<br/>\nBureaucrats, you can use the [[Special:Preferences#mw-prefsection-gadgets|<span style="color:#FFFFFF; text-decoration:underline">userRightsManagerTW gadget</span>]] to easily handle requests.\n</center>' .. m_body_b ..'\n' .. '|-\n' .. '|colspan="3" style="background-color: #457645" align="center"|[[File:Red pencil.svg|25px|link=' .. mw.title.new('Request permissions/Archive' .. m_i , 4):fullUrl( 'action=edit' ) .. ']][[Test Wiki:Request permissions/Archive' .. m_i .. '|<span style="color:#FFFFFF; text-decoration:underline">Archive' .. m_i .. '</span>]]\n|-\n|colspan="3" style="background-color: #457645" align="center"|[[File:Icons8 flat plus.svg|25px|link=' .. mw.title.new('Request permissions/Archive' .. ( m_i + 1 ) , 4):fullUrl( 'action=edit&preload=Test+Wiki%3ARequest+permissions' ) .. ']][[Test Wiki:Request permissions/Archive' .. ( m_i + 1 ).. '|<span style="color:#FFFFFF; text-decoration:underline">Archive' .. ( m_i + 1 ) .. '</span>]]\n|-\n| width="97px" style="padding:1px; padding-left:2px;" | <center>' .. "'''Click the '''Request rights''' button to request  permissions'''" .. '</center>\n|-\n|' .. frame:callParserFunction{ name = '#tag:inputbox', args = { 'type=comment\nbuttonlabel= Request rights \nsummary= Request rights\npreload= Test Wiki:Request permissions/Preload\npage=Test Wiki:Request permissions\ndefault=Test Wiki:Request permissions\nhidden=yes' } } .. '\n|}'
m_body_a = m_body_a .. '{| style="width: 100%; border: 3px double #662; padding: .3em; background-color: darkgreen; color: #EEE"\n| colspan="3" style="background-color: #888" align="center" | ' .. "'''Request for permissions'''" .. '\n|-\n|<center>You can request administrator, bureaucrat, or other permissions below. You must already be an administrator to be eligible for bureaucrat permissions. Interface administrator rights can only be granted by the stewards and are only given to highly trusted users. Non-steward suppressor rights may be requested here, but two stewards must support your request. However, the right is only granted to trusted users for non-test reasons. Otherwise, please request suppression rights at the [[Test Wiki:Community portal|Community portal]]. All rights will be removed after 3 months of [[Test Wiki:Inactivity policy|<span style="color:#FFFFFF; text-decoration:underline">inactivity</span>]].<br/>\nOther Permissions: Bot,  translate administrator, interwiki admin,  autopatrol,  <br>\nFor Steward or System Administrator, a vote should take place on the [[Test_Wiki:Community_portal|<span style="color:#FFFFFF; text-decoration:underline">community portal</span>]].<br/>\nBureaucrats, you can use the [[Special:Preferences#mw-prefsection-gadgets|<span style="color:#FFFFFF; text-decoration:underline">userRightsManager gadget</span>]] to easily handle requests.\n<br/><small>Please note that you should make a confirmation edit, then link to the diff on the other wiki, when specifying cross-project accounts.</small>\n</center>' .. m_body_b ..'\n' .. '|-\n' .. '|colspan="3" style="background-color: #457645" align="center"|[[File:Red pencil.svg|25px|link=' .. mw.title.new('Request for permissions/Archive ' .. m_i , 4):fullUrl( 'action=edit&summary=' .. m_summary ) .. ']][[Test Wiki:Request for permissions/Archive ' .. m_i .. '|<span style="color:#FFFFFF; text-decoration:underline">Archive ' .. m_i .. '</span>]]\n|-\n|colspan="3" style="background-color: #457645" align="center"|[[File:Icons8 flat plus.svg|25px|link=' .. mw.title.new('Request for permissions/Archive ' .. ( m_i + 1 ) , 4):fullUrl( 'action=edit&preload=Test+Wiki%3ARequest+permissions&summary=' .. m_summary ) .. ']]<span class="plainlinks">[' .. mw.title.new( 'Request for permissions/Archive ' .. ( m_i + 1 ), 4 ):fullUrl( 'action=edit&preload=Test+Wiki%3ARequest+permissions&summary=' .. m_summary ) .. ' <span style="color:#FFFFFF; text-decoration:underline">Archive ' .. ( m_i + 1 ) .. '</span> ]</span>\n|-\n| width="97px" style="padding:1px; padding-left:2px;" | <center>' .. "'''Click the '''Request rights''' button to request  permissions'''" .. '</center>\n|-\n|' .. frame:callParserFunction{ name = '#tag:inputbox', args = { 'type=comment\nbuttonlabel= Request rights \nsummary= Request rights\npreload= Template:RfP preload\npage=Test Wiki:Request for permissions\ndefault=Test Wiki:Request for permissions\nhidden=yes' } } .. '\n|}'
else
else
m_body_a = m_body_a .. '{| style="width: 100%; border: 3px double #662; padding: .3em; background-color: darkgreen; color: #EEE"\n| colspan="3" style="background-color: #888" align="center" | ' .. "'''Request permissions Archives'''" .. '\n|-\n|\n' .. m_body_b .. '\n|-\n|colspan="3" style="background-color: #457645" align="center"|[[File:Human-folder.png|25px|link=Test Wiki:Request permissions/Archive' .. m_i .. ']][[Test Wiki:Request permissions/Archive' .. m_i .. '|<span style="color:#FFFFFF; text-decoration:underline">Archive' .. m_i .. '</span>]]\n|-\n| width="97px" style="padding:1px; padding-left:2px;" | <center>' .. "'''This Page shows old Requests'''" .. '</center>\n|-\n|width="97px" style="padding:1px; padding-left:2px;" | <center>For Requesting New Rights Please go back to Main Page Follow the Instructions while requesting...</center>\n|-\n|' .. frame:callParserFunction{ name = '#tag:inputbox', args = { 'type=comment\nbuttonlabel= Main Page\nsummary=\npreload=\npage=Test Wiki:Request permissions\ndefault=Test Wiki:Request permissions\nhidden=yes' } } .. '\n|}\n' .. frame:expandTemplate{ title = 'Archive' }
m_body_a = m_body_a .. '{| style="width: 100%; border: 3px double #662; padding: .3em; background-color: darkgreen; color: #EEE"\n| colspan="3" style="background-color: #888" align="center" | ' .. "'''Request for permissions archives'''" .. '\n|-\n|\n' .. m_body_b .. '\n|-\n|colspan="3" style="background-color: #457645" align="center"|[[File:Human-folder.png|25px|link=Test Wiki:Request for permissions/Archive ' .. m_i .. ']][[Test Wiki:Request for permissions/Archive ' .. m_i .. '|<span style="color:#FFFFFF; text-decoration:underline">Archive ' .. m_i .. '</span>]]\n|-\n| width="97px" style="padding:1px; padding-left:2px;" | <center>' .. "'''This page shows an archive of handled requests'''" .. '</center>\n|-\n|width="97px" style="padding:1px; padding-left:2px;" | <center>To request Administrator, Bureaucrat, or Interface Administrator, please go back to [[Test Wiki: Request for permissions|the main page]] and follow the instructions to request rights.</center>\n|-\n|' .. frame:callParserFunction{ name = '#tag:inputbox', args = { 'type=comment\nbuttonlabel= Main Page\nsummary=\npreload=\npage=Test Wiki:Request for permissions\ndefault=Test Wiki:Request for permissions\nhidden=yes' } } .. '\n|}\n' .. frame:expandTemplate{ title = 'Archive ' }
end
end
return m_body_a .. '__TOC__'
return m_body_a .. '__TOC__'

Latest revision as of 14:35, 26 January 2024

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

local p = {}
function p.Main( frame )
	local m_body_a = ''
		local m_i = 1
		while mw.title.new('Request for permissions/Archive ' .. m_i , 4).exists do
			m_i = m_i + 1
		end
		m_i = m_i - 1
	local m_apn = 1
	local m_body_b = ''
	local m_summary = ''
		local m_timestamp = frame:callParserFunction( 'REVISIONTIMESTAMP', 'Test Wiki:Request for permissions' )
			local m_time = frame:callParserFunction( '#time', 'Y-m-d"T"H:i:s"Z"', m_timestamp )
		local m_id = frame:callParserFunction( 'REVISIONID', 'Test Wiki:Request for permissions' )
		local m_editor = frame:callParserFunction( 'REVISIONUSER', 'Test Wiki:Request for permissions' )
	m_summary = mw.uri.encode( 'Archiving [[Test Wiki:Request for permissions]] (revision as of [[Special:PermaLink/' .. m_id .. '|' .. m_time .. ']], last edit by [[Special:Contributions/' .. m_editor .. '|' .. m_editor .. ']])' ,'PATH')
	while m_apn <= m_i - 1 do
		m_body_b = m_body_b .. '\n' .. '|-\n' .. '|colspan="3" style="background-color: #457645" align="center"|[[File:Human-folder.png|25px|link=Test Wiki:Request for permissions/Archive ' .. m_apn .. ']][[Test Wiki:Request for permissions/Archive ' .. m_apn .. '|<span style="color:#FFFFFF; text-decoration:underline">Archive ' .. m_apn .. '</span>]]'
		m_apn = m_apn + 1
	end
	if mw.allToString( mw.title.getCurrentTitle() ) == 'Test Wiki:Request for permissions' then
		m_body_a = m_body_a .. '{| style="width: 100%; border: 3px double #662; padding: .3em; background-color: darkgreen; color: #EEE"\n| colspan="3" style="background-color: #888" align="center" | ' .. "'''Request for permissions'''" .. '\n|-\n|<center>You can request administrator, bureaucrat, or other permissions below. You must already be an administrator to be eligible for bureaucrat permissions. Interface administrator rights can only be granted by the stewards and are only given to highly trusted users. Non-steward suppressor rights may be requested here, but two stewards must support your request. However, the right is only granted to trusted users for non-test reasons. Otherwise, please request suppression rights at the [[Test Wiki:Community portal|Community portal]]. All rights will be removed after 3 months of [[Test Wiki:Inactivity policy|<span style="color:#FFFFFF; text-decoration:underline">inactivity</span>]].<br/>\nOther Permissions: Bot,  translate administrator, interwiki admin,  autopatrol,  <br>\nFor Steward or System Administrator, a vote should take place on the [[Test_Wiki:Community_portal|<span style="color:#FFFFFF; text-decoration:underline">community portal</span>]].<br/>\nBureaucrats, you can use the [[Special:Preferences#mw-prefsection-gadgets|<span style="color:#FFFFFF; text-decoration:underline">userRightsManager gadget</span>]] to easily handle requests.\n<br/><small>Please note that you should make a confirmation edit, then link to the diff on the other wiki, when specifying cross-project accounts.</small>\n</center>' .. m_body_b ..'\n' .. '|-\n' .. '|colspan="3" style="background-color: #457645" align="center"|[[File:Red pencil.svg|25px|link=' .. mw.title.new('Request for permissions/Archive ' .. m_i , 4):fullUrl( 'action=edit&summary=' .. m_summary ) .. ']][[Test Wiki:Request for permissions/Archive ' .. m_i .. '|<span style="color:#FFFFFF; text-decoration:underline">Archive ' .. m_i .. '</span>]]\n|-\n|colspan="3" style="background-color: #457645" align="center"|[[File:Icons8 flat plus.svg|25px|link=' .. mw.title.new('Request for permissions/Archive ' .. ( m_i + 1 ) , 4):fullUrl( 'action=edit&preload=Test+Wiki%3ARequest+permissions&summary=' .. m_summary ) .. ']]<span class="plainlinks">[' .. mw.title.new( 'Request for permissions/Archive ' .. ( m_i + 1 ), 4 ):fullUrl( 'action=edit&preload=Test+Wiki%3ARequest+permissions&summary=' .. m_summary ) .. ' <span style="color:#FFFFFF; text-decoration:underline">Archive ' .. ( m_i + 1 ) .. '</span> ]</span>\n|-\n| width="97px" style="padding:1px; padding-left:2px;" | <center>' .. "'''Click the '''Request rights''' button to request  permissions'''" .. '</center>\n|-\n|' .. frame:callParserFunction{ name = '#tag:inputbox', args = { 'type=comment\nbuttonlabel= Request rights \nsummary= Request rights\npreload= Template:RfP preload\npage=Test Wiki:Request for permissions\ndefault=Test Wiki:Request for permissions\nhidden=yes' } } .. '\n|}'
	else
		m_body_a = m_body_a .. '{| style="width: 100%; border: 3px double #662; padding: .3em; background-color: darkgreen; color: #EEE"\n| colspan="3" style="background-color: #888" align="center" | ' .. "'''Request for permissions archives'''" .. '\n|-\n|\n' .. m_body_b .. '\n|-\n|colspan="3" style="background-color: #457645" align="center"|[[File:Human-folder.png|25px|link=Test Wiki:Request for permissions/Archive ' .. m_i .. ']][[Test Wiki:Request for permissions/Archive ' .. m_i .. '|<span style="color:#FFFFFF; text-decoration:underline">Archive ' .. m_i .. '</span>]]\n|-\n| width="97px" style="padding:1px; padding-left:2px;" | <center>' .. "'''This page shows an archive of handled requests'''" .. '</center>\n|-\n|width="97px" style="padding:1px; padding-left:2px;" | <center>To request Administrator, Bureaucrat, or Interface Administrator, please go back to [[Test Wiki: Request for permissions|the main page]] and follow the instructions to request rights.</center>\n|-\n|' .. frame:callParserFunction{ name = '#tag:inputbox', args = { 'type=comment\nbuttonlabel= Main Page\nsummary=\npreload=\npage=Test Wiki:Request for permissions\ndefault=Test Wiki:Request for permissions\nhidden=yes' } } .. '\n|}\n' .. frame:expandTemplate{ title = 'Archive ' }
	end
	return m_body_a .. '__TOC__'
end
function p.Test( frame )
	return 
end
return p