Module:EnCours

De Adadov.net wiki
Documentation icon Documentation Module[voir] [éditer] [historique] [purger]

Ce module implémente {{Modèle:EnCours}}

local documentation = require('Module:Documentation').main

local p = {}

local function getType()
	local title = tostring(mw.title.getCurrentTitle())
	if string.match(title, "doc") then
		type = "doc"
	else
		type = "std"
	end
 
	p.type = type
 
	return type
end	

function p.showType()
	local type = p.getType()
	print(type)
	return type
end
 
function p.showTitle()
	print(tostring(mw.title.getCurrentTitle()))
end

function p.html( frame ) 
	local img = "[[Image:Vlc.png|70px]]"
	local auteurName = frame.args.auteur
	local auteur = ""
	if auteurName == "" then 
		auteur = "'' Auteur / Editeur : Inconnu''"
	else
		auteur = "'' Auteur / Editeur : [[Utilisateur:"..auteurName.."|"..auteurName.."]]"
	end
	local textInfo = [[Le présent article est actuellement en cours de rédaction ou de modification.\n
	Adressez-vous à la personne en charge pour toute proposition ou modification.]]
	
	local root = mw.html.create()
	root
		:tag('div')
			:addClass('wgTemplateWarning')
			:tag('table')
				:attr('align', 'center')
				:tag('caption')
					:cssText('color:red;font-weight:bold;')
					:wikitext('Article en cours de rédaction ou de modification !')
					:done()
				:tag('tr')
					:tag('td')
						:wikitext(img)
						:done()
				:tag('tr')
					:tag('td')
						:wikitext(textInfo)
						:done()
				:tag('tr')
					:tag('td')
						:attr('align', 'right')
						:wikitext(auteur)
						:done()

	return tostring(root)
end

return p