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') | ||
-- | -- Group by location: each location with I/O gets a stripe group | ||
for _, loc in ipairs(locations) do | |||
local inputCount = countIOByLocation(frame, fullPageName, 'input', loc) | |||
local outputCount = countIOByLocation(frame, fullPageName, 'output', loc) | |||
if | 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 | ||
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 | ||
-- Outputs for this location | |||
if outputCount > 0 then | |||
if | |||
local locOutputs = queryIOByLocation(frame, fullPageName, 'output', loc) | local locOutputs = queryIOByLocation(frame, fullPageName, 'output', loc) | ||
if locOutputs and locOutputs ~= '' then | if locOutputs and locOutputs ~= '' then | ||
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 | end | ||
end | end | ||