Modul:Infobox: Unterschied zwischen den Versionen
Keine Bearbeitungszusammenfassung |
renderConnectivity |
||
(3 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 138: | Zeile 138: | ||
function renderSensors() | function renderSensors() | ||
return renderList('P57') | |||
end | |||
function renderConnectivity() | |||
return renderList('P74') | |||
end | |||
function renderList(claimIdentifier) | |||
local entity = mw.wikibase.getEntityObject() | local entity = mw.wikibase.getEntityObject() | ||
result = '' | result = '' | ||
if not entity or not entity.claims then return end --the entity doesnt exist or have no claims | if not entity or not entity.claims then return end --the entity doesnt exist or have no claims | ||
local property = entity.claims[ | local property = entity.claims[claimIdentifier] | ||
if property then | if property then | ||
for key, prop in pairs(property) do | for key, prop in pairs(property) do | ||
Zeile 148: | Zeile 156: | ||
end | end | ||
end | end | ||
end | |||
return result | |||
end | |||
function renderAmazon(frame) | |||
local entity = mw.wikibase.getEntityObject() | |||
result = '' | |||
if not entity or not entity.claims then return end --the entity doesnt exist or have no claims | |||
local property = entity.claims['P8'] | |||
if property and property[1] and property[1].mainsnak and property[1].mainsnak.datavalue then | |||
result = frame:expandTemplate{ title = 'Amazon', args = { getValueLabel(property[1].mainsnak.datavalue), entity:getLabel() .. " bei Amazon" } } | |||
end | end | ||
return result | return result | ||
Zeile 180: | Zeile 199: | ||
local propValue = prop.mainsnak.datavalue | local propValue = prop.mainsnak.datavalue | ||
result = result .. ", " .. getValue(prop) .. "-Kern"; | result = result .. ", " .. getValue(prop) .. "-Kern"; | ||
if prop.qualifiers["P32"] and prop.qualifiers["P32"][1] and prop.qualifiers["P32"][1].datavalue then | if prop.qualifiers and prop.qualifiers["P32"] and prop.qualifiers["P32"][1] and prop.qualifiers["P32"][1].datavalue then | ||
result = result .. " " .. getValueLabel(prop.qualifiers["P32"][1].datavalue) .. " CPU" | result = result .. " " .. getValueLabel(prop.qualifiers["P32"][1].datavalue) .. " CPU" | ||
else | |||
result = result .. " unbekannte CPU" | |||
end | end | ||
end | end | ||
Zeile 194: | Zeile 215: | ||
renderCPU = renderCPU, | renderCPU = renderCPU, | ||
renderSensors = renderSensors, | renderSensors = renderSensors, | ||
renderConnectivity = renderConnectivity, | |||
renderAmazon = renderAmazon, | |||
} | } |