« Module:SkillList » : différence entre les versions

De Eco - Wiki Français
Aller à :navigation, rechercher
[version non vérifiée][version non vérifiée]
StalEF (discussion | contributions)
Aucun résumé des modifications
StalEF (discussion | contributions)
Aucun résumé des modifications
 
Ligne 11 : Ligne 11 :
     local skillData = require( "Module:SkillData" )
     local skillData = require( "Module:SkillData" )
     local skillList = skillData.skills
     local skillList = skillData.skills
local text = '<div class="col-lg-12"><Center><h2 class="title">Skills</h2></Center></div>';
local text = '<div class="col-lg-12"><Center><h2 class="title">Compétences</h2></Center></div>';
for Pname,Pdata in pairs(skillList) do
for Pname,Pdata in pairs(skillList) do
Ligne 20 : Ligne 20 :
text = text .. '<div class="card-body"><h5 class="card-title">';
text = text .. '<div class="card-body"><h5 class="card-title">';
text = text .. IconUtils.main{ name = Pname, id = Pdata.SkillID , size = 48, style = 2, link = Pname} .. '  '
text = text .. IconUtils.main{ name = Pname, id = Pdata.SkillID , size = 48, style = 2, link = Pname} .. '  '
text = text .. 'Profession</h5><h6 class="card-subtitle mb-2 text-muted">' .. Pdata.Description .. '</h6><p class="card-text">';
text = text .. 'de métier</h5><h6 class="card-subtitle mb-2 text-muted">' .. Pdata.Description .. '</h6><p class="card-text">';
text = text .. '<div class="card"> <div class="card-body">';
text = text .. '<div class="card"> <div class="card-body">';



Dernière version du 14 décembre 2024 à 21:13

La documentation pour ce module peut être créée à Module:SkillList/doc

local p = {}

local Utils = require('Module:Utils')
local IconUtils = require('Module:IconUtils')
local L = require('Module:Localization')

-- Main entry point for the Module
function p.main()
   	
    -- load lists
    local skillData = require( "Module:SkillData" )
    local skillList = skillData.skills
	local text = '<div class="col-lg-12"><Center><h2 class="title">Compétences</h2></Center></div>';
	
	for Pname,Pdata in pairs(skillList) do

		if Pdata.Root == 'True' then 
		text = text .. '<div class="col-lg-3"><div class="card">';
		text = text .. '[[File:Banner4k.jpg|class=card-img-top|link=]]';
		text = text .. '<div class="card-body"><h5 class="card-title">';
		text = text .. IconUtils.main{ name = Pname, id = Pdata.SkillID , size = 48, style = 2, link = Pname} .. '  '
		text = text .. 'de métier</h5><h6 class="card-subtitle mb-2 text-muted">' .. Pdata.Description .. '</h6><p class="card-text">';
		text = text .. '<div class="card"> <div class="card-body">';

		for Sname,Sdata in pairs(skillList) do
			if Sdata.Root == 'False' and Sdata.RootSkill == Pname then 
				text = text .. IconUtils.main{ name = Sname, id = Sdata.SkillID , size = 32, style = 1, link = Sname} .. '  ';
			end
		end
		text = text .. '</div></div></p></div></div></div>'; end
	end

	return text
end

return p