Module:StreetBrawlItems: Difference between revisions

Vergir (talk | contribs)
Filter out disabled items; render Common as a clickable label toggle with a pipe-delimited list (with help from vergir-bot LLM)
Vergir (talk | contribs)
Common: use native collapsible toggle so its state class drives a flipping caret (with help from vergir-bot LLM)
Line 122: Line 122:


if collapse then
if collapse then
-- Common: a bold label (like Favored/Unfavored) that toggles a collapsed,
-- Common: a native collapsible whose header ("Common") reads like the other
-- pipe-delimited list of the remaining pool items.
-- labels; styles.css hides the default toggle text and shows a flipping caret.
local id = "sbcommon-" .. hkey .. "-" .. tostring(tier or 0)
local head = (label ~= "" and label) or "Common"
local head = (label ~= "" and label) or "Common"
return '<div class="sb-group">'
return '{| class="wikitable mw-collapsible mw-collapsed sb-common"\n'
.. '<div class="sb-label sb-toggle mw-customtoggle-' .. id .. '">' .. head .. '</div>'
.. '! class="sb-common-head" | ' .. head .. '\n|-\n'
.. '<div class="sb-common mw-collapsible mw-collapsed" id="mw-customcollapsible-' .. id .. '">'
.. '| <div class="sb-common-body">' .. table.concat(parts, " | ") .. '</div>\n|}'
.. '<div class="sb-common-body mw-collapsible-content">' .. table.concat(parts, " | ") .. '</div>'
.. '</div></div>'
end
end