Module:RemoteControl: Difference between revisions
Arclight changed the content model of the page Module:RemoteControl from "wikitext" to "Scribunto module" |
Add complete inline styles for border, backgrounds to match CRT model infobox (via update-page on MediaWiki MCP Server) |
||
| Line 22: | Line 22: | ||
local section = container:tag('div') | local section = container:tag('div') | ||
section:addClass('infobox-section-header') | section:addClass('infobox-section-header') | ||
css(section, 'grid-column: 1 / -1; text-align:center; padding:0.5em; font-weight:bold;') | css(section, 'grid-column: 1 / -1; text-align:center; padding:0.5em; font-weight:bold; background-color:#c8ccd1;') | ||
section:wikitext(title) | section:wikitext(title) | ||
end | end | ||
| Line 29: | Line 29: | ||
local labelDiv = container:tag('div') | local labelDiv = container:tag('div') | ||
labelDiv:addClass('infobox-label') | labelDiv:addClass('infobox-label') | ||
css(labelDiv, 'padding:0.2em 0.4em; font-weight:bold; text-align:left;') | css(labelDiv, 'padding:0.2em 0.4em; font-weight:bold; text-align:left; background-color:#eaecf0;') | ||
labelDiv:wikitext(label) | labelDiv:wikitext(label) | ||
local valueDiv = container:tag('div') | local valueDiv = container:tag('div') | ||
valueDiv:addClass('infobox-value') | valueDiv:addClass('infobox-value') | ||
css(valueDiv, 'padding:0.2em 0.4em;') | css(valueDiv, 'padding:0.2em 0.4em; background-color:#f8f9fa;') | ||
if isRawHtml then | if isRawHtml then | ||
| Line 74: | Line 74: | ||
container:addClass('infobox') | container:addClass('infobox') | ||
container:addClass('infobox-remote-control') | container:addClass('infobox-remote-control') | ||
css(container, 'float:right; clear:right; margin:0 0 1em 1em; width:22em; font-size:88%; line-height:1.5em; display:grid; grid-template-columns:auto 1fr; gap: | css(container, 'float:right; clear:right; margin:0 0 1em 1em; width:22em; font-size:88%; line-height:1.5em; display:grid; grid-template-columns:auto 1fr; gap:0; padding:0; border:1px solid #a2a9b1; background-color:#f8f9fa;') | ||
-- Title row | -- Title row | ||
addFullRow( | addFullRow( | ||
container, | container, | ||
(brand or '') .. ' ' .. (model_code or ''), | (brand or '') .. ' ' .. (model_code or ''), | ||
'text-align:center; font-size:125%; font-weight:bold; padding:0.5em;', | 'text-align:center; font-size:125%; font-weight:bold; padding:0.5em; background-color:#c8ccd1;', | ||
false, | false, | ||
'infobox-title' | 'infobox-title' | ||
| Line 90: | Line 90: | ||
container, | container, | ||
string.format('[[File:%s|frameless|300px]]', file), | string.format('[[File:%s|frameless|300px]]', file), | ||
'text-align:center; padding:0;', | 'text-align:center; padding:0.5em; background-color:#f8f9fa;', | ||
false, | false, | ||
'infobox-image' | 'infobox-image' | ||
| Line 128: | Line 128: | ||
-- Create the edit button div | -- Create the edit button div | ||
local editDiv = container:tag('div') | local editDiv = container:tag('div') | ||
css(editDiv, 'grid-column: 1 / -1; padding:0. | css(editDiv, 'grid-column: 1 / -1; padding:0.5em; text-align:center; background-color:#f8f9fa;') | ||
-- Add edit button with | -- Add edit button with inline styling for the button | ||
editDiv:wikitext('[' .. tostring(editUrl) .. ' <span | editDiv:wikitext('[' .. tostring(editUrl) .. ' <span style="display:inline-block; padding:0.5em 1em; background-color:#36c; color:#fff; border-radius:3px; text-decoration:none;">Edit this data</span>]') | ||
-- Return templatestyles tag + container HTML | -- Return templatestyles tag + container HTML | ||