Anonymous user
Module:Protection banner: Difference between revisions
more data table restructuring, plus some fiddling around with the category name function; this is a progress save, so the code is horribly broken at the moment
Enwikipedia>Mr. Stradivarius (add some more blurbs) |
Enwikipedia>Mr. Stradivarius (more data table restructuring, plus some fiddling around with the category name function; this is a progress save, so the code is horribly broken at the moment) |
||
Line 9:
cfg.reasons = {
blp = {
categoryOrder = 'reason',
banner = 'blp'
},
dispute = {
categoryOrder = 'reason',
banner = 'dispute'
},
office = {
categoryOrder = 'reason',
banner = 'office'
},
sock = {
categoryOrder = 'reason',
banner = 'sock'
},
usertalk = {
banner = 'usertalk'
},
vandalism = {
categoryOrder = 'namespace',
}▼
}
cfg.banners = {
-- $1 = "until" or "or until" depending on the expiry
-- $2 = "disputes", with or without a section link
blp = {
},
dispute = {
text = '$1 editing $2 have been resolved',
dispute = true
},
office = {
},
sock = {
},
usertalk = {
text = '',
explanation = 'If you cannot edit this user talk page and you need to'
.. ' make a change or leave a message, you can'
.. ' [[Wikipedia:Requests for page protection#'
.. 'Current requests for edits to a protected page|request an edit]],'
.. ' [[Wikipedia:Requests for page protection#'
.. 'Current requests for reduction in protection level|request unprotection]],'
.. ' [[Special:Userlogin|log in]],'
.. ' or [[Special:UserLogin/signup|create an account]].'
},
vandalism = {
text = 'due to [[Wikipedia:Vandalism|vandalism]]',
▲ iconReason = 'due to vandalism'
},
▲}
}
Line 158 ⟶ 186:
end
function p.getCategoryName(cats,
--[[
-- Gets a category name from the category table, given a combination of
Line 172 ⟶ 200:
--]]
local properties = {
expiry = {pos = 5, val = expiry},
namespace = {'namespace', pos = 3, val = p.matchNamespace(namespace)},
reason = {pos = 4, val = reason},
level = {pos = 2, val =
action = {pos = 1, val =
}
Line 186 ⟶ 214:
-- vandalism categories if they were available.
--]]
local
if not reason then
else
end
if
toTableEnd(properties, 2) -- move namespace to end
elseif
toTableEnd(properties, 3) -- move reason to end
else
|