Module:Update: Difference between revisions
mNo edit summary |
Tag: Undo |
||
| Line 277: | Line 277: | ||
-- [[Template:Patch Notes]] | -- [[Template:Patch Notes]] | ||
function p.patchnotes(frame) | function p.patchnotes(frame) | ||
local function qfclink(qfc) | |||
return 'https://www.geministation.com/patch-notes' .. string.gsub(qfc, '%-', ',') | |||
end | |||
local a = frame:getParent().args | |||
local cat = '' | |||
local div = mw.html.create('div') | |||
:addClass('official patchnote') | |||
:done() | |||
local link | |||
if hc(a.qfc) then | |||
if a.qfc == 'no' then | |||
link = 'the patch note page' | |||
elseif a.qfc == 'none' then | |||
link = '' | |||
else | |||
link = '[' .. qfclink(a.qfc) .. ' this forum thread]' | |||
end | |||
else | |||
link = '(QFC missing)' | |||
cat = cat .. '[[Category:Missing patch notes QFC]]' | |||
end | |||
local newspostlink | |||
if hc(a.link) then | |||
newspostlink = '['..a.link..' this news post]' | |||
end | |||
local date_link | |||
local day, month, year = '', '', '' | |||
if hc(a.date) then | |||
day = lang:formatDate('j', a.date) | |||
month = lang:formatDate('F', a.date) | |||
year = lang:formatDate('Y', a.date) | |||
date_link = string.format('[[%s %s]] [[%s]]', day, month, year) | |||
else | |||
date_link = '(missing date)' | |||
end | |||
if hc(a.author) then | |||
date_link = date_link .. ' by ' .. a.author | |||
end | |||
if hc(a.rev) then | |||
date_link = date_link .. ', and revised on ' .. lang:formatDate('[[j F]] [[Y]]', a.rev) | |||
end | |||
if hc(link) and hc(newspostlink) then | if hc(link) and hc(newspostlink) then | ||
div:wikitext('These official [[Patch Notes]] are copied verbatim from ' .. link .. ' of the ') | div:wikitext('These official [[Patch Notes]] are copied verbatim from ' .. link .. ' of the ') | ||