66 476
contributi
(Annullata la modifica 33777 di Lucamauri (discussione)) Etichetta: Annulla |
(Fallback in case of Title label error) |
||
(10 versioni intermedie di uno stesso utente non sono mostrate) | |||
Riga 39: | Riga 39: | ||
-- |FileIcona=dsg.png | -- |FileIcona=dsg.png | ||
local ItemQ | local ItemQ | ||
local TitleText | |||
local Item = mw.wikibase.getEntity() | local Item = mw.wikibase.getEntity() | ||
Riga 45: | Riga 46: | ||
end | end | ||
ItemQ = p.QFromP('P14') | ItemQ = p.QFromP('P14') | ||
TitleText = mw.wikibase.getLabelByLang(ItemQ, 'it') | |||
if TitleText == nil then | |||
--Return Q item in case of error processing the label to troubleshoot | |||
TitleText = ItemQ | |||
end | |||
mw.smw.set("Istanza=" .. TitleText) | |||
return TitleText | |||
end | end | ||
function p.ListAllP(frame) | function p.ListAllP(frame) | ||
Riga 60: | Riga 62: | ||
local HTMLTable | local HTMLTable | ||
local CollectionTable = '' | local CollectionTable = '' | ||
local ExcludeP = {P3 = true, P14 = true, P26 = true, P30 = true, P37 = true, P58 = true, P68 = true} | local ExcludeP = {P3 = true, P14 = true, P26 = true, P30 = true, P37 = true, P58 = true, P68 = true, P52 = true, P79 = true, P90 = true} | ||
local Item = mw.wikibase.getEntity() | local Item = mw.wikibase.getEntity() | ||
local ItemQ = mw.wikibase.getEntityIdForCurrentPage() | local ItemQ = mw.wikibase.getEntityIdForCurrentPage() | ||
Riga 135: | Riga 137: | ||
AccValues[#AccValues + 1] = frame:expandTemplate{title = 'TimeL', args = {Tipo='ITEstesa', Istante=Value['time']}} | AccValues[#AccValues + 1] = frame:expandTemplate{title = 'TimeL', args = {Tipo='ITEstesa', Istante=Value['time']}} | ||
end | end | ||
elseif SnakValue.mainsnak.datavalue.type == 'quantity' then | |||
local StringValue | |||
StringValue = string.format('%u', SnakValue.mainsnak.datavalue.value.amount) | |||
if AddSemantic then | |||
mw.smw.set(Header[2] .. "::" .. StringValue) | |||
end | |||
AccValues[#AccValues + 1] = StringValue | |||
else | else | ||
AccValues[#AccValues + 1] = 'TABLE' | AccValues[#AccValues + 1] = 'TABLE' | ||
Riga 190: | Riga 201: | ||
ImageString = "[[File:Menu.png|left|middle|30px|HyperTrek logo]]" | ImageString = "[[File:Menu.png|left|middle|30px|HyperTrek logo]]" | ||
DataString = "Informazioni originali lette dal database di '''HyperTrek''' datato " .. HTNodes.mainsnak.datavalue.value.time .. " con i seguenti dettagli: " | DataString = "Informazioni originali lette dal database di '''HyperTrek''' datato " .. frame:expandTemplate{title = 'TimeL', args = {Tipo='ITMedia', Istante=HTNodes.mainsnak.datavalue.value.time}} .. " con i seguenti dettagli: " | ||
for _, Qualifier in pairs(HTNodes.qualifiers) do | for _, Qualifier in pairs(HTNodes.qualifiers) do | ||
QualiString = QualiString .. "<li " .. "title='" .. Qualifier[1].property .. "'>'''" .. Qualifier[1].property .. "''': " .. Qualifier[1].datavalue.value .. "</li>" | QualiString = QualiString .. "<li " .. "title='" .. Qualifier[1].property .. "'>'''" .. mw.wikibase.getLabelByLang(Qualifier[1].property, 'it') .. "''': " .. Qualifier[1].datavalue.value .. "</li>" | ||
end | end | ||
DIV | DIV | ||
:attr('id', 'htdata') | :attr('id', 'htdata') | ||
:addClass('htcontainer') | |||
:wikitext(ImageString .. DataString .. "<ul>" .. QualiString .. "</ul>" .. "[[Categoria:Pagine originariamente convertite da HT]]") --.. string.char(10) .. "[[Categoria:Pagine originariamente convertite da HT]]") | :wikitext(ImageString .. DataString .. "<ul>" .. QualiString .. "</ul>" .. "[[Categoria:Pagine originariamente convertite da HT]]") --.. string.char(10) .. "[[Categoria:Pagine originariamente convertite da HT]]") | ||
return tostring(DIV) | return tostring(DIV) |