Content deleted Content added
Add GOCE categorization per TPER |
update from Module:Article history/config/sandbox per discussion at Template talk:Article history#DYK subpage parameter: minor clean; accept dyknom parameter for "fact from this article" link and put Recent_additions links in the dates |
||
Line 169:
-- dates contained in dateData (made with the makeDateData function).
-- The parameter $1 in the blurb will be replaced with the list of dates.
local function makeDateText(dateData, blurb, wantBold)
local bold = wantBold and "'''" or ""
local dates, doneLinks = {}, {}
for i, t in ipairs(dateData) do
local date
if t.link and not doneLinks[t.link] then
doneLinks[t.link] = true
else
end
dates[i] = bold .. date .. bold
end
local dateList = mw.text.listToText(dates, ', ', ', and ')
Line 184 ⟶ 187:
return {
-------------------------------------------------------------------------------
-- CONFIG TABLE START
Line 543 ⟶ 546:
-- Get the status ID. The status code is the code passed in from the
-- arguments, and the ID is the value contained in the config.
local statusCode = articleHistoryObj.args[articleHistoryObj.cfg.currentStatusParam]
local statusId = articleHistoryObj:getStatusIdForCode(statusCode)
Line 673 ⟶ 675:
data[#data + 1] = makeTopicData(args.ftname, args.ftmain)
if prefixArgs.ft then
for
if t[1] > 1 then -- we use args.ftname instead of args.ft1name
data[#data + 1] = makeTopicData(t.name, t.main, t[1])
Line 752 ⟶ 754:
local hasGoodLink = false
local text = {}
-- First topic
do
Line 840 ⟶ 842:
-- Topic-specific status categories
local function addTopicCats(catFormat)
for
addCat(string.format(catFormat, topic.name))
end
Line 854 ⟶ 856:
-- Importance categories
local hasTop, hasHigh, hasMid, hasLow -- These check for dupes
for
local cat, sort
if topic.status == 'FT' then
Line 927 ⟶ 929:
data.currentTimestamp = getYmdDate()
-- Whether the page is a list or not for the purposes of the Main
-- Page. The first Today's Featured List was on 13 June 2011, so
Line 1,861 ⟶ 1,863:
end,
makeData = function (articleHistoryObj)
return makeDateData(articleHistoryObj, 'dyk', {'entry', 'nom'})
end,
text = function (articleHistoryObj, collapsibleNoticeObj)
Line 1,868 ⟶ 1,870:
return nil
end
for _, t in ipairs(data) do
local raPage = 'Wikipedia:Recent additions/' .. getDate('Y/F#j F Y',
if not titleExists(raPage) then
raPage = 'Wikipedia:Recent additions'
▲ end
t.link = raPage▼
end
local
if data[1].nom then
▲ end
"''\"[[:Template:Did you know|Did you know?]]\"'' " ..▼
local blurb = "A " .. fact .. " appeared on " ..
"column on $1.",▼
"Wikipedia's [[Main Page]] in the " ..
▲ raPage
return makeDateText(data, blurb, true)
end,
collapsibleText = function (articleHistoryObj, collapsibleNoticeObj)
Line 1,896 ⟶ 1,902:
local entries = {}
local lastEntryDate
for
entries[#entries + 1] = t.entry
lastEntryDate = t.date
Line 1,908 ⟶ 1,914:
ctext[#ctext + 1] = 'The text of the entries was:\n'
local list = mw.html.create('ul')
for
if t.entry then
list:tag('li'):wikitext(string.format(
Line 1,962 ⟶ 1,968:
end
local dates = {}
for
local date = {}
if t.link then
Line 2,021 ⟶ 2,027:
end
local dates = {}
for
local date = {}
date.date = t.date
Line 2,028 ⟶ 2,034:
-- TODO: Move this inside the main module
local oldid = tonumber(t.oldid)
if oldid and
math.floor(oldid) == oldid and
oldid > 0 and
Line 2,067 ⟶ 2,073:
local data = collapsibleNoticeObj:getData(articleHistoryObj)
if data then
for
if t.link then
cats[#cats + 1] = Category.new(
Line 2,170 ⟶ 2,176:
elseif articleHistoryObj:getStatusId() == 'FA' then
local isDYK = false
for
if obj.id == 'DYK' then
isDYK = true
Line 2,177 ⟶ 2,183:
end
if isDYK then
for
if obj.id == 'GAN' and obj.resultId == 'listed' then
ret[#ret + 1] = Category.new('Possible Wikipedia four award articles')
|