Module:FrontpageChampionList

local util_args = require('Module:ArgsUtil') local util_cargo = require('Module:CargoUtil') local util_vars = require('Module:VarsUtil')

local h = {}

local p = {} function p.main(frame) local args = util_args.merge(true) return h.makeOutput(util_cargo.getOrderedList(h.getQuery, 'Name')) end

function h.getQuery local ret = { tables = 'Champions', where = 'IsActive="1"', fields = 'Name', limit = 9999, orderBy = 'Name', }	util_vars.logObject(ret) return ret end

function h.makeOutput(list) local output = mw.html.create('div') :addClass('frontpage-champion-outer') for _, champion in ipairs(list) do		h.printChampion(output, champion) end return output end

function h.printChampion(output, champion) local div = output:tag('div') :addClass('frontpage-champion-item') :attr('data-display', champion) :wikitext((''):format(champion, champion)) h.printChampionName(div, champion) end

function h.printChampionName(div, champion) div:tag('div') :addClass('frontpage-caption') :wikitext(('%s'):format(champion)) end

return p