Module:AchievementsList: Difference between revisions

From Eco - English Wiki
[checked revision][checked revision]
No edit summary
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 9: Line 9:
local Achievements = AchievementsData.Achievements
local Achievements = AchievementsData.Achievements


-- create the header of the table
wiki = '<div class="row">'
local header = "<table class=\"wikitable sortable\"> \n "  
header = header .. "<tr> \n "
header = header .. "<th>Icon</th> \n "
header = header .. "<th>Name and Description</th> \n "
header = header .. "</tr> \n "
wiki = header


for k,v in pairs(Achievements) do
for k,v in pairs(Achievements) do
local row = ''
local row = ''
row = row .. "<tr>"
row = row .. '<div  class="col-lg-3">[[file:' .. v.id.. '_Icon.png|64px|link=]] <b>' .. v.Name.. '</b><br>' .. v.Description.. '</div>'
row = row .. "<td>" .. v.Name.. " </td>"
row = row .. "<td>" .. v.Description.. " </td>"
row = row .. "</tr> \n"
wiki = wiki .. row
wiki = wiki .. row
end
end


wiki = wiki .. " </table>"
wiki = wiki .. '</div>'
return wiki
return wiki
end
end


return p
return p

Latest revision as of 10:46, 19 June 2024


local p = {}

function p.main()
	local wiki = ''

	-- import the required modules
	local AchievementsData = require( "Module:AchievementsData" )	
	
	local Achievements = AchievementsData.Achievements

	wiki = '<div class="row">'

	for k,v in pairs(Achievements) do
		local row = ''
		row = row .. '<div  class="col-lg-3">[[file:' .. v.id.. '_Icon.png|64px|link=]] <b>' .. v.Name.. '</b><br>' .. v.Description.. '</div>'
		wiki = wiki .. row
	end

	wiki = wiki .. '</div>'
	return wiki
	end

return p