« Module:Roadmap » : différence entre les versions
De Nefald
Autres actions
Aucun résumé des modifications Balise : Révoqué |
Annulation des modifications 5246 de Hiob (discussion) Balises : Annulation Révoqué |
||
| Ligne 79 : | Ligne 79 : | ||
line = trim(line) | line = trim(line) | ||
if line == "" or line:match("^%-%-") then | if line == "" or line:match("^%-%-") then | ||
-- skip | -- skip vide ou commentaire | ||
elseif line:match("^@section%s+") then | elseif line:match("^@section%s+") then | ||
local titre = line:match("^@section%s+(.+)$") | local titre = line:match("^@section%s+(.+)$") | ||
| Ligne 153 : | Ligne 153 : | ||
local s = CONFIG.statuts[statut] or CONFIG.statuts.planned | local s = CONFIG.statuts[statut] or CONFIG.statuts.planned | ||
return string.format( | return string.format( | ||
'<span class="roadmap-badge | '<span class="roadmap-badge" title="%s">%s</span>', | ||
escapeHtml(s.label), s.icon | |||
) | ) | ||
end | end | ||
| Ligne 217 : | Ligne 217 : | ||
'<div class="roadmap-progress-wrap">' | '<div class="roadmap-progress-wrap">' | ||
.. '<div class="roadmap-progress-label">' | .. '<div class="roadmap-progress-label">' | ||
.. 'Progression | .. 'Progression : <strong>%d%%</strong> — %d / %d fonctionnalités' | ||
.. '</div>' | .. '</div>' | ||
.. '<div class="roadmap-progress-bar">' | .. '<div class="roadmap-progress-bar">' | ||
| Ligne 234 : | Ligne 234 : | ||
if s then | if s then | ||
table.insert(parts, string.format( | table.insert(parts, string.format( | ||
'<span class="roadmap-legend-item roadmap- | '<span class="roadmap-legend-item">' | ||
.. '%s %s</span>', | .. '<span class="roadmap-badge" ' | ||
.. 'style="width:16px;height:16px;min-width:16px;font-size:0.7em">' | |||
.. '%s</span> %s</span>', | |||
s.icon, escapeHtml(s.label) | |||
)) | )) | ||
end | end | ||
| Ligne 244 : | Ligne 246 : | ||
local function htmlStats(elements) | local function htmlStats(elements) | ||
local counts = { | local counts = {} | ||
for key in pairs(CONFIG.statuts) do counts[key] = 0 end | |||
for _, el in ipairs(elements) do | for _, el in ipairs(elements) do | ||
if el.type == "item" and counts[el.statut] then | if el.type == "item" and counts[el.statut] then | ||
| Ligne 250 : | Ligne 253 : | ||
end | end | ||
end | end | ||
local | local parts = {} | ||
{ | local ordre = { "done", "inprogress", "planned", "idea", "cancelled" } | ||
for _, key in ipairs(ordre) do | |||
if counts[key] and counts[key] > 0 then | |||
local s = CONFIG.statuts[key] | |||
for _, | |||
if counts[ | |||
table.insert(parts, string.format( | table.insert(parts, string.format( | ||
'< | '<span class="roadmap-stat">' | ||
.. '<span class="roadmap-stat-count">%d</span>' | .. '<span class="roadmap-stat-count">%d</span>' | ||
.. '<span class="roadmap-stat-label">%s</span>' | .. '<span class="roadmap-stat-label">%s</span>' | ||
.. '</ | .. '</span>', | ||
counts[key], escapeHtml(s.label) | |||
)) | )) | ||
end | end | ||
end | end | ||
return '<div class="roadmap-stats">' .. table.concat(parts, "") .. '</div>' | |||
end | end | ||
| Ligne 291 : | Ligne 288 : | ||
table.insert(html, '<div class="roadmap-header">') | table.insert(html, '<div class="roadmap-header">') | ||
table.insert(html, string.format( | table.insert(html, string.format( | ||
'<div | '<div><div class="roadmap-header-title">%s</div>', | ||
escapeHtml(titre) | escapeHtml(titre) | ||
)) | )) | ||
| Ligne 334 : | Ligne 331 : | ||
-- ------------------------------------------------------------ | -- ------------------------------------------------------------ | ||
-- ITEM INLINE | -- ITEM INLINE (usage standalone) | ||
-- ------------------------------------------------------------ | -- ------------------------------------------------------------ | ||