Module:Contentious topics/talk notice/sandbox: Difference between revisions

Content deleted Content added
save a WIP
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 = callFromListTemplategetSupertopic(code, 'supertopic')
if superTopic ~= '' then
-- we have a superTopic, so explain that
Line 310:
local subtopicBlurb = getSubtopicBlurb(theCTOP)
if subtopicBlurb ~= '' then
local topicSubpage = callFromListTemplate(callFromListTemplate(theCTOP, 'supertopic'), 'topic-subpage')
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 = callFromListTemplategetSupertopic(completeTopics[1], '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
addToMessage('<b>'local ..superTopic getTopicBlurb= getSupertopic(topic) .. '</b>')
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
local superTopic = callFromListTemplate(topic, 'supertopic')
if superTopic ~= '' then
addToMessage('. This is a subtopic of <b>' .. makeSubtopicCompleteBlurb(topic) .. '</b>.</p>')
else
addToMessage('.</p>')
Line 433 ⟶ 436:
messageBox = messageBoxModule.main("tmbox", {
["type"] = underRestrictions and "delete" or "content",
["small"] = yesno(args.small),
["image"] = "[[File:Commons-emblem-"
.. (underRestrictions and "hand" or "issue")
.. ".svg|40px]]",
.. (yesno(args.small) and "30" or "40")
.. "px]]",
["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|" .. (yesno(args.small) and "30" or "40") .. "px40px]]"
}).. messageBox
end
Line 487:
addKnownParameter('relatedcontent')
addKnownParameter('section')
 
addKnownParameter('small')
-- then add all of the partialTopics section parameters
for code, _ in pairs(partialTopics) do