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

Content deleted Content added
refactor
save a WIP
Line 208:
end
local function getSuptopicBlurbgetSubtopicBlurb(code)
return callFromListTemplate(code, 'subtopic')
end
Line 215:
local function getSupertopic(code)
return callFromListTemplate(code, 'supertopic')
end
local function makeSubtopicCompleteBlurb(code)
local topicSubpage = callFromListTemplate(code, 'topic-subpage')
return '<b>' .. '[[' .. topicSubpage ..'|'
.. mw.ustring.gsub(topicSubpage, 'Wikipedia:Contentious topics/', '')
.. ']]</b>.'
end
Line 248 ⟶ 256:
return def and ('* <b>' .. def .. '</b>\n') or ''
end
--[[
Line 279 ⟶ 288:
theCTOP = completeTopics[1]
end
local suptopicBlurbsubtopicBlurb = getSuptopicBlurbgetSubtopicBlurb(theCTOP)
if suptopicBlurbsubtopicBlurb ~= '' then
addToMessage('local totopicSubpage <b>'= .. suptopicBlurb .. '</b>, part of the contentious topic designation for <b>' .. getTopicBlurbcallFromListTemplate(callFromListTemplate(theCTOP, 'supertopic')) .., '</b>.topic-subpage')
addToMessage(' to <b>' .. subtopicBlurb .. '</b>, ' .. ' part of the contentious topic designation for ' .. makeSubtopicCompleteBlurb(theCTOP))
else
addToMessage(' to <b>' .. getTopicBlurb(theCTOP) .. '</b>, a contentious topic.')
Line 297 ⟶ 307:
local superTopic = callFromListTemplate(completeTopics[1], 'supertopic')
if superTopic then
addToMessage(', part of the contentious topic designation for <b>' .. getTopicBlurbmakeSubtopicCompleteBlurb(superTopiccompleteTopics[1]) .. '</b>.</p>')
else
addToMessage(', a contentious topic.</p>')
Line 330 ⟶ 340:
end
local superTopic = callFromListTemplate(topic, 'supertopic')
if superTopic ~= '' then
addToMessage('. This is a subtopic of <b>' .. getTopicBlurbmakeSubtopicCompleteBlurb(superTopictopic) .. '</b>.</p>')
else
addToMessage('.</p>')