Module:Index template: திருத்தங்களுக்கு இடையிலான வேறுபாடு

உள்ளடக்கம் நீக்கப்பட்டது உள்ளடக்கம் சேர்க்கப்பட்டது
No edit summary
No edit summary
வரிசை 27:
tag:wikitext('[[' .. page .. '|' .. label .. ']]')
if itemId ~= nil then
tag:wikitext(' [[Image:Wikidata.svg|10px|link=d:' .. itemId .. '|VoirView l\'entitéfeature suron Wikidata]]')
if category ~= nil then
tag:wikitext('[[Catégoriecategory:' .. category .. ']]')
end
end
வரிசை 45:
:tag('td'):wikitext(value)
end
end
 
function splitFileNameInFileAndPage(title)
local slashPosition = string.find(title.text, "/")
if slashPosition == nil then
return title.text,nil
else
return string.sub(title.text, 1, slashPosition - 1), string.sub(title.text, slashPosition + 1)
end
end
 
வரி 52 ⟶ 61:
local args = data.args
local item = data.item
mw.logObject( data.args )
local page = mw.title.getCurrentTitle()
local html = mw.html.create()
if item then
html:wikitext('[[CatégorieCategory:Livres avecBooks unwith identifianta Wikidata ID]]<indicator name="wikidata">[[File:Wikidata.svg|20px|élémentelement Wikidata|link=d:' .. item.id .. ']]</indicator>')
else
html:wikitext('[[Category: Books without a Wikidata ID]]')
end
 
--Left part
local left = html:tag('div')
if args.sommaireremarks or args.epigraphenotes then
left:css('width', '53%')
end
வரி 68 ⟶ 79:
--Image
if args.image then
local imageContainer = left:tag('div')
:css({
float = 'left',
overflow = 'hidden',
border = 'thin grey solid'
})
local imageTitle = nil
if tonumber(args.image) == nil then
local imageTitle = mw.title.new if tonumber(args.image, "Media") ~= nil then
-- this is a page number
if imageTitle ~= nil and imageTitle.exists then
imageTitle = mw.title.getCurrentTitle():subPageTitle(args.image)
imageContainer:wikitext('[[File:' .. args.image .. '|160px]]')
else
-- TODO mettre une catégorie ici pour les livres ayant une couverture qui ne provient pas du DJVU/PDF
-- this is an other file
else
imageContainer:wikitext imageTitle = mw.title.new(args.image, "Media")
end
-- TODO mettre une catégorie de maintenance ici lorsque la couverture est manquante
if imageTitle == nil then
end
imageContainer:wikitext(args.image)
else
else
imageContainer:wikitext('[[File:' .. mw.title.getCurrentTitle().text .. '|page=' .. args.image .. '|160px]]')
local imageName, imagePage = splitFileNameInFileAndPage(imageTitle)
end
if imagePage ~= nil then
imageContainer:wikitext('[[File:' .. imageName .. '|page=' .. imagePage .. '|250px]]')
else
imageContainer:wikitext('[[File:' .. imageName .. '|250px]]')
end
end
end
--Metadata
வரி 94 ⟶ 111:
local metadataTable = metadataContainer:tag('table')
 
