Модуль:Wikidata: различия между версиями
[отпатрулированная версия] | [отпатрулированная версия] |
Содержимое удалено Содержимое добавлено
Putnik (обсуждение | вклад) форматирование URL для всех свойств с типом 'url'; получение типа свойства из Викиданных, а не по словарю |
Putnik (обсуждение | вклад) описание изображений |
||
Строка 408:
local circumstances = context.getSourcingCircumstances( statement );
if statement.qualifiers then
options.qualifiers = statement.qualifiers;
end
if ( options.references ) then
Строка 542 ⟶ 546 :
end
image = image .. ']]'
if options['description'] and options['description'] ~= '' then
image = image .. '<br>' .. options['description']
end
return image
Строка 568 ⟶ 576 :
-- вызов обработчиков по умолчанию для известных типов значений
if datavalue.type == 'wikibase-entityid' then
-- Entity ID
return function( context, options, value ) return formatEntityId( getEntityIdFromValue( value ), options ) end;
elseif datavalue.type == 'string' then
--
if datatype and datatype == 'commonsMedia' then
--
return function( context, options, value )
local lang = mw.language.getContentLanguage()
if ( not options.description or options.description == '' )
and options.qualifiers and options.qualifiers.P2096 then
for i, qualifier in pairs( options.qualifiers.P2096 ) do
if ( qualifier
and qualifier.datavalue
and qualifier.datavalue.type == 'monolingualtext'
and qualifier.datavalue.value
and qualifier.datavalue.value.language == lang:getCode() ) then
options.description = qualifier.datavalue.value.text
break
end
end
end
return formatCommonsMedia( value, options )
end;
elseif datatype and datatype == 'url' then
-- URL
|