« Module:Dates » : différence entre les versions
Apparence
Aucun résumé des modifications Balise : Révocation manuelle |
Aucun résumé des modifications |
||
| Ligne 30 : | Ligne 30 : | ||
local separateur = string.format( | local separateur = string.format( | ||
'<div style="width:100%%; display:block; clear:both | '<div style="width:100%%; display:block; clear:both;">' .. | ||
'<hr style="height:1px; border:0; background-color:%s;">' .. | '<hr style="height:1px; border:0; background-color:%s;">' .. | ||
'</div>', | '</div>', | ||
Version du 27 juin 2025 à 13:27
La documentation pour ce module peut être créée à Module:Dates/doc
local p = {}
function p.afficherDates(frame)
local args = frame:getParent().args
local charte = frame.args.charte or 'defaut'
local couleur = require('Module:Charte').couleur{ args = { charte = charte, type = 'hr' } }
local res = ''
local i = 1
while args['Date ' .. i] or args['Événement ' .. i] do
local date = args['Date ' .. i] or ''
local evenement = args['Événement ' .. i] or ''
if date ~= '' or evenement ~= '' then
res = res .. string.format(
'<tr><th style="text-align:left;">%s</th><td>%s</td></tr>',
mw.text.nowiki(date),
mw.text.nowiki(evenement)
)
end
i = i + 1
end
if res ~= '' then
local tableau = string.format(
'<table class="infobox" style="width:100%%;">%s</table>',
res
)
local separateur = string.format(
'<div style="width:100%%; display:block; clear:both;">' ..
'<hr style="height:1px; border:0; background-color:%s;">' ..
'</div>',
couleur
)
return tableau .. separateur
else
return ''
end
end
return p