« Module:Pilotes » : différence entre les versions
De Infothèque
Autres actions
m A protégé « Module:Pilotes » ([Modifier=Autoriser uniquement les administrateurs] (infini) [Renommer=Autoriser uniquement les administrateurs] (infini)) |
Aucun résumé des modifications |
||
| Ligne 42 : | Ligne 42 : | ||
}, | }, | ||
rowData = rows, | rowData = rows, | ||
quickSearch = | quickSearch = { placeholder = 'Rechercher un pilote...', debounceMs = 300 }, | ||
pagination = true, | pagination = true, | ||
paginationPageSize = 10, | paginationPageSize = 10, | ||
Version du 13 août 2026 à 17:45
La documentation pour ce module peut être créée à Module:Pilotes/doc
local aggrid = require('mw.ext.aggrid')
local p = {}
function p.main(frame)
local args = frame:getParent().args
local rows = {}
local i = 1
while true do
local nom = args['nom' .. i]
if not nom or nom == '' then
break
end
local fichier = args['fichier' .. i] or ''
local row = {
nom = nom,
type = args['type' .. i] or '',
os = args['os' .. i] or '',
version = args['version' .. i] or '',
date = args['date' .. i] or '',
}
if fichier ~= '' then
row.telechargement = aggrid.link('Fichier:' .. fichier, 'Télécharger')
end
table.insert(rows, row)
i = i + 1
end
if #rows == 0 then
return ''
end
return aggrid.render{
columnDefs = {
{ field = 'nom', headerName = 'Nom du pilote' },
{ field = 'type', headerName = 'Type', filter = 'aggridSet' },
{ field = 'os', headerName = 'Système', filter = 'aggridSet' },
{ field = 'version', headerName = 'Version' },
{ field = 'date', headerName = 'Date' },
aggrid.linkColumn{ field = 'telechargement', header = 'Téléchargement' },
},
rowData = rows,
quickSearch = { placeholder = 'Rechercher un pilote...', debounceMs = 300 },
pagination = true,
paginationPageSize = 10,
}
end
return p