Module:UtilsKeywords

local p = {} local utilsCode = require("Module:UtilsCode") local utilsDisplay = require("Module:UtilsDisplay") local utilsIcons = require("Module:UtilsIcons") local utilsCargo = require("Module:UtilsCargo") local utilsString = require("Module:UtilsString")

local FIELDS = { {name = "name", type = "String"}, {name = "description", type = "String"}, }

function p.GetKeyword(name) local query = {tables = 'Keywords', fields = FIELDS, args = { where = 'name = "' .. name .. '"', }   			}    local results = utilsCargo.Query(query)

return results[1] end

function p._DisplayDetails(frame) local args = frame:getParent.args return p.DisplayDetails(args[1]) end

function p.DisplayDetails(keywordName) local keyword = p.GetKeyword(keywordName) local result = mw.html.create("div") :addClass("keyword-details-container") :node(mw.html.create("div")			:addClass("keyword-details-image")			:wikitext("")) :node(mw.html.create("div")			:addClass("keyword-details-name")			:wikitext(keyword["name"])) :node(mw.html.create("div")			:addClass("keyword-details-description")			:wikitext(keyword["description"])) return result end

return p