Module:Joueur
De Nefald
Autres actions
La documentation pour ce module peut être créée à Module:Joueur/doc
local p = {}
function p.main(frame)
local args = frame:getParent().args
local pseudo = args[1] or ''
local grade = args[2] or ''
if pseudo == '' then
return '<span class="joueur-texte">' .. (args.texte or 'Joueur inconnu') .. '</span>'
end
local titre = mw.title.new('Utilisateur:' .. pseudo)
local url_page = titre:fullUrl()
local url_avatar = 'https://minotar.net/avatar/' .. mw.uri.encode(pseudo, 'PATH') .. '/60?.png'
local html = '<span class="joueur-banniere">'
.. '<a href="' .. url_page .. '">'
.. '<img src="' .. url_avatar .. '" width="60" height="60" alt="' .. pseudo .. '" />'
.. '<span class="joueur-infos">'
.. '<span class="joueur-nom">' .. pseudo .. '</span>'
if grade ~= '' then
html = html .. '<span class="joueur-grade">' .. grade .. '</span>'
end
html = html .. '</span>'
.. '</a>'
.. '</span>'
return html
end
return p