Перейти к содержанию

Шаблон:Карточка: различия между версиями

Материал из GravityWiki
Новая страница: «{{Документация/Шапка}} <!-- Документацию следует размещать здесь --> {{lua|Карточка}} {{Предмет-сущность|инвизображение=нет}} Этот шаблон-карточка предназначен для использования в статьях о сущностях, соответствующих предметам. <pre style="display:table"> {{Предмет-сущно...»
 
Нет описания правки
 
Строка 1: Строка 1:
{{Документация/Шапка}}
local p = {}
<!-- Документацию следует размещать здесь -->
{{lua|Карточка}}
{{Предмет-сущность|инвизображение=нет}}


Этот шаблон-карточка предназначен для использования в статьях о сущностях, соответствующих предметам.
-- Создаёт карточку
<pre style="display:table">
function p.infobox(f)
{{Предмет-сущность
local args = f
|название=
if f == mw.getCurrentFrame() then
|изображение=
args = require( 'Модуль:ProcessArgs' ).merge( true )
|инвизображение=
else
|тип=
f = mw.getCurrentFrame()
|толькоплатформы=
end
|прочн=
local titleObject = mw.title.getCurrentTitle()
|возобн=
local title = args['название'] or titleObject.subpageText
|склад=
local subtitle = args["подзаголовок"] or ""
|здоровье=
|id=
local titleArea = args["шапка"]
|сетевой_id=
if not titleArea then
|сущн_id=
if subtitle == '' then
|дроп=
titleArea = title
|опыт=
else
|звуки=
titleArea = title .. '<br><span class="infobox-subtitle">' .. subtitle .. '</span>'
|данные=
end
|текст_id=
end
}}</pre>
local mod = args["мод"]
if mod then
local mods = mw.loadData("Модуль:Модификации")
mod = mods[mod] or mod
end


Если у предмета несколько значений данных, используйте параметр {{п|многоданных}}. Список параметров:
local imageArea = args["изображения"]
if not imageArea then
local images = {}
local invImages = {}
local defaultImageSize = args["умолчразмеризобр"] or '160px'
local defaultImageClass = args["умолчклассизобр"]
args["изображение1"] = args["изображение1"] or args["изображение"]
args["изобр1описание"] = args["изобр1описание"] or args["изоброписание"]
args["изобр1разм"]  = args["изобр1разм"] or args["изобрразм"]
args["изобр1класс"]  = args["изобр1класс"] or args["изобркласс"] or 'pageimage'
args["инвизображение1"] = args["инвизображение1"] or args["инвизображение"] or 'назв'
args['группа1'] = args['группа1'] or args['группа']
args['групп1разм'] = args['групп1разм'] or args['группразм']
args['групп1класс'] = args['групп1класс'] or args['группкласс']
args['групп1описание'] = args['групп1описание'] or args['группописание'] or ''
if not (args["изображение1"] or args["группа1"]) then
args["изображение1"] = "назв"
end
local imgCount = {}
local invImgCount = {}
local groupCount = {}
local groupImgList = {}
for k, v in pairs( args ) do
if type( k ) == "string" and k ~= "ряды" then
local image, num = mw.ustring.match(k, '^(изображение)(%d+)$' )
local invImage, invNum = mw.ustring.match(k, '^(инвизображение)(%d+)$' )
local group, groupNum = mw.ustring.match(k, '^(группа)(%d+)$' )
local groupImg, groupImgNum = mw.ustring.match(k, '^(%d+)-(%d+)$' )
if mw.ustring.lower(v) ~= 'нет' then
if image then
table.insert( imgCount, tonumber( num ) )
elseif invImage then
table.insert( invImgCount, tonumber( invNum ) )
elseif group then
table.insert( groupCount, tonumber( groupNum ) )
if not groupImgList['группа' .. groupNum] then
groupImgList['группа' .. groupNum] = {}
end
elseif groupImg then
if not groupImgList['группа' .. groupImg] then
groupImgList['группа' .. groupImg] = {}
end
table.insert( groupImgList['группа' .. groupImg], tonumber( groupImgNum ) )
end
end
end
end
local animate
if #groupCount > 0 then
table.sort( groupCount )
local tabber = {}
for k, v in ipairs( groupCount ) do
local group = args['группа' .. v]
local groupSize = args['групп' .. v .. 'разм'] or defaultImageSize
local groupClass = args['групп' .. v .. 'класс'] or defaultImageClass
local groupCaption = args['групп' .. v .. 'описание'] or ''
local groupImages = {}
table.sort( groupImgList['группа' .. v] )
for _, w in ipairs( groupImgList['группа' .. v] ) do
local image = args[v .. '-' .. w]
local size = args[v .. '-' .. w .. 'разм'] or args['*-' .. w .. 'разм'] or groupSize
local class = args[v .. '-' .. w .. 'класс'] or args['*-' .. w .. 'класс'] or groupClass
local caption = args[v .. '-' .. w .. 'описание'] or args['*-' .. w .. 'описание'] or ''
if image:match( ';' ) then
if not animate then
animate = require( 'Модуль:Анимация' ).animate
end
image = animate{ image, size, nil, class }
else
image = '[[Файл:' .. image .. '|' .. size .. '|class=' .. ( class or '' ) .. ']]'
end
if caption ~= '' then
caption = '<div class="infobox-imagecaption">\n' .. caption .. '\n</div>'
end
table.insert( groupImages, '<div>' .. image .. caption .. '</div>' )
end


{| class="wikitable"
if groupCaption ~= '' then
! Параметр
groupCaption = '<div class="infobox-imagecaption">\n' .. groupCaption .. '\n</div>'
! Задача
end
! Пример значения или значение по умолчанию
|-
table.insert( tabber, '|-|' .. group .. '=\n' .. table.concat( groupImages, '\n' ) .. groupCaption )
| <code>название</code> || Необязательное значение, позволяющие указать название сущности, отличное от названия страницы || <code><nowiki>{{SUBPAGENAME}}</nowiki></code>
end
|-
table.insert( images, '<div>' .. f:extensionTag( 'tabber', table.concat( tabber, '\n' ) ) .. '</div>' )
| <code>изображение</code> || Изображение сущности || <code><nowiki>{{{название}}}.png</nowiki></code>, если существует, иначе [[:File:No image.svg|No image.svg]] (со ссылкой на загрузку отсутствующего изображения)
end
|-
| <code>размеризобр</code> || Изменяет размер изображения || 200px
table.sort( imgCount )
|-
local animate
| <code>изображение''N''</code> || Другие изображения для сущностей с более чем одним состоянием || ''нет''
for k, v in ipairs( imgCount ) do
|-
local image = args['изображение' .. v]
| <code>изобр''N''разм</code> || Изменяет размер соответствующего изображения || 200px
local size = args['изобр' .. v .. 'разм'] or defaultImageSize
|-
local class = args['изобр' .. v .. 'класс'] or defaultImageClass
| <code>инвизображение</code> || Иконка объекта в инвентаре. Можно указать <code>нет</code>, чтобы убрать изображение. Использует [[Модуль:Инвентарный слот]] и поддерживает спрайты. || <code><nowiki>{{SUBPAGENAME}}</nowiki></code>
local caption = args['изобр' .. v .. 'описание']
|-
| <code>инвизображение''N''</code> || Другие инвентарные изображения объекта. || ''нет''
if mw.ustring.lower(image) == 'назв' or image == 'title' then
|-
local filename
| <code>тип</code> || Тип (оружие, материал, инструмент, и т. п.) || ?
if mod then
|-
filename = title .. ' (' .. mod .. ').png'
| <code>толькоплатформы</code> || Нужно указать, только если предмет доступен в определённых изданиях Minecraft. || ''нет''
elseif titleObject.isSubpage then
|-
filename = title .. ' (' .. titleObject.baseText .. ').png'
| <code>прочн</code> || Прочность предмета || ''(неприменимо)''
else
|-
filename = title .. '.png'
| <code>возобн</code> || Является ли предмет [[Возобновляемый ресурс|возобновляемым]] || ?
end
|-
local imageTitle = mw.title.new( 'Файл:' .. filename )
| <code>Склад</code> || Складывается ли предмет в стопки || ?
if imageTitle and imageTitle.exists then
|-
image = '[[Файл:' .. filename .. '|' .. size .. '|class=' .. (class or '') .. ']]'
| <code>id</code> || Технический числовой идентификатор сущности (0—255), также используемый в сетевом протоколе, если для него не указан отдельный идентификатор. (см. http://wiki.vg/Entities#Mobs) || ?
elseif titleObject.namespace == 0 then
|-
image = '[[Файл:No image.svg|' .. size .. '|link=Файл:' .. filename .. '|Загрузить ' .. filename .. ']]'
| <code>сетевой_id</code> || Используемый в сетевом протоколе идентификатор (0—255), если отличается от технического ID. (см. http://wiki.vg/Entities#Objects) || ''нет''
else
|-
image = '[[Файл:No image.svg|' .. size .. '|link=|Изображение отсутствует]]'
| <code>сущн_id</code> || EntityID сущности для сохранённых миров || ?
end
|-
elseif image:match(';') then
| <code>здоровье</code> || Здоровье соответствующей предмету сущности || ''нет''
if not animate then
|-
animate = require( 'Модуль:Анимация' ).animate
| <code>дроп</code> || Дроп сущности при разрушении || ''нет''
end
|-
image = animate{ image, size, nil, class }
| <code>опыт</code> || Способ получения опыта и объём получаемого опыта || ''нет''
else
|-
image = '[[Файл:' .. image .. '|' .. size .. '|class=' .. (class or '') .. ']]'
| <code>звуки</code> || Звуки предмета-сущности || ''нет''
end
|-
| <code>данные</code> || Одно десятичное значение данных || ''нет''
if caption and mw.ustring.lower(caption) ~= 'нет' then
|-
caption = '<div class="infobox-imagecaption">' .. caption .. '</div>'
| <code>текст_id</code> || Текстовый идентификатор предмета. Если <code>нет</code>, так и следует указать. || ?
else
|-
caption = ''
| <code>многоданных</code> || Много десятичных значений данных, используйте шаблон {{tl|dv}}. || ''Нет''
end
|}
table.insert( images, '<div>' .. image .. caption .. '</div>' )
end
images = table.concat( images, '\n' )
if #invImgCount > 0 then
table.sort( invImgCount )
local grid
for k, v in ipairs( invImgCount ) do
local image = args['инвизображение' .. v]
if mw.ustring.lower(image) == 'назв' or image == 'title' then
local imageExists
if mod then
local tryLoadData = require([[Модуль:Специальные утилиты]]).tryLoadData
local modInvIds = tryLoadData([[Модуль:ИнвСпрайт/]] .. mod)
local modAliases = tryLoadData([[Модуль:Инвентарный слот/Псевдонимы/]] .. mod)
if modAliases and modAliases[title] or modInvIds and modInvIds["IDы"][title] then
imageExists = true
else
local imageTitle = mw.title.new('Файл:Grid ' .. title .. ' (' .. mod .. ').png')
imageExists = imageTitle and imageTitle.exists
end
else
local invEnglish = mw.loadData([[Модуль:Инвентарный слот/Англоязычные названия]])
local invIds = mw.loadData( [[Модуль:ИнвСпрайт]] )["IDы"]
local invAliases = mw.loadData([[Модуль:Инвентарный слот/Псевдонимы]])
if invAliases[title] or invEnglish[title] or invIds[title] then
imageExists = true
else
local imageTitle = mw.title.new( 'Файл:Grid ' .. title .. '.png' )
imageExists = imageTitle and imageTitle.exists
end
end
if imageExists then
image = title
else
image = false
end
end
if image == '----' then
table.insert( invImages, '</div><div style="padding-top:.5em">' )
elseif image then
if not grid then
grid = require( 'Модуль:Инвентарный слот' ).slot
end
table.insert( invImages, grid{ image, ['ссылка'] = 'нет', ['мод'] = mod } )
end
end
if grid and #invImages > 0 then
invImages = '<div class="infobox-invimages"><div>' .. table.concat( invImages, '' ) .. '</div></div>'
else
invImages = ''
end
else
invImages = ''
end
if images ~= '' or invImages ~= '' then
imageArea = images .. '\n' .. invImages
end
end
if imageArea and mw.ustring.lower(imageArea) ~= 'нет' then
imageArea = '<div class="infobox-imagearea">' .. imageArea .. '</div>'
else
imageArea = ''
end
local extraText = args["доптекст"]
if extraText and mw.ustring.lower(extraText) ~= 'нет' then
extraText = '<div class="infobox-extratext">' .. extraText .. '</div>'
else
extraText = ''
end
local imageAreaExpanded = imageArea .. '' .. extraText
local rowsClass = ''
if imageAreaExpanded and imageAreaExpanded ~= '' then
rowsClass = ' infobox-rows-alternate'
end
local footer = args["подвал"]
if footer then
footer = '| class="infobox-footer" colspan="2" | ' .. footer
end


== См. также ==
local styles = { args["стиль"] }
{{См. также Карточка}}
local width = args["ширина"]
if width then
if not width:match("px$") then
-- временно, для совместимости
width = width .. 'px'
end
styles[#styles+1] = "width:" .. width
end
local style = ""
if #styles > 0 then
style = ' style="' .. table.concat(styles, ";") .. '"'
end
local rows = args["ряды"] or ''
if type(rows) == "table" then
local sRows = {}
for _, row in ipairs(rows) do
table.insert(sRows, row["заголовок"] and p.header(row) or p.row(row))
end
rows = table.concat(sRows, '\n')
end
local html = {
'<div class="infobox notaninfobox"' .. style .. '>',
'<div class="infobox-title">' .. titleArea .. '</div>',
imageAreaExpanded,
'{| class="infobox-rows' .. rowsClass ..'" cellspacing="1" cellpadding="4"',
'|-',
rows,
footer or '',
'|}',
'</div>'
}
if args["цвет"] then
table.insert(html, "[[Категория:Страницы с вызовом устаревших параметров]]")
end
return table.concat( html, '\n' )
end


<includeonly><!--
-- Создаёт ряд карточки. Предназначена для использования только в модулях
Здесь следует размещать категории и интервики шаблона -->
-- В шаблонах используйте {{Ряд карточки}}
[[Категория:Карточки|П]]
function p.row(args)
local label = args[1] or args["ярлык"]
local data = args[2] or args["поле"]
if not data then
data = label
label = nil
end
local class = args["класс"] or ''
if class ~= '' then
class = 'class="' .. class .. '"'
end
if label then
return table.concat {
"|-\n! ", mw.ustring.gsub(label, "^%l", mw.ustring.upper),
"\n| ", class, " |\n",
data
}
else
return table.concat {
"| ", class, " colspan=2 |\n",
data
}
end
end


[[cs:Šablona:ItemEntity]]
-- Создаёт заголовок карточки. Предназначена для использования только в модулях
[[de:Vorlage:Objekt]]
-- В шаблонах используйте {{Заголовок карточки}}
[[en:Template:Infobox item entity]]
function p.header(args)
[[es:Plantilla:EntidadObjeto]]
local header = args[1] or args["заголовок"]
[[fr:Modèle:ObjetEntité]]
[[it:Template:Oggetto entità]]
-- Стили строки
[[ja:テンプレート:Infobox item entity]]
local collapsible = ""
[[ko:틀:ItemEntity]]
if args["складываемый"] then
[[lzh:模板:ItemEntity]]
collapsible = " collapsible" .. (args["сложить"] and " collapsed" or "")
[[nl:Sjabloon:ItemEntity]]
end
[[pt:Predefinição:Infobox de entidade-item]]
[[th:แม่แบบ:Infobox item entity]]
-- Стили столбца
[[uk:Шаблон:Предмет-сутність]]
local class = args["класс"] or "infobox-title"
</includeonly><noinclude><!--
local style = args["стиль"] or ""
Здесь следует размещать категории и интервики документации -->
if style ~= '' then
[[cs:Šablona:ItemEntity/doc]]
style = 'style="' .. style .. '"'
[[de:Vorlage:Objekt/Dokumentation]]
end
[[en:Template:Infobox item entity/doc]]
[[es:Plantilla:EntidadObjeto/doc]]
return table.concat {
[[fr:Modèle:ObjetEntité/doc]]
'|- class="collapsible-rows', collapsible,
[[it:Template:Oggetto entità/doc]]
'"\n| colspan=2 class="infobox-header ', class, '" |\n',
[[ja:テンプレート:Infobox item entity/doc]]
header
[[ko:틀:ItemEntity/doc]]
}
[[lzh:模板:ItemEntity/doc]]
end
[[nl:Sjabloon:ItemEntity/doc]]
 
[[pt:Predefinição:Infobox de entidade-item/doc]]
return p
[[th:แม่แบบ:Infobox item entity/doc]]
[[uk:Шаблон:Предмет-сутність/док]]
</noinclude>

Текущая версия от 18:56, 4 августа 2025

local p = {}

-- Создаёт карточку function p.infobox(f) local args = f if f == mw.getCurrentFrame() then args = require( 'Модуль:ProcessArgs' ).merge( true ) else f = mw.getCurrentFrame() end local titleObject = mw.title.getCurrentTitle() local title = args['название'] or titleObject.subpageText local subtitle = args["подзаголовок"] or ""

local titleArea = args["шапка"] if not titleArea then if subtitle == then titleArea = title else titleArea = title .. '
' .. subtitle .. '' end end

local mod = args["мод"] if mod then local mods = mw.loadData("Модуль:Модификации") mod = mods[mod] or mod end

local imageArea = args["изображения"] if not imageArea then local images = {} local invImages = {} local defaultImageSize = args["умолчразмеризобр"] or '160px' local defaultImageClass = args["умолчклассизобр"] args["изображение1"] = args["изображение1"] or args["изображение"] args["изобр1описание"] = args["изобр1описание"] or args["изоброписание"] args["изобр1разм"] = args["изобр1разм"] or args["изобрразм"] args["изобр1класс"] = args["изобр1класс"] or args["изобркласс"] or 'pageimage' args["инвизображение1"] = args["инвизображение1"] or args["инвизображение"] or 'назв' args['группа1'] = args['группа1'] or args['группа'] args['групп1разм'] = args['групп1разм'] or args['группразм'] args['групп1класс'] = args['групп1класс'] or args['группкласс'] args['групп1описание'] = args['групп1описание'] or args['группописание'] or

if not (args["изображение1"] or args["группа1"]) then args["изображение1"] = "назв" end

local imgCount = {} local invImgCount = {} local groupCount = {} local groupImgList = {} for k, v in pairs( args ) do if type( k ) == "string" and k ~= "ряды" then local image, num = mw.ustring.match(k, '^(изображение)(%d+)$' ) local invImage, invNum = mw.ustring.match(k, '^(инвизображение)(%d+)$' ) local group, groupNum = mw.ustring.match(k, '^(группа)(%d+)$' ) local groupImg, groupImgNum = mw.ustring.match(k, '^(%d+)-(%d+)$' ) if mw.ustring.lower(v) ~= 'нет' then if image then table.insert( imgCount, tonumber( num ) ) elseif invImage then table.insert( invImgCount, tonumber( invNum ) ) elseif group then table.insert( groupCount, tonumber( groupNum ) ) if not groupImgList['группа' .. groupNum] then groupImgList['группа' .. groupNum] = {} end elseif groupImg then if not groupImgList['группа' .. groupImg] then groupImgList['группа' .. groupImg] = {} end table.insert( groupImgList['группа' .. groupImg], tonumber( groupImgNum ) ) end end end end

local animate if #groupCount > 0 then table.sort( groupCount ) local tabber = {} for k, v in ipairs( groupCount ) do local group = args['группа' .. v] local groupSize = args['групп' .. v .. 'разм'] or defaultImageSize local groupClass = args['групп' .. v .. 'класс'] or defaultImageClass local groupCaption = args['групп' .. v .. 'описание'] or local groupImages = {}

table.sort( groupImgList['группа' .. v] ) for _, w in ipairs( groupImgList['группа' .. v] ) do local image = args[v .. '-' .. w] local size = args[v .. '-' .. w .. 'разм'] or args['*-' .. w .. 'разм'] or groupSize local class = args[v .. '-' .. w .. 'класс'] or args['*-' .. w .. 'класс'] or groupClass local caption = args[v .. '-' .. w .. 'описание'] or args['*-' .. w .. 'описание'] or

if image:match( ';' ) then if not animate then animate = require( 'Модуль:Анимация' ).animate end image = animate{ image, size, nil, class } else image = '' .. size .. '' end

if caption ~= then

caption = '

\n' .. caption .. '\n

'

end

table.insert( groupImages, '

' .. image .. caption .. '

' )

end

if groupCaption ~= then

groupCaption = '

\n' .. groupCaption .. '\n

'

end

table.insert( tabber, '|-|' .. group .. '=\n' .. table.concat( groupImages, '\n' ) .. groupCaption ) end

table.insert( images, '

' .. f:extensionTag( 'tabber', table.concat( tabber, '\n' ) ) .. '

' )

end

table.sort( imgCount ) local animate for k, v in ipairs( imgCount ) do local image = args['изображение' .. v] local size = args['изобр' .. v .. 'разм'] or defaultImageSize local class = args['изобр' .. v .. 'класс'] or defaultImageClass local caption = args['изобр' .. v .. 'описание']

if mw.ustring.lower(image) == 'назв' or image == 'title' then local filename if mod then filename = title .. ' (' .. mod .. ').png' elseif titleObject.isSubpage then filename = title .. ' (' .. titleObject.baseText .. ').png' else filename = title .. '.png' end local imageTitle = mw.title.new( 'Файл:' .. filename ) if imageTitle and imageTitle.exists then image = '' .. size .. '' elseif titleObject.namespace == 0 then image = 'Загрузить ' .. filename .. '' else image = 'Изображение отсутствует' end elseif image:match(';') then if not animate then animate = require( 'Модуль:Анимация' ).animate end image = animate{ image, size, nil, class } else image = '' .. size .. '' end

if caption and mw.ustring.lower(caption) ~= 'нет' then

caption = '

' .. caption .. '

'

else caption = end

table.insert( images, '

' .. image .. caption .. '

' )

end images = table.concat( images, '\n' )

if #invImgCount > 0 then table.sort( invImgCount ) local grid for k, v in ipairs( invImgCount ) do local image = args['инвизображение' .. v] if mw.ustring.lower(image) == 'назв' or image == 'title' then local imageExists if mod then local tryLoadData = require(Модуль:Специальные утилиты).tryLoadData local modInvIds = tryLoadData(Модуль:ИнвСпрайт/ .. mod) local modAliases = tryLoadData(Модуль:Инвентарный слот/Псевдонимы/ .. mod) if modAliases and modAliases[title] or modInvIds and modInvIds["IDы"][title] then imageExists = true else local imageTitle = mw.title.new('Файл:Grid ' .. title .. ' (' .. mod .. ').png') imageExists = imageTitle and imageTitle.exists end else local invEnglish = mw.loadData(Модуль:Инвентарный слот/Англоязычные названия) local invIds = mw.loadData( Модуль:ИнвСпрайт )["IDы"] local invAliases = mw.loadData(Модуль:Инвентарный слот/Псевдонимы) if invAliases[title] or invEnglish[title] or invIds[title] then imageExists = true else local imageTitle = mw.title.new( 'Файл:Grid ' .. title .. '.png' ) imageExists = imageTitle and imageTitle.exists end end if imageExists then image = title else image = false end end

if image == '----' then

table.insert( invImages, '

' )

elseif image then if not grid then grid = require( 'Модуль:Инвентарный слот' ).slot end table.insert( invImages, grid{ image, ['ссылка'] = 'нет', ['мод'] = mod } ) end end

if grid and #invImages > 0 then

invImages = '
' .. table.concat( invImages, ) .. '
'

else invImages = end else invImages = end

if images ~= or invImages ~= then imageArea = images .. '\n' .. invImages end end if imageArea and mw.ustring.lower(imageArea) ~= 'нет' then

imageArea = '
' .. imageArea .. '
'

else imageArea = end

local extraText = args["доптекст"] if extraText and mw.ustring.lower(extraText) ~= 'нет' then

extraText = '
' .. extraText .. '
'

else extraText = end

local imageAreaExpanded = imageArea .. .. extraText local rowsClass = if imageAreaExpanded and imageAreaExpanded ~= then rowsClass = ' infobox-rows-alternate' end

local footer = args["подвал"] if footer then footer = '| class="infobox-footer" colspan="2" | ' .. footer end

local styles = { args["стиль"] } local width = args["ширина"] if width then if not width:match("px$") then -- временно, для совместимости width = width .. 'px' end styles[#styles+1] = "width:" .. width end local style = "" if #styles > 0 then style = ' style="' .. table.concat(styles, ";") .. '"' end

local rows = args["ряды"] or if type(rows) == "table" then local sRows = {} for _, row in ipairs(rows) do table.insert(sRows, row["заголовок"] and p.header(row) or p.row(row)) end rows = table.concat(sRows, '\n') end

local html = {

'
', '
' .. titleArea .. '
',

imageAreaExpanded, '{| class="infobox-rows' .. rowsClass ..'" cellspacing="1" cellpadding="4"', '|-', rows, footer or , '|}',

'
'

}

if args["цвет"] then table.insert(html, "") end

return table.concat( html, '\n' ) end

-- Создаёт ряд карточки. Предназначена для использования только в модулях -- В шаблонах используйте Шаблон:Ряд карточки function p.row(args) local label = args[1] or args["ярлык"] local data = args[2] or args["поле"] if not data then data = label label = nil end local class = args["класс"] or if class ~= then class = 'class="' .. class .. '"' end

if label then return table.concat { "|-\n! ", mw.ustring.gsub(label, "^%l", mw.ustring.upper), "\n| ", class, " |\n", data } else return table.concat { "| ", class, " colspan=2 |\n", data } end end

-- Создаёт заголовок карточки. Предназначена для использования только в модулях -- В шаблонах используйте Шаблон:Заголовок карточки function p.header(args) local header = args[1] or args["заголовок"]

-- Стили строки local collapsible = "" if args["складываемый"] then collapsible = " collapsible" .. (args["сложить"] and " collapsed" or "") end

-- Стили столбца local class = args["класс"] or "infobox-title" local style = args["стиль"] or "" if style ~= then style = 'style="' .. style .. '"' end

return table.concat { '|- class="collapsible-rows', collapsible, '"\n| colspan=2 class="infobox-header ', class, '" |\n', header } end

return p