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

96 octets ajoutés ,  4 août 2021
m
aucun résumé des modifications
Kharmitch (discussion | contributions)
mAucun résumé des modifications
Kharmitch (discussion | contributions)
mAucun résumé des modifications
Balise : Révocation manuelle
 
(12 versions intermédiaires par le même utilisateur non affichées)
Ligne 13 : Ligne 13 :
namespace =  mw.title.getCurrentTitle().namespace
namespace =  mw.title.getCurrentTitle().namespace
}
}
local abb = require('Module:Abréviation')


-- l'objet principal à retourner
-- l'objet principal à retourner
Ligne 57 : Ligne 59 :
local text = getValue(part.value, part) or part.textdefaultvalue or mw.title.getCurrentTitle().text
local text = getValue(part.value, part) or part.textdefaultvalue or mw.title.getCurrentTitle().text
local subtext = getValue(part.subtitle, part) or part.subtitledefaultvalue
local subtext = getValue(part.subtitle, part) or part.subtitledefaultvalue
text = mw.ustring.gsub(text, " [(][^()]*[)]$", "")
if subtext and (subtext ~= text) then
if subtext and (subtext ~= text) then
text = text .. '<br /><small>' .. subtext .. '</small>'
text = text .. '<br /><small>' .. subtext .. '</small>'
Ligne 79 : Ligne 84 :
local subhead = nil
local subhead = nil
if part.subhead then
if part.subhead then
local subheadText = require('Module:Jeux').buildLinksList({
local subheadText = abb.links({
getValue(part.subhead.games, part),
getValue(part.subhead.games, part),
part.subhead.link,
part.subhead.link,
Ligne 172 : Ligne 177 :
elseif #images > 1 then
elseif #images > 1 then
imagesString = imagesString .. '|upright=' .. ( 1 / #images )
imagesString = imagesString .. '|upright=' .. ( 1 / #images )
end
if image:sub(-4):lower() == '.svg' then
imagesString = imagesString .. '|lang=' .. wikiLang
end
end
imagesString = imagesString .. ']]'
imagesString = imagesString .. ']]'
Ligne 307 : Ligne 309 :
function p.buildsuccession(part)
function p.buildsuccession(part)
if not part.value then
if not part.value then
return nil
end
local values = part.value
local before = getValue(values['before'], part)
local center = getValue(values['center'], part)
local after  = getValue(values['after'], part)
if not before and not center and not after then
return nil
return nil
end
end
Ligne 352 : Ligne 363 :
local styleTrans = {}
local styleTrans = {}
local values = part.value
local before = values['before']
local center = values['center']
local after = values['after']
local widthCell = '44%'
local widthCell = '44%'
Ligne 681 : Ligne 687 :
-- class
-- class
local class = 'avt-infobox'
local class = 'infobox avt-infobox'
if moduledata.class then
if moduledata.class then
class = class .. ' ' .. moduledata.class
class = class .. ' ' .. moduledata.class
Bureaucrate, commentadmin, emailconfirmed, Administrateurs d’interface, staff, Administrateur
62 734

modifications