Module:FrontpageWeaponList

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 = 'Weapons', 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-weapon-outer') for _, weapon in ipairs(list) do		h.printWeapon(output, weapon) end return output end

function h.printWeapon(output, weapon) local div = output:tag('div') :addClass('frontpage-weapon-item') :attr('data-display', weapon) :wikitext((''):format(weapon, weapon)) h.printWeaponName(div, weapon) end

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

return p