Module:AVDevice: Difference between revisions

Rename "Links" section to "Archival Links" for consistency with CRT and Accessory infoboxes (via update-page on MediaWiki MCP Server)
Connectivity section: group inputs/outputs by location with left stripe (mirrors TBC group pattern) (via update-page on MediaWiki MCP Server)
Line 313: Line 313:
addSectionRow(container, 'Connectivity')
addSectionRow(container, 'Connectivity')
-- Inputs grouped by location
-- Group by location: each location with I/O gets a stripe group
if hasInputs then
for _, loc in ipairs(locations) do
local inputsContent = ''
local inputCount = countIOByLocation(frame, fullPageName, 'input', loc)
for _, loc in ipairs(locations) do
local outputCount = countIOByLocation(frame, fullPageName, 'output', loc)
local count = countIOByLocation(frame, fullPageName, 'input', loc)
if count > 0 then
if inputCount > 0 or outputCount > 0 then
-- Create a location group with left stripe (mirrors TBC group pattern)
local group = container:tag('div')
group:addClass('infobox-io-location-group')
css(group, 'grid-column: 1 / -1; display:grid; grid-template-columns:auto 1fr; gap:3px;')
-- Location header spanning full width
local locHeader = group:tag('div')
locHeader:addClass('infobox-io-location-header')
css(locHeader, 'grid-column: 1 / -1; padding:0.2em 0.4em; font-weight:bold; font-size:0.92em;')
locHeader:wikitext(locationLabels[loc])
-- Inputs for this location
if inputCount > 0 then
local locInputs = queryIOByLocation(frame, fullPageName, 'input', loc)
local locInputs = queryIOByLocation(frame, fullPageName, 'input', loc)
if locInputs and locInputs ~= '' then
if locInputs and locInputs ~= '' then
inputsContent = inputsContent .. "<div style='margin-bottom:0.3em;'><strong>" .. locationLabels[loc] .. "</strong><br/>" .. locInputs .. "</div>"
local inputLabelDiv = group:tag('div')
inputLabelDiv:addClass('infobox-label')
css(inputLabelDiv, 'padding:0.2em 0.4em; font-weight:bold; text-align:left;')
inputLabelDiv:wikitext('Inputs')
local inputValueDiv = group:tag('div')
inputValueDiv:addClass('infobox-value')
css(inputValueDiv, 'padding:0.2em 0.4em;')
inputValueDiv:node(mw.html.create('span'):wikitext(locInputs))
end
end
end
end
end
if inputsContent ~= '' then
-- Outputs for this location
addRow(container, 'Inputs', inputsContent, true)
if outputCount > 0 then
end
end
 
-- Outputs grouped by location
if hasOutputs then
local outputsContent = ''
for _, loc in ipairs(locations) do
local count = countIOByLocation(frame, fullPageName, 'output', loc)
if count > 0 then
local locOutputs = queryIOByLocation(frame, fullPageName, 'output', loc)
local locOutputs = queryIOByLocation(frame, fullPageName, 'output', loc)
if locOutputs and locOutputs ~= '' then
if locOutputs and locOutputs ~= '' then
outputsContent = outputsContent .. "<div style='margin-bottom:0.3em;'><strong>" .. locationLabels[loc] .. "</strong><br/>" .. locOutputs .. "</div>"
local outputLabelDiv = group:tag('div')
outputLabelDiv:addClass('infobox-label')
css(outputLabelDiv, 'padding:0.2em 0.4em; font-weight:bold; text-align:left;')
outputLabelDiv:wikitext('Outputs')
local outputValueDiv = group:tag('div')
outputValueDiv:addClass('infobox-value')
css(outputValueDiv, 'padding:0.2em 0.4em;')
outputValueDiv:node(mw.html.create('span'):wikitext(locOutputs))
end
end
end
end
end
if outputsContent ~= '' then
addRow(container, 'Outputs', outputsContent, true)
end
end
end
end
MediaWiki Appliance - Powered by TurnKey Linux