Module:FrontpageAgentList

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 = 'Agents', where = nil, 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-agent-outer') for _, agent in ipairs(list) do		h.printAgent(output, agent) end return output end

function h.printAgent(output, agent) local div = output:tag('div') :addClass('frontpage-agent-item') :attr('data-display', agent) :wikitext((''):format(agent, agent)) h.printAgentName(div, agent) end

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

return p