Aller au contenu

Module:Infobox/Discours

Une page de Wikipédia, l'encyclopédie libre.
Ceci est une version archivée de cette page, en date du 9 octobre 2019 à 01:21 et modifiée en dernier par Tomo8 5 (discuter | contributions) (Suppression WD pour destinataire (P1817 s'emploie seulement pour une note ou une lettre)). Elle peut contenir des erreurs, des inexactitudes ou des contenus vandalisés non présents dans la version actuelle.

 Documentation[voir] [modifier] [historique] [purger]

Cette page définit un module d'infobox. Pour les conseils sur l'usage de ce module, voyez Modèle:Infobox Discours.


local general = require "Module:Infobox/Fonctions"
local wd = require "Module:Wikidata"
local localdata = require "Module:Infobox/Localdata"

local chartes = {

-- {titre charte, élément wikidata, couleur titre, couleur sous-titre, couleur texte, pictogramme}
	{'defaut', '', '#336699', '#336699', '#FFFFFF', 'archives2'}, -- Défaut
}

local function setformat()
	local instanceof = wd.getIds(localdata.item, {property = 'P31'})

	if not instanceof then
		return  {'Q', '', '#336699', '#336699', '#FFFFFF', 'archives2'}
	end
	instanceof = wd.addVals(instanceof, {property = 'P279'}, 2)
	for i, j in pairs(instanceof) do
		for k, l in pairs(chartes) do
			if l[2] == j then
				return l
			end
		end
	end
	return {'Q', '', '#336699', '#336699', '#FFFFFF', 'archives2'}
end

local function setcharte()
	if localdata['charte'] then
		charte = localdata['charte']
		for i, j in pairs(chartes) do
			if j[1] == charte then
				return j
			end
		end
	end
	return setformat()
end

local displayformat = setcharte()

-- Partie principale

return 
	{
	maincolor = displayformat[3],
	secondcolor = displayformat[4],
	thirdcolor = displayformat[5],
	parts =
    	{
	general.title(displayformat[6], nil, 'sous-titre', nil),
	general.mainimage('Article à illustrer', 'Defaut 2.svg'),
	
	{type = 'table', title = "Présentation", 
		rows = {
			{type = 'row', label = "Titre", plurallabel = "Titres", value = 'titre officiel', property = 'P1476'},
			{type = 'row', label = "Prononcé le", plurallabel = "Prononcés le", value = 'prononcé le', property = 'P585'},
			{type = 'row', label = "Interprète", plurallabel = "Interprètes", value = 'interprète', property = 'P175'},
			{type = 'row', label = "Orateur", plurallabel = "Orateurs", value = 'orateur', property = 'P823'},
			{type = 'row', label = "Lieu", plurallabel = "Lieux", value = 'lieu', property = 'P276'},
			{type = 'row', label = "Destinataire", plurallabel = "Destinataires", value = 'destinataire'},
			{type = 'row', label = "Contexte", plurallabel = "Contextes", value = 'contexte'},
			{type = 'row', label = "Langue", plurallabel = "Langues", value = 'langue', property = 'P407'},
			{type = 'row', label = "Durée", plurallabel = "Durées", value = 'durée', property = 'P207'},
		}
	},	

	{type = 'table', title = "Contenu du discours",
		rows = {
			{type = 'row', label = "Thème principal", plurallabel = "Thèmes principaux", value = "thème principal", property = 'P921'},
			{type = 'row', label = "Dépeint", plurallabel = "Dépeint", value = "dépeint", property = 'P180'},
			{type = 'row', label = "Aspect de", plurallabel = "Aspect de", value = "aspect de", property = 'P1269'},
			{type = 'row', label = "Conséquences", value = 'conséquences'},
		}
	},

	{type = 'table', title = "Autres informations",
		rows = {
			{type = 'row', label = "Juridiction concernée", plurallabel = "Juridictions concernées", value = 'juridiction', property = 'P1001'},
			{type = 'row', label = "Auteur", plurallabel = "Auteurs", value = 'auteur', property = 'P50'},
			{type = 'row', label = "Participant", plurallabel = "Participants", value = 'participant', property = 'P710'},
			{type = 'row', label = "Époque de l'action", plurallabel = "Époques de l'action", value = "époque de l'action", property = 'P2408'},
			{type = 'row', label = "Nommé en référence à", value = 'nommé de', property = 'P138'},
			{type = 'row', label = "Date de création", plurallabel = "Dates de création", value = 'date de création', property = 'P571'},
			{type = 'row', label = "Fréquence", plurallabel = "Fréquences", value = 'fréquence', property = 'P2257'},
			{type = 'row', label = "Mois de l'année", value = "mois de l'année", property = 'P2922'},
			{type = 'row', label = "Texte intégral disponible sur :", value = "texte intégral", property = 'P953'},
			{type = 'row', label = "Texte intégral traduit :", value = "texte intégral traduit"},
			{type = 'row', label = "Date de publication", plurallabel = "Dates de publication", value = 'date de publication', property = 'P577'},
--			{type = 'row', label = "Hashtag Twitter", plurallabel = "Hashtags Twitter", value = 'hashtag twitter', property = 'P2572'},
		}
	},
}
}