local p =
--If the latest FAR failed--If currentstatus is FA or FL
> Error--Else
if result
'REMOVED' or result
'REMOVE' or result
'FA' and status
'FFA/GA' or args['small']
function p.statusFAC(args) local row = mw.html.create row :tag('tr') :addClass('error') :tag('td') :addClass('mbox-image') :done :tag('td') :addClass('mbox-text') :wikitext("Use the template to nominate an article for Featured article status; " .. "this simplifies the nomination procedure. A bot will add the details to the ArticleHistory template when the FAC process is closed.") :done :done table.insert(p.errors, '') return tostring(row)end
function p.statusFFAC(args) local row = mw.html.create if args['small']
function p.statusFA(args) local row = mw.html.create for i=20, 1, -1 do if args["action".. i] and mw.ustring.upper(args["action".. i])
'yes' then iconsize = 30 else iconsize = 48 end row :tag('tr') :tag('td') :addClass('mbox-image') :wikitext("") :done :tag('td') :addClass('mbox-text') :wikitext(""..p.title.prefixedText .. " is a featured article; " .. "it (or a previous version of it) has been identified " .. "as one of the best articles produced by the Wikipedia community. " .. "Even so, if you can update or improve it, please do so.") table.insert(p.includeonly, "") return tostring(row)end
function p.statusFAR(args) local row = mw.html.create row :tag('tr') :addClass('error') :tag('td') :addClass('mbox-image') :done :tag('td') :addClass('mbox-text') :wikitext("Use the template to nominate an article for Featured article status; " .. "this simplifies the nomination procedure. A bot will add the details to the ArticleHistory template when the FAR process is closed.") table.insert(p.errors, "") return tostring(row)end
function p.statusFFLC(args) if args['small']
function p.statusFL(args) local row = mw.html.create for i=20, 1, -1 do if args["action".. i]
'yes' then iconsize = 30 else iconsize = 48 end row :tag('tr') :tag('td') :addClass('mbox-image') :wikitext("") :done :tag('td') :addClass('mbox-text') :wikitext(""..p.title.prefixedText .. " is a featured list, " .. "which means it has been identified as one of the best lists produced by the Wikipedia community. " .. "If you can update or improve it, please do so.") table.insert(p.includeonly, "") return tostring(row)end
function p.statusFFL(args) local row = mw.html.create if args['small']
function p.statusGA(args, gatopic) local row = mw.html.create if string.len(gatopic) > 0 then topiclink = '/' .. gatopic else topiclink = end
if args['currentstatus']
'yes' then iconsize = 30 else iconsize = 40 end
row :tag('tr') :tag('td') :addClass('mbox-image') :wikitext("") :done :tag('td') :addClass('mbox-text') :wikitext(""..p.title.prefixedText .. " has been listed as one of the " ..gatopic.."good articles " .. "under the good article criteria. If you can improve it further, please do so. " .. "If it no longer meets these criteria, you can reassess it.") if p.title:inNamespace("Talk") then table.insert(p.includeonly, "") if gatopic then table.insert(p.includeonly,"") else table.insert(p.includeonly, "|") end end return tostring(row)end
function p.statusFGAN(args, gatopic) local row = mw.html.create if args['small']
function p.statusDGA(args, gatopic) local row = mw.html.create if args['small']
function p.statusFFT(args) local row = mw.html.create if args['small']
function p.statusFFTC(args) local row = mw.html.create if args['small']
function p.statusFPO(args) local row = mw.html.create if args['small']
function p.statusFFPO(args) local row = mw.html.create if args['small']
function p.statusFFPOC(args) local row = mw.html.create if args['small']
function p.statusInvalid(args) local row = mw.html.create row :tag('tr') :addClass('error') :tag('td') :addClass('mbox-image') :done :tag('td') :addClass('mbox-text') :wikitext("Please do not use " .. args['currentstatus'] .." as a currentstatus parameter: " .. "these assessments are the responsibility of individual WikiProjects.") table.insert(p.errors, "") return tostring(row)end
function p.statusUnknown(args) local row = mw.html.create row :tag('tr') :addClass('error') :tag('td') :addClass('mbox-image') :wikitext("") :done :tag('td') :addClass('mbox-text') :wikitext("Unknown current status!") :done :done table.insert(p.errors, "") return tostring(row)end
function p.statusFT(args) local isFA = false if args['ftname'] then if p.featuredTopicSum(args['ftname']) then isFA = true elseif args['ft2name'] then if p.featuredTopicSum(args['ft2name']) then isFA = true elseif args['ft3name'] then if p.featuredTopicSum(args['ft3name']) then isFA = true elseif args['ft4name'] then if p.featuredTopicSum(args['ft4name']) then isFA = true end end end end end
if args['small'] then iconsize = 30 else iconsize = 48 end
if isFA then image = '' else image = '' end local row = mw.html.create:tag('tr') :tag('td') :addClass('mbox-image') :wikitext(image) :done local cell = row:tag('td') :addClass('mbox-text')
:wikitext(""..p.title.prefixedText .. " is ") if (args['ftmain']
if (args['ft2name']) then cell:wikitext('It is also ') if (args['ft2main']
if (args['ft3name']) then cell:wikitext('It is also ') if (args['ft3main']
if (args['ft4name']) then cell:wikitext('It is also ') if (args['ft4main']
if args['ft2name'] then cell:wikitext('These are ') else cell:wikitext('This is ') end cell:wikitext("identified as among the best series of articles produced by the Wikipedia community. If you can update or improve ") if args['ft2name'] then cell:wikitext('them') else cell:wikitext('it') end cell:wikitext(", please do so.")
-- Categories if args['currentstatus']
elseif args['currentstatus']
'FFA/GA' or args['currentstatus']
if p.featuredTopicSum(args['ftname']) then if args['ftmain']
'yes' then table.insert(p.includeonly,'') else table.insert(p.includeonly,'') end end
if args['ft2name'] then if p.featuredTopicSum(args['ft2name']) then if args['ft2main']
'yes' then table.insert(p.includeonly,'') else table.insert(p.includeonly,'') end end end if args['ft3name'] then if p.featuredTopicSum(args['ft3name']) then if args['ft3main']
local text = "This article " if lang:formatDate('Ymd', args['maindate']) < lang:formatDate('Ymd') then text = text .. "appeared" elseif lang:formatDate('Ymd', args['maindate']) > lang:formatDate('Ymd') then text = text .. "will appear" else text = text .. "is currently" end
text = text .. " on Wikipedia's Main Page as Today's featured " .. mptype .. "" if lang:formatDate('Ymd', args['maindate']) ~= lang:formatDate('Ymd') then text = text .. " on " .. lang:formatDate('F j, Y',args['maindate']) end text = text .. "." row:tag('td') :addClass('mbox-text') :wikitext(text) if args['currentstatus']
'FL' then table.insert(p.includeonly, "") end
return tostring(row)end
function p.historyheader(args) local status = args['currentstatus'] local images = "" if status
'NA' or not status then images = images .. ('') end if args['dykdate'] then images = images .. ('') end if args['itndate'] then images = images .. ('') end if args['otddate'] then images = images .. ('') end if args['aciddate'] then images = images .. ('') end if args['loceNotAnActiveOption'] then images = images .. ('') end if args['v1.0NotAnActiveOption'] then images = images .. ('') end local header = mw.html.create('tr') :tag('th') :attr('colspan', 3) :attr('style', 'font-size:110%') :tag('span') :attr('style', 'float:left') :wikitext(images) :done if status
'FFLC' or status
return header:allDoneend
function p.historyoutput(action, date, link, result, oldid, args) local output = mw.html.create:tag('tr') if action then action = mw.ustring.upper(action) end if result then result = mw.ustring.lower(result) end --Date local datecell = output:tag('td') if oldid then datecell:tag('span') :addClass('plainlinks') :wikitext('['.. p.title:fullUrl('oldid='..oldid)) if date then datecell:wikitext(' ' .. mw.language.getContentLanguage:formatDate('F j, Y', date)) else datecell:wikitext(' ?') table.insert(p.errors, [[Category:ArticleHistory error]]) end datecell:wikitext(']') datecell:done else if date then datecell:wikitext(mw.language.getContentLanguage:formatDate('F j, Y', date)) else datecell:wikitext(' ?') table.insert(p.errors,) end end output:done
--Process if link
"" then link = tostring(p.title.talkPageTitle) end local processcell = output:tag('td'):wikitext("") if action 'FAC' then processcell:wikitext('Featured article candidate') elseif action
'FAR' or action
'BP' then processcell:wikitext('Brilliant prose') elseif action
'PR' then processcell:wikitext('Peer review') elseif action
"Approved" or result
"Approved version" or result
'WPR' and (result
"copyedit" or result
"copyedited" or result
"proofread") then processcell:wikitext('Guild of Copy Editors') elseif action
"COTW" or result
"Cotw" or result
"Collaborated" or result
"Collaboration" or result
'WPR' and (result
"maindate") then processcell:wikitext("Today's featured article") elseif action
'WAR' then processcell:wikitext("WikiProject A-class review") elseif action
'GAC' then processcell:wikitext("Good article nominee") elseif action
'MFD' then processcell:wikitext("Miscellanea for deletion") elseif action
'IFD' then processcell:wikitext("Images for deletion") elseif action
'CSD' then processcell:wikitext("Candidate for speedy deletion") elseif action
'DRV' then processcell:wikitext("Deletion review") elseif action
'FTR' then processcell:wikitext("Featured topic removal candidate") elseif action
'GTR' then processcell:wikitext("Good topic removal candidate") elseif action
'FLR' then processcell:wikitext("Featured list removal candidate") elseif action
'FPOR' then processcell:wikitext("Featured portal review") end
processcell:wikitext("
") output:done--Result local resultcell = output:tag('td')
if action
'FLC' or action
'GTC' or action
'pass' or result
'promoted' then resultcell:wikitext('Promoted') elseif result
'failed' or result
'FAR' or action
'FLR' or action
'GTR' or action
'pass' or result
'keep' or result
'FAR' or action
'fail' or result
'remove' or result
'demoted' then resultcell:wikitext('Demoted') elseif result
'merge' then resultcell:wikitext('Merged') else resultcell:wikitext('?') table.insert(p.errors,) end elseif action
'pass' or result
'kept' then resultcell:wikitext('Kept') elseif result
'failed' or result
'removed' or result
'BP' then if result
'promoted' or result
'nom' then resultcell:wikitext('Nominated') else resultcell:wikitext('?') table.insert(p.errors,) end elseif action
'GAC' then if result
'passed' or result
'listed' then resultcell:wikitext('Listed') elseif result
'failed' or result
'not listed' then resultcell:wikitext('Not liseted') else resultcell:wikitext('?') table.insert(p.errors,) end elseif action
'pass' or result
'keep' or result
'fail' or result
'delisted' then resultcell:wikitext('Delisted') elseif result
'not listed' then resultcell:wikitext('Not listed') else resultcell:wikitext('?') table.insert(p.errors,) end elseif action
'AFD' or action
'IFD' or action
'PROD' then if result
'keep' or result
'delete' or result
'merged' or result
'no consensus' then resultcell:wikitext('No consensus') elseif result
'speedily kept' then resultcell:wikitext('Speedily kept') elseif result
'speedily deleted' then resultcell:wikitext('Speedily deleted') elseif result
'redirected' then resultcell:wikitext('Redirected') elseif result
'renamed' or result
'moved' then resultcell:wikitext('Renamed') else resultcell:wikitext('?') table.insert(p.errors,) end
elseif action
'endorse' or result
'relisted' or result
'overturn' or result
'no consensus' then resultcell:wikitext('No consensus') else resultcell:wikitext('?') table.insert(p.errors,) end
elseif action
'not reviewed' then resultcell:wikitext('Not reviewed') else resultcell:wikitext('Reviewed') end
elseif action
'approved' or result
'copyedit' or result
'proofread' then resultcell:wikitext('Copyedited') elseif result
'cotw' or result
'collaboration' then resultcell:wikitext('Collaborated') elseif result
'not reviewed' then resultcell:wikitext('Not reviewed') else resultcell:wikitext('Reviewed') end
elseif action
'pass' or result
'approved' then resultcell:wikitext('Approved') elseif result
'failed' or result
'not reviewed' then resultcell:wikitext('Not approved') elseif result
then resultcell:wikitext('Reviewed') elseif result
'kept' then resultcell:wikitext('kept') elseif result
'demoted' then resultcell:wikitext('Demoted') else resultcell:wikitext('?') table.insert(p.errors,) end else resultcell:wikitext('?') table.insert(p.errors,) end output:done:done
--Categories if action
'FARC' then if result
'failed' or result
'removed' or result
'merged' or result
'FA' or args['currentstatus']
'RBP' then if result
'failed' or result
'removed' or result
'GAN' or action
'fail' or result
'not promoted' or result
'FA' or args['currentstatus']
'FFA' or args['currentstatus']
else table.insert(p.category, '') end end elseif action
'fail' or result
'delisted' then if args['currentstatus']
'GA' or args['currentstatus']
else table.insert(p.category, '') end end elseif action
'fail' or result
'remove' or result
'demoted' or result
'merge' then if args['currentstatus']
'PR' then table.insert(p.category, '') end return outputend
function p.milestoneDYK(args) local td = mw.html.create('tr') local row = td if args['action1'] then row = row:tag('td') :attr('colspan', '3') :attr('width', '100%') if args['dykentry'] then row = row:tag('table') :addClass('collapsible collapsed') :attr('style', 'margin: 0; padding: 0; border-collapse: collapse; width: 100%; background: transparent') :tag('tr') :tag('th') :attr('style', 'font-weight: normal; text-align: left; width: 100%') end row = row:wikitext(' ') else row = row:tag('td') :addClass('mbox-image') :wikitext('') :done if args['dykentry'] then row = row:tag('td') :addClass('mbox-text') :tag('table') :addClass('collapsible collapsed') :attr('style', 'margin: 0; padding: 0; border-collapse: collapse; width: 100%; background: transparent') :tag('tr') :tag('th') :attr('style', 'font-weight: normal; text-align: left; width: 100%') else row = row:tag('td') :addClass('mbox-text') end end local lang = mw.language.getContentLanguage local text if mw.title.makeTitle('Wikipedia', 'Recent additions/' .. lang:formatDate('Y/F#j F Y', args['dykdate'])).exists then text = "A fact from this article" else text = "A fact from this article" end text = text .." appeared on Wikipedia's Main Page in the \"Did you know?\" column on ".. lang:formatDate('F j, Y',args['dykdate']) if args['dykdate2'] then text = text .. ', and on '.. lang:formatDate('F j, Y',args['dykdate']) end text = text .. '.' row = row:wikitext(text) if args['dykentry'] then row = row:done:done :tag('tr') :tag('td') :attr('style', 'border: 1px silver solid') :wikitext("The text of the entry was: Did you know " .. args['dykentry'].."") :done:done:done elseif args['action1'] then row:done end if args['action1'] then row:done end row:done
if args['currentstatus']
FL then table.insert(p.includeonly, '') elseif args['currentstatus']
'GA' then table.insert(p.includeonly, '') else table.insert(p.includeonly, '') end
return row:allDoneend
function p.milestoneITN(args) local lang = mw.language.getContentLanguage table.insert(p.category,"") local mboximage = "" local text = "A news item involving this article was featured on Wikipedia's Main Page in the \"In the news\"" if args['itnlink'] then text = text .. " column" else text = text .. " column" end text = text .. " on " .. lang:formatDate('F j, Y', args['itndate']) if args['itndate2'] then text = text .. ", and on " .. lang:formatDate('F j, Y', args['itndate2']) end text = text .. '.'
local row = mw.html.create('tr') if args['action1'] then row:tag('td') :attr('colspan', '3') :wikitext(mboximage .. " " .. text) else row:tag('td') :addClass('mbox-image') :wikitext(mboximage) :done :tag('td') :addClass('mbox-text') :wikitext(text) end return rowend
function p.milestoneOTD(args) local lang = mw.language.getContentLanguage table.insert(p.category, "") local mboximage = "" local text = "A fact from this article was featured on Wikipedia's Main Page in the \"On this day...\"" if args['otdlink'] then text = text .. " column" else text = text .. " column" end text = text .. " on " .. lang:formatDate('F j, Y', args['otddate']) if args['otddate2'] then text = text .. ", and on " .. lang:formatDate('F j, Y', args['otddate2']) end text = text .. '.'
local row = mw.html.create('tr') if args['action1'] then row:tag('td') :attr('colspan', '3') :wikitext(mboximage .. " " .. text) else row:tag('td') :addClass('mbox-image') :wikitext(mboximage) :done :tag('td') :addClass('mbox-text') :wikitext(text) end return rowend
function p.milestoneACID(args) local lang = mw.language.getContentLanguage local mboximage = "" local text = "This article was on the Article Collaboration and Improvement Drive for the week of " .. lang:formatDate('F j, Y', args['aciddate']) .. '.'
local row = mw.html.create('tr') if args['action1'] then row:tag('td') :attr('colspan', '3') :wikitext(mboximage .. " " .. text) else row:tag('td') :addClass('mbox-image') :wikitext(mboximage) :done :tag('td') :addClass('mbox-text') :wikitext(text) end return rowend
function p.milestoneLoC(args) local mboximage = "" local text = "This article, or a portion of it, was copyedited by the League of Copyeditors."
local row = mw.html.create('tr') if args['action1'] then row:tag('td') :attr('colspan', '3') :wikitext(mboximage .. " " .. text) else row:tag('td') :addClass('mbox-image') :wikitext(mboximage) :done :tag('td') :addClass('mbox-text') :wikitext(text) end return rowend
function p.currentstatus(args) local row = mw.html.create local statuses =
local currentstatus = false for i=2, 20, 1 do if args['action'..i] then currentstatus = true end end if currentstatus then local td = row:tag('tr'):tag('td') :attr('colspan', '3') if statuses[args['currentstatus']] then td:wikitext("Current status: " .. statuses[args['currentstatus']] .. "") if args['currentstatus']
"FL" or args['currentstatus']
"GA" then if args['gacat'] then td:wikitext(" (" .. args['gacat'] .. ")") end end else td:wikitext("Current status: ?") end elseif args['action1']
function p.fourawardtest(args, status) -- If article has not yet been tested for if args['four'] then return false end -- If article has been on DYK if not args['dykdate'] then return false end -- If article is currently FA if status ~= FA then return false end -- If successful GAN is anywhere in the history for i=1, 20, 1 do if args['action'..i] and mw.ustring.upper(args['action' .. i])
'listed' then return true end end end --No successful GAN in history return falseend
function p._articlehistory(args, frame) local status = args['currentstatus'] local gatopic = frame:expandTemplate if status then status = mw.ustring.upper(args['currentstatus']) end
local tbl = mw.html.create('table')
tbl :addClass('tmbox') :addClass('tmbox-notice')
if args.small
--Sorting current status --FFA check based on most recent FAR (if there is one) for i=20, 1, -1 do if args["action".. i] and mw.ustring.upper(args["action".. i])
if status
'FAC' then tbl:node(p.statusFAC(args)) elseif status
'FACFAILED' then tbl:node(p.statusFFAC(args)) elseif status
'FAR' then tbl:node(p.statusFAR(args)) elseif status
'FL' then tbl:node(p.statusFL(args)) elseif status
'FFA/GA' or status
'FGAN' or status
'DGA' or status
'FFT' then tbl:node(p.statusFFT(args)) elseif status
'FPO' then tbl:node(p.statusFPO(args)) elseif status
'FFPOC' then tbl:node(p.statusFFPOC(args)) elseif status
'STUB' or status
'A' then tbl:node(p.statusInvalid(args)) elseif status
'NA' or status
then --do nothing if no status selected else tbl:node(p.statusUnknown(args)) end
if args['ftname'] then tbl:node(p.statusFT(args)) end if args['maindate'] then tbl:node(p.milestoneMainPage(args)) --If the article is an FA or FL but has not been on the main page, add it to a category elseif status
'FL' then table.insert(p.category,"") end --Article milestones local history = tbl if args['action1'] then history = history:tag('tr') :tag('td') :attr('colspan', 2) :attr('style', 'width: 100%;') :tag('table') :attr('style','width:100%; background:transparent; font-size:90%') :addClass('AH-milestones')
if args['action2'] or args['dykdate'] or args['itndate'] or args['otddate'] or args['aciddate'] or args['loceNotAnActiveOption'] then history:addClass('collapsible collapsed') history:node(p.historyheader(args)) history:tag('tr') :attr('style', 'text-align: left') :tag('th'):wikitext('Date'):done :tag('th'):wikitext('Process'):done :tag('th'):wikitext('Result'):done end
for i=1, 20, 1 do if args['action'..i] then history:node(p.historyoutput(args['action'..i], args['action'..i..'date'], args['action'..i..'link'], args['action'..i..'result'], args['action'..i..'oldid'], args)) elseif args['action'..i..'date'] or args['action'..i..'link'] or args['action'..i..'result'] or args['action'..i..'oldid'] then table.insert(p.errors, '') end end end if args['dykdate'] then history:node(p.milestoneDYK(args)) end if args['four'] and mw.ustring.lower(args['four'])
"" then table.insert(p.errors, "") end end if status
"GA" then if args['gacat']
'bands' then table.insert(p.includeonly, "") elseif args['gacat']
'musicians' then table.insert(p.includeonly, "" .. "") elseif args['gacat']
'royalty' then table.insert(p.includeonly, "" .. "") elseif args['gacat']
"" then else table.insert(p.errors, "") end if p.fourawardtest(args, status) then table.insert(p.includeonly, "") end end return tostring(tbl) .. table.concat(p.category) .. table.concat(p.includeonly) .. table.concat(p.errors)end
function p.articlehistory(frame) local pframe = frame:getParent
local args = ; for k, v in pairs(pframe.args) do args[k] = v; end for k, v in pairs(frame.args) do args[k] = v; end
return p._articlehistory(args, frame)end
return p