if args.titretitle then
if args.type == 'journal'if item then
addRow(metadataTable, 'JournalTitle', withWikidataLink(args.titretitle))
else
addRow(metadataTable, 'TitreTitle', withWikidataLink(args.titre, 'Livres[[' avec.. unargs.title lien.. Wikidata')]]')
end
else
mw.addWarning('VousYou devezmust rentrerenter lethe champtitle titrefield duof formulairethe form')
end
 
addRow(metadataTable, 'Sous-titre', args.sous_titre)
addRow(metadataTable, 'VolumeSubtitle', withWikidataLink(args.volumesubtitle))
 
addRow(metadataTable, 'Publisher', args.publisher)
if args.volume then
addRow(metadataTable, 'author_orig', args.author)
addRow(metadataTable, 'AuthorVolume', withWikidataLink('[[' .. args.author)volume .. ']]' )
html:wikitext('[[Category: Books with Volume]]')
addRow(metadataTable, 'Year', withWikidataLink(args.year))
else
addRow(metadataTable, 'Place of Publication', withWikidataLink(args.place_of_publication))
html:wikitext('[[Category: Books without Volume]]')
addRow(metadataTable, 'VIAF identifier',withWikidataLink(args.viaf))
end
addRow(metadataTable, 'Parts', withWikidataLink(args.parts))
 
addRow(metadataTable, 'Traducteur', withWikidataLink(args.traducteur))
 
addRow(metadataTable, 'Éditeur', withWikidataLink(args.editeur_scientifique))
if args.edition then
addRow(metadataTable, 'Illustrateur', withWikidataLink(args.illustrateur))
addRow(metadataTable, 'ÉcoleEdition', withWikidataLink('[[' .. args.school)edition .. ']]')
html:wikitext('[[Category: Books with Edition]]')
addRow(metadataTable, 'Maison&nbsp;d’édition', withWikidataLink(args.editeur))
else
addRow(metadataTable, 'Lieu&nbsp;d’édition', withWikidataLink(args.lieu))
html:wikitext('[[Category: Books without Edition]]')
addRow(metadataTable, 'Année&nbsp;d’édition', args.annee)
end
addRow(metadataTable, 'Publication&nbsp;originale', args.publication)
 
if args.BNF_ARK then
if args.author then
local arkLink = '[http://gallica.bnf.fr/ark:/12148/' .. args.BNF_ARK .. ' Bibliothèque nationale de France][[Category:Facsimilés issus de Gallica]]<br/>'
if args.bibliothequeitem then
addRow(metadataTable, 'Author', withWikidataLink(args.author))
args.bibliotheque = arkLink .. args.bibliotheque
html:wikitext('[[Category: Books with Author]]')
else
-- html:wikitext('[[Category: Books by ' .. mw.text.nowiki(args.author) .. ']]')
args.bibliotheque = arkLink
-- local author = mw.text.nowiki(args.author)
end
-- html:wikitext('[[Category: Books by ' .. author .. ']]')
end
 
addRow(metadataTable, 'Bibliothèque', args.bibliotheque)
--local author = {{delink|[[args.author]]}}
if args.source == 'djvu' or args.source == 'pdf' then
--local author = {{#delink|I visited www.example.com example.com.}}
addRow(metadataTable, 'Fac-similés', '[[:File:' .. mw.title.getCurrentTitle().text .. '|' .. args.source .. ']]')
--local author = {{#invoke:delink | args.author}}
--local author = mw.text.unstrip( args.author )
--html:wikitext('[[Category: Books by ' .. author .. ']]')
 
else
addRow(metadataTable, 'Author', '{{Al|' .. args.author .. '}}')
end
else
html:wikitext('[[Category: Books without Author]]')
end
 
 
if args.translator then
if item then
addRow(metadataTable, 'Translator', withWikidataLink(args.translator))
html:wikitext('[[Category: Books with Translator]]')
else
addRow(metadataTable, 'Translator', '{{Al|' .. args.translator .. '}}')
end
else
html:wikitext('[[Category: Books without Translator]]')
end
 
 
if args.editor then
if item then
addRow(metadataTable, 'Editor', withWikidataLink(args.editor))
html:wikitext('[[Category: Books with Editor]]')
else
addRow(metadataTable, 'Editor', '{{Al|' .. args.editor .. '}}')
end
else
html:wikitext('[[Category: Books without Editor]]')
end
if args.illustrator then
addRow(metadataTable, 'Illustrator', withWikidataLink(args.illustrator))
html:wikitext('[[Category: Books with Illustrator]]')
else
html:wikitext('[[Category: Books without Illustrator]]')
end
 
if args.publisher then
if item then
addRow(metadataTable, 'Publisher', withWikidataLink(args.publisher))
html:wikitext('[[Category: Books with Publisher]]')
-- {{suppress categories|html:wikitext[[Category:No Publisher]]}}
-- {{#invoke:Suppress categories|main|html:wikitext[[Category:No Publisher]]}}
else
addRow(metadataTable, 'Publisher', withWikidataLink(args.publisher))
html:wikitext('[[Category: Books with Publisher]]')
end
else
html:wikitext('[[Category: Books with No Publisher]]')
 
end
 
 
if args.address then
addRow(metadataTable, 'Address', withWikidataLink(args.address))
html:wikitext('[[Category:Books with Place of Publication]]')
else
if args.publishedin then
addRow(metadataTable, 'Published In', withWikidataLink(args.publishedin))
html:wikitext('[[Category:Books with Place of Publication]]')
else
html:wikitext('[[Category:Books without Place of Publication]]')
end
end
 
 
if args.year then
addRow(metadataTable, 'Year', withWikidataLink(args.year))
html:wikitext('[[Category: Books with Year]]')
else
html:wikitext('[[Category: Books without Year]]')
end
 
 
if args.printer then
addRow(metadataTable, 'Printer', withWikidataLink(args.printer))
html:wikitext('[[Category: Books with Printer]]')
else
html:wikitext('[[Category: Books without Printer]]')
end
 
 
if args.source == 'djvu' or args.source == 'pdf' then
addRow(metadataTable, 'Source', '[[:File:' .. mw.title.getCurrentTitle().text .. '|' .. args.source .. ']]')
 
--add an indicator linking to the usages
local query = 'SELECT ?item ?itemLabel ?pages ?page WHERE {\n ?item wdt:P996 <http://commons.wikimedia.org/wiki/Special:FilePath/' .. mw.uri.encode(mw.title.getCurrentTitle().text, 'PATH') .. '> .\n OPTIONAL { ?page schema:about ?item ; schema:isPartOf <https://frbn.wikisource.org/> . }\n OPTIONAL { ?item wdt:P304 ?pages . }\n SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],enbn".\n}}'
 
html:wikitext('<indicator name="index-scan-wikidata">[[File:Wikidata Query Service Favicon.svg|20px|éléments Wikidata|link=https://query.wikidata.org/embed.html#' .. mw.uri.encode(query, 'PATH') .. ']]</indicator>')
html:wikitext('<indicator name="index-scan-wikidata">[[File:Wikidata Query Service Favicon.svg|20px|Wikidata items |link=https://query.wikidata.org/embed.html#' .. mw.uri.encode(query, 'PATH') .. ']]</indicator>')
else
addRow(metadataTable, 'Fac-similésSource', args.source)
end
if args.avancementprogress == 'T' then
addRow(metadataTable, 'AvancementProgress', '[[Category:LivresCompleted terminésBooks]] [[:Category:LivresCompleted Books terminés|Terminé Completed]]')
elseif args.avancementprogress == 'V' then
addRow(metadataTable, 'AvancementProgress', '[[category:LivresBooks àto validervalidate]] [[:categoryCategory:LivresBooks àto validate valider|À validerTo validate]]')
elseif args.avancementprogress == 'C' then
addRow(metadataTable, 'AvancementProgress', '[[category:LivresBooks àto corrigercorrect]] [[:category:LivresBooks àto correct corriger|À corrigerTo correct]]')
elseif args.avancementprogress == 'MSOCR' then
addRow(metadataTable, 'AvancementProgress', '[[category:LivresBooks àwithout découpera text layer]] [[:category:LivresBooks àwithout a text layer découper|Texte prêtAdd an àOCR êtretext découpélayer]]')
elseif args.avancementprogress == 'OCRL' then
addRow(metadataTable, 'AvancementProgress', '[[category:LivresBooks sansto couche texterepair]] <span style = "color: # FF0000;"> [[:category:Livres sansBooks coucheto texte|Ajouterrepair une| coucheDefective textesource d’OCRfile]]</span>')
elseif args.avancementprogress == 'X' then
addRow(metadataTable, 'AvancementProgress', '[[category:ExtraitsExtracts etand compilations]] [[:category:ExtraitsExtracts etand compilations |Source incomplète:Incomplete extraitsource:extract ouor compilation]]')
elseif args.avancement == 'D' then
addRow(metadataTable, 'Avancement', '[[category:Doublons]][[:category:Doublons|Index en double]]')
elseif args.avancement == 'L' then
addRow(metadataTable, 'Avancement', '[[category:Livres à réparer]]<span style="color: #FF0000; ">[[:category:Livres à réparer|Fichier source défectueux]]</span>')
else
addRow(metadataTable, 'AvancementProgress', '[[Category:LivresUnknown d’avancementprogress inconnubooks]] [[:category:LivresUnknown d’avancementprogress books inconnu|Avancement inconnuUnknown progress]]')
end
addRow(metadataTable, 'SérieSeries', args.tomesvolumes)
if args.pages then
left:tag('div'):css('clear', 'both')
left:tag('h3'):wikitext('Pages')
left:tag('div'):attr('id', 'pagelist'):css({
background = '#F0F0F0',
வரி 168 ⟶ 271:
}):newline():wikitext(args.pages):newline()
else
mw.addWarning('VousYou devezmust rentrerenter lathe pagination duof fac-similéthe (champfacsimile (Pages field) ')
end
 
if args.sommaireremarks or args.epigraphenotes then
local right = html:tag('div'):css({
width = '44%;',
வரி 177 ⟶ 280:
float = 'right'
})
if args.sommaireremarks then
right:tag('div'):attr('id', 'sommaireremarks'):wikitext(args.sommaireremarks)
end
if args.epigraphenotes then
right:tag('hr'):css({
['margin-top'] = '1em',
['margin-bottom'] = '1em'
})
right:tag('div'):attr('id', 'epigraphenotes'):wikitext(args.epigraphenotes)
end
end
if args.clef then
html:wikitext('{{DEFAULTSORT:' .. args.clef .. '}}')
end
if args.type == 'book' then
html:wikitext('[[CatégorieCategory: Index - LivresBooks]] ')
elseif args.type == 'journal' then
html:wikitext('[[CatégorieCategory: Index - PériodiquesPeriodicals]] ')
elseif args.type == 'collection' then
html:wikitext('[[CatégorieCategory: Index - RecueilsCollections]] ')
elseif args.type == 'dictionary' then
html:wikitext('[[CatégorieCategory: Index - DictionnairesDictionaries]] ')
elseif args.type == 'phdthesis' then
html:wikitext('[[CatégorieCategory: Index - ThèsesTheses]] ')
end
html:wikitext('[[CatégorieCategory: Index]] ')
 
if args.source ~= 'djvu' then
html:wikitext('[[Category:Livre nonNon djvu book]] ')
elseif args.source == 'pdf' then
html: wikitext ('[[Category: PDF book]]')
elseif args.source == 'ogg' then
html: wikitext ('[[Category: OGG file]]')
elseif args.source == 'webm' then
html: wikitext ('[[Category: webm file]]')
end
if not args.sommaireremarks then
html: wikitext ('[[CatégorieCategory:Sommaire manquantIndexed pages]]')
end
 
"https://ta.wikisource.org/wiki/Module:Index_template" இலிருந்து மீள்விக்கப்பட்டது