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:Infobox/Configs/Localite » : différence entre les versions

De Nefald
Hiob (discussion | contributions)
Sections
Hiob (discussion | contributions)
Ajout catégorisation restreinte par liste
Balises : Modification par mobile Modification par le web mobile
 
(4 versions intermédiaires par le même utilisateur non affichées)
Ligne 3 : Ligne 3 :
         return args.nom or '{{PAGENAME}}'  
         return args.nom or '{{PAGENAME}}'  
     end,
     end,
 
   
     soustitre = function(args)
    -- Icône avec type et nom
         return args.soustitre
     icone = {
     end,
        type = 'fas',  -- ou 'fab', 'far', 'fal', 'fad'
 
         nom = 'map-location-dot'
     },
   
     image = function(args)  
     image = function(args)  
         if args.image then
         if args.image then
Ligne 18 : Ligne 20 :
         return nil
         return nil
     end,
     end,
    -- Configuration du champ "type" avec validation et catégorisation
    typeField = {
        required = false, -- Optionnel pour les localités
        allowedValues = {
            ['ville'] = {
                display = 'Ville',
                category = 'Villes'
            },
            ['village'] = {
                display = 'Village',
                category = 'Villages'
            },
            ['cité'] = {
                display = 'Cité',
                category = 'Cités'
            },
            ['capitale'] = {
                display = 'Capitale',
                category = 'Capitales'
            },
            ['port'] = {
                display = 'Port',
                category = 'Ports'
            },
            ['forteresse'] = {
                display = 'Forteresse',
                category = 'Forteresses'
            },
            ['château'] = {
                display = 'Château',
                category = 'Châteaux'
            },
            ['ruine'] = {
                display = 'Ruine',
                category = 'Ruines'
            },
            ['avant-poste'] = {
                display = 'Avant-poste',
                category = 'Avant-postes'
            },
            ['campement'] = {
                display = 'Campement',
                category = 'Campements'
            },
            ['métropole'] = {
                display = 'Métropole',
                category = 'Métropoles'
            },
            ['sanctuaire'] = {
                display = 'Sanctuaire',
                category = 'Sanctuaires'
            }
        },
        errorMessage = 'Type de localité non reconnu. Types autorisés : ville, village, cité, capitale, port, forteresse, château, ruine, avant-poste, campement, métropole, sanctuaire'
    },


     sections = {
     sections = {
Ligne 29 : Ligne 87 :
                 { cle = 'symbole', label = 'Symbole' },
                 { cle = 'symbole', label = 'Symbole' },
                 { cle = 'statut', label = 'Statut' },
                 { cle = 'statut', label = 'Statut' },
                 {  
                 { cle = 'x', label = 'Coordonnée X' },
                    cle = 'coordonnees',  
                { cle = 'y', label = 'Coordonnée Y' },
                    label = 'Coordonnées',
                 { cle = 'z', label = 'Coordonnée Z' }
                    format = function(args)
                        if args.x and args.y and args.z then
                            return args.x .. ", " .. args.y .. ", " .. args.z
                        end
                        return nil
                    end
                 }
             }
             }
         },
         },