Basculer le menu
Changer de menu des préférences
Basculer le menu personnel
Non connecté(e)
Votre adresse IP sera visible au public si vous faites des modifications.

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

De Nefald
Hiob (discussion | contributions)
Aucun résumé des modifications
Balise : Révoqué
Hiob (discussion | contributions)
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 roadmap-badge-%s" title="%s">%s</span>',
'<span class="roadmap-badge" title="%s">%s</span>',
statut, escapeHtml(s.label), s.icon
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\194\160: <strong>%d%%</strong> — %d / %d fonctionnalités'
.. '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-%s">'
'<span class="roadmap-legend-item">'
.. '%s %s</span>',
.. '<span class="roadmap-badge" '
key, htmlBadge(key), escapeHtml(s.label)
.. '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 = { done = 0, inprogress = 0, planned = 0, idea = 0, cancelled = 0 }
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 order = {
local parts = {}
{ key = "done",       label = "Terminé" },
local ordre = { "done", "inprogress", "planned", "idea", "cancelled" }
{ key = "inprogress", label = "En cours" },
for _, key in ipairs(ordre) do
{ key = "planned",   label = "Planifié" },
if counts[key] and counts[key] > 0 then
{ key = "idea",       label = "Idée" },
local s = CONFIG.statuts[key]
{ key = "cancelled",  label = "Annulé" },
}
local parts = { '<div class="roadmap-stats">' }
for _, s in ipairs(order) do
if counts[s.key] > 0 then
table.insert(parts, string.format(
table.insert(parts, string.format(
'<div class="roadmap-stat roadmap-stat-%s">'
'<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>'
.. '</div>',
.. '</span>',
s.key, counts[s.key], s.label
counts[key], escapeHtml(s.label)
))
))
end
end
end
end
table.insert(parts, '</div>')
return '<div class="roadmap-stats">' .. table.concat(parts, "") .. '</div>'
return table.concat(parts, "\n")
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 class="roadmap-header-content"><div class="roadmap-header-title">%s</div>',
'<div><div class="roadmap-header-title">%s</div>',
escapeHtml(titre)
escapeHtml(titre)
))
))
Ligne 334 : Ligne 331 :


-- ------------------------------------------------------------
-- ------------------------------------------------------------
-- ITEM INLINE
-- ITEM INLINE (usage standalone)
-- ------------------------------------------------------------
-- ------------------------------------------------------------


Les témoins (''cookies'') nous aident à fournir nos services. En utilisant nos services, vous acceptez notre utilisation de témoins.