How to Get Away with Murder Wiki
Advertisement
How to Get Away with Murder Wiki

Documentation for this module may be created at Module:Season/doc

local Season = {}
 -- This module handles formatting of seasons display in infoboxes, via the [[Template:Season]]

 -- Current number of seasons (changing it should automatically add/remove seasons to the display)
local seasoncount = 6

 -- Fonction d'affichage des icônes à appeler
function Season.display(frame)
 local stringBuilder = ""
 for i = 1, seasoncount do
  found = false
  for _, code in ipairs(frame.args) do
   if tonumber(code)==i then -- If the season number is present in the arguments
    stringBuilder = stringBuilder .. "[[Season "..i.."|S"..i.."]]"
    found = true
    break
   end
  end
  if not found then
   stringBuilder = stringBuilder .. "<s>S"..i.."</s>"
  end
  if i~=seasoncount then
   stringBuilder = stringBuilder .. " - "
  end
 end

 return stringBuilder
end

return Season
Advertisement