Content deleted Content added
HouseBlaster (talk | contribs) save a WIP |
HouseBlaster (talk | contribs) save a WIP |
||
(2 intermediate revisions by the same user not shown) | |||
Line 175:
-- Add the protection level
if yesno(args.protection, true) or yesno(args.aeprotection, true) then
local protectionLevel = (currentTitleObject.subjectPageTitle.protectionLevels["edit"] or {nil})[1] -- the or {nil} allows a graceful fail if the subjectPage does not (yet) exist
if protectionLevel then
-- we have a |protection=foo parameter, and the page is protected
Line 261:
end
-- check for a superTopic (e.g. South Asia is the superTopic of Indian military history)
local superTopic =
if superTopic ~= '' then
-- we have a superTopic, so explain that
Line 310:
local subtopicBlurb = getSubtopicBlurb(theCTOP)
if subtopicBlurb ~= '' then
addToMessage(' to <b>' .. subtopicBlurb .. '</b>, ' .. ' part of the contentious topic designation for ' .. makeSubtopicCompleteBlurb(theCTOP))
else
Line 331 ⟶ 330:
-- TODO: refactor makeTopicBulletPoint into a more versitile function, allowing it to be called here
addToMessage('<b>')
local superTopic =
if superTopic ~= '' then
addToMessage(getSubtopicBlurb(completeTopics[1]) .. '</b>, part of the contentious topic designation for ' .. makeSubtopicCompleteBlurb(completeTopics[1]))
else
Line 361 ⟶ 360:
-- There's only one topic and scope, so this loop only runs once
for topic, scope in pairs(partialTopics) do
if superTopic ~= '' then
addToMessage('<b>' .. getSubtopicBlurb(topic) .. '</b>')
else
addToMessage('<b>' .. getTopicBlurb(topic) .. '</b>')
end
if yesno(scope, nil) == nil then
-- the scope is not a boolean value, so we have a free-text explanation of the applicable parts
addToMessage(', in particular the parts about <b>' .. scope .. '</b>')
end
if superTopic ~= '' then
addToMessage('. This is a subtopic of
else
addToMessage('.</p>')
Line 433 ⟶ 436:
messageBox = messageBoxModule.main("tmbox", {
["type"] = underRestrictions and "delete" or "content",
["image"] = "[[File:Commons-emblem-"
.. (underRestrictions and "hand" or "issue")
.. ".svg|40px]]",
["text"] = messageBody
})
Line 454:
["class"] = "nonextendedconfirmed-show ECR-edit-request-warning",
["style"] = "background: var(--background-color-destructive-subtle, #ffe9e5); border-color: var(--border-color-destructive, #f54739); color: var(--color-base, #202122);",
["image"] = "[[File:Commons-emblem-hand.svg|
}).. messageBox
end
Line 487:
addKnownParameter('relatedcontent')
addKnownParameter('section')
-- then add all of the partialTopics section parameters
for code, _ in pairs(partialTopics) do
|