Bu modül için bir belgeleme oluşturabilirsiniz: Modül:Unsigned/belge
local p = {}
function base( args )
local type = args.type or 'İmzasız'
local user = args.user
local date = args.date
if date and not date:find( '%(UTC%)$' ) then
date = date .. ' (UTC)'
end
local nowiki = ''
if mw.isSubsting() then
nowiki = '<nowiki/>'
end
local text = {
'<small>–Önceki ' .. mw.ustring.lower( type ) .. ' yorumu ',
'. Lütfen gönderinizi ~~' .. nowiki .. '~~ ile imzalayın</small>'
}
if date then
table.insert( text, 2, ' - ' .. date )
end
if user then
local userLinks
if not user:find( '[^:%x%.%d]' ) and require( 'Module:IPAddress' ).isIP( user ) then
userLinks = '[[Special:Contribs/' .. user .. '|' .. user .. ']] ([[User talk:' .. user .. '|mesaj]])'
else
userLinks = '[[User:' .. user .. '|' .. user .. ']] ([[User talk:' .. user .. '|mesaj]] • [[Special:Contribs/' .. user .. '|katkılar]])'
end
table.insert( text, 2, ' ekleyen ' .. userLinks )
end
return table.concat( text )
end
p.unsigned = function( f )
local args = require( 'Module:ProcessArgs' ).norm( f.args or f )
local type = args.type or 'İmzasız'
local user = args.user
local date = args.date
local category = { '<!-- Şablon:' .. type .. ' -->' }
if mw.isSubsting() then
-- Gerekli argümanı eksik olan değiştirmeye izin verme
if type == 'İmzasız' and not user then
local dateArg = ''
if date then
dateArg = '||' .. date
end
return '{{İmzasız' .. dateArg .. '}}'
elseif type == 'Tarihsiz' and not date then
return '{{Tarihsiz}}'
end
elseif mw.title:getCurrentTitle().namespace ~= 10 then
if type == 'tarihsiz' and not user then
table.insert( category, '[[Kategori:İmzasız şablon yanlış kullanıldı]]' )
elseif type == 'Tarihsiz' and not date then
table.insert( category, '[[Kategori:Tarihsiz şablon yanlış kullanıldı]]' )
end
table.insert( category, '[[Kategori:Değiştirme gerektiren şablonlara sahip sayfalar]]' )
end
return base( args ) .. table.concat( category )
end
p.auto = function( f )
if mw.isSubsting() or mw.title:getCurrentTitle().namespace == 10 then
local date = string.lower( f.args.date or f.date )
local args = {
user = f:preprocess( '{{safesubst:REVISIONUSER: {{safesubst:FULLPAGENAME}}}}' ),
date = f:preprocess( '{{safesubst:#timel:G:i, d F Y|{{safesubst:REVISIONTIMESTAMP: {{safesubst:FULLPAGENAME}} }}}}' )
}
if date == '1' or date == 'only' then
args.type = 'Tarihsiz'
args.user = nil
elseif date == '0' or date == 'none' then
args.date = nil
end
return base( args ) .. '<!-- Şablon:Otoİmzasız -->'
else
return '<span class="error">Şablon:Otoİmzasız değiştirilmelidir</span>[[Kategori:Otoİmzasız şablon yanlış kullanıldı]]'
end
end
return p